From c24d5e4438cd008aa1d29aecbf650e972376ac6d Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Tue, 4 May 2010 10:04:37 +0200 Subject: [PATCH] Patterns: Fix up signedness --- pattern.c | 4 ++-- patternsp.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pattern.c b/pattern.c index 3e9ce91..1d8d0d8 100644 --- a/pattern.c +++ b/pattern.c @@ -90,8 +90,8 @@ str2feature(char *str, struct feature *f) { while (isspace(*str)) str++; - int flen = strcspn(str, ":"); - for (int i = 0; i < sizeof(features)/sizeof(features[0]); i++) + int unsigned flen = strcspn(str, ":"); + for (unsigned int i = 0; i < sizeof(features)/sizeof(features[0]); i++) if (strlen(features[i].name) == flen && !strncmp(features[i].name, str, flen)) { f->id = i; goto found; diff --git a/patternsp.c b/patternsp.c index d2dc7ba..04ca728 100644 --- a/patternsp.c +++ b/patternsp.c @@ -210,7 +210,7 @@ found_rot:; /* Spatial dict manipulation. */ -static int +static unsigned int spatial_dict_addc(struct spatial_dict *dict, struct spatial *s) { /* Allocate space in 1024 blocks. */ @@ -225,7 +225,7 @@ spatial_dict_addc(struct spatial_dict *dict, struct spatial *s) } static bool -spatial_dict_addh(struct spatial_dict *dict, hash_t hash, int id) +spatial_dict_addh(struct spatial_dict *dict, hash_t hash, unsigned int id) { if (dict->hash[hash] && dict->hash[hash] != id) dict->collisions++; @@ -269,7 +269,7 @@ spatial_dict_read(struct spatial_dict *dict, char *buf) } /* Add to collection. */ - int id = spatial_dict_addc(dict, &s); + unsigned int id = spatial_dict_addc(dict, &s); /* Add to specified hash places. */ while (*bufp) { -- 2.11.4.GIT