aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/support/slice.c
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-06-22 14:48:25 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-06-22 14:48:25 -0700
commit154cb407a803c77b76fd3c14e9f5b329ceb2912d (patch)
tree98fda32d477204f07829dbc6a97da9e7e62de9ee /src/core/support/slice.c
parentd1873b0128ea37c5dcf1cc42f05ba9083b07f944 (diff)
Made requested fixes
Diffstat (limited to 'src/core/support/slice.c')
-rw-r--r--src/core/support/slice.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/support/slice.c b/src/core/support/slice.c
index a2d62fc1e5..5a3dbe1736 100644
--- a/src/core/support/slice.c
+++ b/src/core/support/slice.c
@@ -31,6 +31,8 @@
*
*/
+#include <sys/types.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/slice.h>
@@ -313,7 +315,7 @@ gpr_slice gpr_slice_split_head(gpr_slice *source, size_t split) {
}
int gpr_slice_cmp(gpr_slice a, gpr_slice b) {
- int d = (int)(GPR_SLICE_LENGTH(a) - GPR_SLICE_LENGTH(b));
+ ssize_t d = (ssize_t)(GPR_SLICE_LENGTH(a) - GPR_SLICE_LENGTH(b));
if (d != 0) return d;
return memcmp(GPR_SLICE_START_PTR(a), GPR_SLICE_START_PTR(b),
GPR_SLICE_LENGTH(a));
@@ -321,7 +323,7 @@ int gpr_slice_cmp(gpr_slice a, gpr_slice b) {
int gpr_slice_str_cmp(gpr_slice a, const char *b) {
size_t b_length = strlen(b);
- int d = (int)(GPR_SLICE_LENGTH(a) - b_length);
+ ssize_t d = (ssize_t)(GPR_SLICE_LENGTH(a) - b_length);
if (d != 0) return d;
return memcmp(GPR_SLICE_START_PTR(a), b, b_length);
}