mercurial/bitmanipulation.h
changeset 38312 1fb2510cf8c8
parent 34697 ce77b0563228
child 46720 eed42f1c22d6
equal deleted inserted replaced
38311:74b4a54002ec 38312:1fb2510cf8c8
     7 
     7 
     8 static inline uint32_t getbe32(const char *c)
     8 static inline uint32_t getbe32(const char *c)
     9 {
     9 {
    10 	const unsigned char *d = (const unsigned char *)c;
    10 	const unsigned char *d = (const unsigned char *)c;
    11 
    11 
    12 	return ((d[0] << 24) | (d[1] << 16) | (d[2] << 8) | (d[3]));
    12 	return ((((uint32_t)d[0]) << 24) | (((uint32_t)d[1]) << 16) |
       
    13 	        (((uint32_t)d[2]) << 8) | (d[3]));
    13 }
    14 }
    14 
    15 
    15 static inline int16_t getbeint16(const char *c)
    16 static inline int16_t getbeint16(const char *c)
    16 {
    17 {
    17 	const unsigned char *d = (const unsigned char *)c;
    18 	const unsigned char *d = (const unsigned char *)c;