happyfish100 / libfastcommon

c common functions library extracted from my open source project FastDFS. this library is very simple and stable. functions including: string, logger, chain, hash, socket, ini file reader, base64 encode / decode, url encode / decode, fast timer, skiplist, object pool etc. detail info please see the c header files.
http://bbs.chinaunix.net/forum-240-1.html
GNU Lesser General Public License v3.0
900 stars 529 forks source link

Update shared_func.c #10

Closed hanyunqi closed 7 years ago

hanyunqi commented 7 years ago

update is_power2:

inline bool is_power2(const int64_t n)
{
    return ((n != 0) && !(n & (n - 1)));    
}

reference