From d149af0487468ab874ae5e6c4af3b4f1a9415a66 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 20 Sep 2017 10:44:53 -0400 Subject: [PATCH] core: fix int conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build had failed with [-Werror=conversion] on gcc 7 ``` src/core/ext/transport/cronet/transport/cronet_transport.c: In function ‘create_grpc_frame’: src/core/ext/transport/cronet/transport/cronet_transport.c:693:10: error: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Werror=conversion] *p++ = (flags & GRPC_WRITE_INTERNAL_COMPRESS) ? 1 : 0; ^ ``` Signed-off-by: Vincent Batts --- src/core/ext/transport/cronet/transport/cronet_transport.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.cc b/src/core/ext/transport/cronet/transport/cronet_transport.cc index ff1367fb285..97e4f7d72bc 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.cc +++ b/src/core/ext/transport/cronet/transport/cronet_transport.cc @@ -692,7 +692,7 @@ static void create_grpc_frame(grpc_exec_ctx *exec_ctx, uint8_t *p = (uint8_t *)write_buffer; /* Append 5 byte header */ /* Compressed flag */ - *p++ = (flags & GRPC_WRITE_INTERNAL_COMPRESS) ? 1 : 0; + *p++ = (uint8_t)((flags & GRPC_WRITE_INTERNAL_COMPRESS) ? 1 : 0); /* Message length */ *p++ = (uint8_t)(length >> 24); *p++ = (uint8_t)(length >> 16);