From d804780c25590b1e9d13c4cb63aef74f6580bbc6 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 25 Sep 2015 01:45:28 +0900 Subject: [PATCH] Fix compile error with Android NDK and --enable-werror --- lib/nghttp2_hd.c | 3 ++- lib/nghttp2_hd_huffman.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 45e96407..c1b5b059 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -1321,7 +1321,8 @@ static search_result search_hd_table(nghttp2_hd_context *context, return res; } - res.index = context->next_seq - 1 - ent->seq + NGHTTP2_STATIC_TABLE_LENGTH; + res.index = + (ssize_t)(context->next_seq - 1 - ent->seq + NGHTTP2_STATIC_TABLE_LENGTH); if (exact_match) { res.name_value_match = 1; diff --git a/lib/nghttp2_hd_huffman.c b/lib/nghttp2_hd_huffman.c index fb2d167b..591636bb 100644 --- a/lib/nghttp2_hd_huffman.c +++ b/lib/nghttp2_hd_huffman.c @@ -157,7 +157,8 @@ int nghttp2_hd_huff_encode(nghttp2_bufs *bufs, const uint8_t *src, const nghttp2_huff_sym *sym = &huff_sym_table[256]; assert(avail); /* Caution we no longer adjust avail here */ - nghttp2_bufs_fast_orb(bufs, (uint8_t)(sym->code >> (sym->nbits - rembits))); + nghttp2_bufs_fast_orb( + bufs, (uint8_t)(sym->code >> (sym->nbits - (size_t)rembits))); } return 0;