From: Michael Adam Date: Fri, 27 Jun 2008 06:23:26 +0000 (+0200) Subject: tdb_unpack: Eliminate "cast to pointer from integer of different size" warning on... X-Git-Tag: samba-4.0.0alpha5~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a516bc9a2d4ce86244d0e2fbfacf6fda5e12e987;p=thirdparty%2Fsamba.git tdb_unpack: Eliminate "cast to pointer from integer of different size" warning on 64bit. The 'p' type is just a flag to mark the presence of a pointer, not a real pointer itself. The code is now the same as in Samba3's tdb_unpack. Michael --- diff --git a/source/lib/util/util_tdb.c b/source/lib/util/util_tdb.c index 77ad4eb6178..e4219dfd69f 100644 --- a/source/lib/util/util_tdb.c +++ b/source/lib/util/util_tdb.c @@ -482,7 +482,13 @@ int tdb_unpack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...) p = va_arg(ap, void **); if (bufsize < len) goto no_space; - *p = (void *)IVAL(buf, 0); + + /* + * This isn't a real pointer - only a token (1 or 0) + * to mark the fact a pointer is present. + */ + + *p = (void *)(IVAL(buf, 0) ? (void *)1 : NULL); break; case 'P': /* Return a malloc'ed string. */