diff --git a/include/grpc/support/slice.h b/include/grpc/support/slice.h index 3ee103bfb9c223fe1f54e8ee82f113232d0bff0b..19415865cf88fdf4270f12fc1db6f5c592d285cc 100644 --- a/include/grpc/support/slice.h +++ b/include/grpc/support/slice.h @@ -97,8 +97,8 @@ typedef struct gpr_slice { ((slice).refcount ? (slice).data.refcounted.length \ : (slice).data.inlined.length) #define GPR_SLICE_SET_LENGTH(slice, newlen) \ - ((slice).refcount ? ((slice).data.refcounted.length = (newlen)) \ - : ((slice).data.inlined.length = (newlen))) + ((slice).refcount ? ((slice).data.refcounted.length = (size_t)(newlen)) \ + : ((slice).data.inlined.length = (gpr_uint8)(newlen))) #define GPR_SLICE_END_PTR(slice) \ GPR_SLICE_START_PTR(slice) + GPR_SLICE_LENGTH(slice) #define GPR_SLICE_IS_EMPTY(slice) (GPR_SLICE_LENGTH(slice) == 0)