Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Unified Diff: mojo/public/c/bindings/lib/type_descriptor.c

Issue 2205963002: C bindings: Fix signed comparsion. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: oops Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/bindings/lib/type_descriptor.c
diff --git a/mojo/public/c/bindings/lib/type_descriptor.c b/mojo/public/c/bindings/lib/type_descriptor.c
index 2846965b02ee033f267a1463a89ff4fbd5702065..fb9df41ed5c3854e3e4a94c33faa999e7ad8809f 100644
--- a/mojo/public/c/bindings/lib/type_descriptor.c
+++ b/mojo/public/c/bindings/lib/type_descriptor.c
@@ -5,6 +5,7 @@
#include "mojo/public/c/bindings/lib/type_descriptor.h"
#include <assert.h>
+#include <stddef.h>
#include "mojo/public/c/bindings/array.h"
#include "mojo/public/c/bindings/interface.h"
@@ -85,7 +86,7 @@ static void encode_pointer(union MojomPointer* pointer, uint32_t max_offset) {
pointer->offset = 0;
} else {
assert((char*)pointer->ptr > (char*)pointer);
- assert((char*)pointer->ptr - (char*)pointer < max_offset);
+ assert((char*)pointer->ptr - (char*)pointer < (ptrdiff_t)max_offset);
viettrungluu 2016/08/02 20:10:29 Hmmm. So if ptrdiff_t is 32-bit, and max_offset is
vardhan 2016/08/02 20:28:30 Done.
pointer->offset = (char*)(pointer->ptr) - (char*)pointer;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698