all: use unsigned types for more variables that represent length

resolve build warnings on multiple platforms/toolchains
This commit is contained in:
Liam Staskawicz 2015-08-03 15:14:21 -07:00
parent 125c638c11
commit 0b6f95294e
5 changed files with 17 additions and 16 deletions

View file

@ -1,4 +1,5 @@
#include <gtest/gtest.h>
#include <cstdint>
static int g_AddTag = 1;
#define ADD_TAG g_AddTag
@ -273,11 +274,11 @@ static void getSegments(struct capn *c, struct capn_segment **s, size_t num) {
ASSERT_EQ(num, c->segnum);
s[0] = c->seglist;
for (int i = 1; i < num; i++) {
for (unsigned i = 1; i < num; i++) {
s[i] = s[i-1]->next;
}
for (int i = 0; i < num; i++) {
for (unsigned i = 0; i < num; i++) {
EXPECT_EQ(s[i]->id, i);
}
}
@ -314,7 +315,7 @@ TEST(WireFormat, StructRoundTrip_OneSegmentPerAllocation) {
struct capn ctx2;
memset(&ctx2, 0, sizeof(ctx2));
for (int i = 0; i < sizeof(segments)/sizeof(segments[0]); i++) {
for (unsigned i = 0; i < sizeof(segments)/sizeof(segments[0]); i++) {
capn_append_segment(&ctx2, segments[i]);
}
@ -370,7 +371,7 @@ TEST(WireFormat, StructRoundTrip_OneSegmentPerAllocation_NoTag) {
struct capn ctx2;
memset(&ctx2, 0, sizeof(ctx2));
for (int i = 0; i < sizeof(segments)/sizeof(segments[0]); i++) {
for (unsigned i = 0; i < sizeof(segments)/sizeof(segments[0]); i++) {
capn_append_segment(&ctx2, segments[i]);
}
@ -420,7 +421,7 @@ TEST(WireFormat, StructRoundTrip_MultipleSegmentsWithMultipleAllocations) {
struct capn ctx2;
memset(&ctx2, 0, sizeof(ctx2));
for (int i = 0; i < sizeof(segments)/sizeof(segments[0]); i++) {
for (unsigned i = 0; i < sizeof(segments)/sizeof(segments[0]); i++) {
capn_append_segment(&ctx2, segments[i]);
}