summaryrefslogtreecommitdiff
path: root/upb/pb/encoder.c
diff options
context:
space:
mode:
authorMartin Maly <mmaly@google.com>2015-05-06 13:18:33 -0700
committerMartin Maly <mmaly@google.com>2015-05-06 16:50:30 -0700
commit508c39ee133d6725a4440ba98a1555e2026975c2 (patch)
treeda5a49a715a9af60fd6630e3462ad0b1bf8781c0 /upb/pb/encoder.c
parent535bc2fe2f2b467f59347ffc9449e11e47791257 (diff)
Resolve compilation errors if compiled with more stringent semantic checks.
Adding Travis test to build with strict warnings. Fixing a warning in a test which used signed/unsigned integer comparison.
Diffstat (limited to 'upb/pb/encoder.c')
-rw-r--r--upb/pb/encoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/upb/pb/encoder.c b/upb/pb/encoder.c
index d5685dc..2534a4d 100644
--- a/upb/pb/encoder.c
+++ b/upb/pb/encoder.c
@@ -79,7 +79,7 @@ static upb_pb_encoder_segment *top(upb_pb_encoder *e) {
// Call to ensure that at least "bytes" bytes are available for writing at
// e->ptr. Returns false if the bytes could not be allocated.
static bool reserve(upb_pb_encoder *e, size_t bytes) {
- if ((e->limit - e->ptr) < bytes) {
+ if ((size_t)(e->limit - e->ptr) < bytes) {
size_t needed = bytes + (e->ptr - e->buf);
size_t old_size = e->limit - e->buf;
size_t new_size = old_size;
@@ -110,7 +110,7 @@ static bool reserve(upb_pb_encoder *e, size_t bytes) {
// Call when "bytes" bytes have been writte at e->ptr. The caller *must* have
// previously called reserve() with at least this many bytes.
static void encoder_advance(upb_pb_encoder *e, size_t bytes) {
- assert((e->limit - e->ptr) >= bytes);
+ assert((size_t)(e->limit - e->ptr) >= bytes);
e->ptr += bytes;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback