Fix some other shorten-64-to-32 casting error found by MSVC (64bits)

Thanks to Pascal
This commit is contained in:
Alexis La Goutte 2014-08-04 09:04:29 +02:00
parent 6c71889552
commit ec93c9f55f
1 changed files with 5 additions and 5 deletions

View File

@ -515,7 +515,7 @@ static ssize_t decode_length(uint32_t *res, size_t *shift_ptr, int *final,
if(++in == last) { if(++in == last) {
*res = n; *res = n;
return in - start; return (ssize_t)(in - start);
} }
} }
@ -545,12 +545,12 @@ static ssize_t decode_length(uint32_t *res, size_t *shift_ptr, int *final,
if(in == last) { if(in == last) {
*res = n; *res = n;
return in - start; return (ssize_t)(in - start);
} }
*res = n; *res = n;
*final = 1; *final = 1;
return in + 1 - start; return (ssize_t)(in + 1 - start);
} }
static int emit_table_size(nghttp2_bufs *bufs, size_t table_size) static int emit_table_size(nghttp2_bufs *bufs, size_t table_size)
@ -871,10 +871,10 @@ static search_result search_hd_table(nghttp2_hd_context *context,
nghttp2_hd_entry *ent = hd_ringbuf_get(&context->hd_table, i); nghttp2_hd_entry *ent = hd_ringbuf_get(&context->hd_table, i);
if(ent->name_hash == name_hash && name_eq(&ent->nv, nv)) { if(ent->name_hash == name_hash && name_eq(&ent->nv, nv)) {
if(res.index == -1) { if(res.index == -1) {
res.index = (ssize_t)i + NGHTTP2_STATIC_TABLE_LENGTH; res.index = (ssize_t)(i + NGHTTP2_STATIC_TABLE_LENGTH);
} }
if(ent->value_hash == value_hash && value_eq(&ent->nv, nv)) { if(ent->value_hash == value_hash && value_eq(&ent->nv, nv)) {
res.index = (ssize_t)i + NGHTTP2_STATIC_TABLE_LENGTH; res.index = (ssize_t)(i + NGHTTP2_STATIC_TABLE_LENGTH);
res.name_value_match = 1; res.name_value_match = 1;
return res; return res;
} }