mirror of
https://github.com/moparisthebest/spdylay
synced 2024-11-12 04:25:09 -05:00
Rewritten to_uint32 using shift
This commit is contained in:
parent
01c6f7af4c
commit
5ea6ea476e
@ -185,12 +185,7 @@ static const char * method_strmap[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static inline uint32_t to_uint32(char *m) {
|
static inline uint32_t to_uint32(char *m) {
|
||||||
union {
|
return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0];
|
||||||
uint32_t i;
|
|
||||||
char data[4];
|
|
||||||
} u;
|
|
||||||
memcpy(u.data, m, 4);
|
|
||||||
return u.i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define _MIN_READ(a, b) ((a) < (b) ? (a) : (b))
|
#define _MIN_READ(a, b) ((a) < (b) ? (a) : (b))
|
||||||
|
Loading…
Reference in New Issue
Block a user