From d1f91f7c723733113b4e9792042101c80dfc064c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 3 Dec 2005 06:46:46 +0000 Subject: r12043: It's amazing the warnings you find when compiling on a 64-bit box with gcc4 and -O6... Fix a bunch of C99 dereferencing type-punned pointer will break strict-aliasing rules errors. Also added prs_int32 (not uint32...) as it's needed in one place. Find places where prs_uint32 was being used to marshall/unmarshall a time_t (a big no no on 64-bits). More warning fixes to come. Thanks to Volker for nudging me to compile like this. Jeremy. (This used to be commit c65b752604f8f58abc4e7ae8514dc2c7f086271c) --- source3/rpc_parse/parse_prs.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source3/rpc_parse/parse_prs.c') diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 77f0e6d5c8..7c84ee800b 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -707,6 +707,35 @@ BOOL prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32) return True; } +/******************************************************************* + Stream an int32. + ********************************************************************/ + +BOOL prs_int32(const char *name, prs_struct *ps, int depth, int32 *data32) +{ + char *q = prs_mem_get(ps, sizeof(int32)); + if (q == NULL) + return False; + + if (UNMARSHALLING(ps)) { + if (ps->bigendian_data) + *data32 = RIVALS(q,0); + else + *data32 = IVALS(q,0); + } else { + if (ps->bigendian_data) + RSIVALS(q,0,*data32); + else + SIVALS(q,0,*data32); + } + + DEBUG(5,("%s%04x %s: %08x\n", tab_depth(depth), ps->data_offset, name, *data32)); + + ps->data_offset += sizeof(int32); + + return True; +} + /******************************************************************* Stream a NTSTATUS ********************************************************************/ -- cgit