From: Ezra Peisach Date: Tue, 28 Oct 2008 13:37:47 +0000 (+0000) Subject: Unsigned/signed warnings cleanup X-Git-Tag: krb5-1.7-alpha1~256 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f1a29fa7b9b20d133af9fc0a40511b833dd2e14d;p=krb5.git Unsigned/signed warnings cleanup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20928 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/profile/prof_get.c b/src/util/profile/prof_get.c index 6426e15b9..6c94d96cc 100644 --- a/src/util/profile/prof_get.c +++ b/src/util/profile/prof_get.c @@ -28,8 +28,8 @@ struct profile_string_list { char **list; - int num; - int max; + unsigned int num; + unsigned int max; }; /* @@ -75,7 +75,7 @@ static void end_list(struct profile_string_list *list, char ***ret_list) static errcode_t add_to_list(struct profile_string_list *list, const char *str) { char *newstr, **newlist; - int newmax; + unsigned int newmax; if (list->num+1 >= list->max) { newmax = list->max + 10; diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index 4048f88a9..041ef747a 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -71,7 +71,7 @@ profile_init(const_profile_filespec_t *files, profile_t *ret_profile) #define COUNT_LINKED_LIST(COUNT, PTYPE, START, FIELD) \ { \ - int cll_counter = 0; \ + size_t cll_counter = 0; \ PTYPE cll_ptr = (START); \ while (cll_ptr != NULL) { \ cll_counter++; \ @@ -106,7 +106,8 @@ errcode_t KRB5_CALLCONV profile_init_path(const_profile_filespec_list_t filepath, profile_t *ret_profile) { - int n_entries, i; + unsigned int n_entries; + int i; unsigned int ent_len; const char *s, *t; profile_filespec_t *filenames; @@ -125,7 +126,7 @@ profile_init_path(const_profile_filespec_list_t filepath, /* measure, copy, and skip each one */ for(s = filepath, i=0; (t = strchr(s, ':')) || (t=s+strlen(s)); s=t+1, i++) { - ent_len = t-s; + ent_len = (unsigned int) (t-s); filenames[i] = (char*) malloc(ent_len + 1); if (filenames[i] == 0) { /* if malloc fails, free the ones that worked */ @@ -344,6 +345,7 @@ errcode_t profile_ser_internalize(const char *unused, profile_t *profilep, bp = *bufpp; remain = *remainp; + fcount = 0; if (remain >= 12) (void) unpack_int32(&tmp, &bp, &remain); @@ -358,11 +360,11 @@ errcode_t profile_ser_internalize(const char *unused, profile_t *profilep, (void) unpack_int32(&fcount, &bp, &remain); retval = ENOMEM; - flist = (profile_filespec_t *) malloc(sizeof(profile_filespec_t) * (fcount + 1)); + flist = (profile_filespec_t *) malloc(sizeof(profile_filespec_t) * (size_t) (fcount + 1)); if (!flist) goto cleanup; - memset(flist, 0, sizeof(char *) * (fcount+1)); + memset(flist, 0, sizeof(char *) * (size_t) (fcount+1)); for (i=0; i