3 ms·
Gotcha. I'm not an OS guy, and didn't know that convention. Thanks! Dumb question though: If rehash can only return -1 or 0, won't if(rehash(H)) always f
by qeorge 15y ago
Gotcha. I'm not an OS guy, and didn't know that convention. Thanks!
Dumb question though:
If rehash can only return -1 or 0, won't
if(rehash(H))
always fail?
- cperciva 15y agoDumb question though... There's no such thing as a dumb question, only people too dumb to take every available opportunity to learn. ;-) In C, "if (foo)" means "if (foo != 0)" if foo has integer type, so that line means "if (rehash(H) != 0)" or (since rehash only returns 0 or -1) equivalently "if (rehash(H) == -1)".
- qeorge 15y agoThanks so much Colin, I'm learning a lot today. :)
- ralph 15y agoThe reason for the convention is that there's often only one form of success, so 0 suffices, but there may be many causes of failure.