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

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: fix overflow case 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..c1de1bf57340049a80d40dca2b26e49878f9af74 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((size_t)((char*)pointer->ptr - (char*)pointer) < max_offset);
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