diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-03 03:37:11 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-03 03:37:11 +0000 |
commit | d93ff0b82f9c4a983677cddf02d43b40f801d1a0 (patch) | |
tree | 36d29cd40d165c1af20ccd69cd055afb1d1e5c42 /src/common/util.h | |
parent | 7eaa655b6db66664b643b16b9d296b0858f31e42 (diff) | |
download | tor-d93ff0b82f9c4a983677cddf02d43b40f801d1a0.tar tor-d93ff0b82f9c4a983677cddf02d43b40f801d1a0.tar.gz |
Handle rendezvous relay cells
svn:r1464
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/common/util.h b/src/common/util.h index 60c5a5d75..ceed25792 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -68,15 +68,17 @@ void set_uint32(char *cp, uint32_t v); ((*(((uint8_t*)(cp))+3)) ) ) #define set_uint16(cp,v) \ do { \ + uint16_t u16v = (v); \ *(((uint8_t*)(cp))+0) = (v >> 8)&0xff; \ *(((uint8_t*)(cp))+1) = (v >> 0)&0xff; \ } while (0) -#define set_uint32(cp,v) \ +#define set_uint32(cp,val) \ do { \ - *(((uint8_t*)(cp))+0) = (v >> 24)&0xff; \ - *(((uint8_t*)(cp))+1) = (v >> 16)&0xff; \ - *(((uint8_t*)(cp))+2) = (v >> 8)&0xff; \ - *(((uint8_t*)(cp))+3) = (v >> 0)&0xff; \ + uint32_t u32v = (v); \ + *(((uint8_t*)(cp))+0) = s32 >> 24)&0xff; \ + *(((uint8_t*)(cp))+1) = s32 >> 16)&0xff; \ + *(((uint8_t*)(cp))+2) = s32 >> 8)&0xff; \ + *(((uint8_t*)(cp))+3) = s32 >> 0)&0xff; \ } while (0) #endif #endif @@ -197,5 +199,12 @@ int correct_socket_errno(int s); #define correct_socket_errno(s) (errno) #endif - #endif + +/* + Local Variables: + mode:c + indent-tabs-mode:nil + c-basic-offset:2 + End: +*/ |