diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-05-08 17:03:20 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-05-08 17:03:20 -0700 |
commit | fa10302a502de38a66ed921eeeacb4107e9572a2 (patch) | |
tree | 5ed1bca20a889458c431da37c701aae131e15c4a /upb/pb/encoder.c | |
parent | 3bd691a4975b2267ff04611507e766a7f9f87e83 (diff) | |
parent | bd7ea8c6f1854aa37b7792c6f23334ffc0fd94ff (diff) |
Merge from open-source development.
Diffstat (limited to 'upb/pb/encoder.c')
-rw-r--r-- | upb/pb/encoder.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/upb/pb/encoder.c b/upb/pb/encoder.c index 7a50996..ca5ebc1 100644 --- a/upb/pb/encoder.c +++ b/upb/pb/encoder.c @@ -141,7 +141,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) { // Grow buffer. size_t needed = bytes + (e->ptr - e->buf); size_t old_size = e->limit - e->buf; @@ -170,7 +170,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; } |