summaryrefslogtreecommitdiff
path: root/nestegg
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2013-05-19 12:54:23 +0300
committerMartin Storsjo <martin@martin.st>2013-06-07 10:18:59 +0300
commitbf8c6207786bc64716186cb2ca8955344dde6307 (patch)
treea3dbe0cbaab6e940244cc88cc803b9c33b447d4c /nestegg
parentec34afd1b0bc5ffe4679fd18e9d8982643a3380e (diff)
downloadlibvpx-bf8c6207786bc64716186cb2ca8955344dde6307.tar
libvpx-bf8c6207786bc64716186cb2ca8955344dde6307.tar.gz
libvpx-bf8c6207786bc64716186cb2ca8955344dde6307.tar.bz2
libvpx-bf8c6207786bc64716186cb2ca8955344dde6307.zip
halloc: Cast the offsetof macro to ptrdiff_t before negating
This gets rid of the warning "C4146: unary minus applied to unsigned type, result still unsigned" with visual c++. Change-Id: I6eb24da983136d798221db4d3a5f50dc2857a03b
Diffstat (limited to 'nestegg')
-rw-r--r--nestegg/halloc/src/macros.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/nestegg/halloc/src/macros.h b/nestegg/halloc/src/macros.h
index c36b516ee..1f84bc277 100644
--- a/nestegg/halloc/src/macros.h
+++ b/nestegg/halloc/src/macros.h
@@ -20,7 +20,7 @@
/*
restore pointer to the structure by a pointer to its field
*/
-#define structof(p,t,f) ((t*)(- offsetof(t,f) + (char*)(p)))
+#define structof(p,t,f) ((t*)(- (ptrdiff_t) offsetof(t,f) + (char*)(p)))
/*
* redefine for the target compiler