Ahhh. This code is designed for big-endian processors. I'm testing on x86, which is little-endian. For little endian you can reorder the table, or change the last line to:
return 31-clz_table[n >> 27];
Geez, if it's in the config file can't you simply using floating point calcs to come up with your power-of-two divisor instead of all that clz hocus pocus? How often are they setting this value?
/me just looks at the posts, jaw dropped..... and thinks to himself "ahh to have the time avaliable in my life again to ponder the affects my lose coding will have on the universe"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum