From bcc6a3786c30a76ac80529cc60f4958dfed9abc6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 27 Jun 2008 08:23:26 +0200 Subject: 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 (This used to be commit a516bc9a2d4ce86244d0e2fbfacf6fda5e12e987) --- source4/lib/util/util_tdb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4/lib/util/util_tdb.c') diff --git a/source4/lib/util/util_tdb.c b/source4/lib/util/util_tdb.c index 77ad4eb617..e4219dfd69 100644 --- a/source4/lib/util/util_tdb.c +++ b/source4/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. */ -- cgit