From 7910c2ae7391f3e6e1c6fed1c9a9b1f7492ec175 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Mon, 29 Dec 2014 17:43:19 +0530 Subject: [PATCH] Make type for spec variable size as size_t --- ChangeLog | 4 ++++ posix/getconf.c | 2 +- scripts/gen-posix-conf-vars.awk | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff4b532bfa..8701732c71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2014-12-29 Siddhesh Poyarekar + * posix/getconf.c (main): Use size_t for type of I. + * scripts-gen-posix-conf-vars.awk (END): Use size_t for type of + NSPEC. + * posix/posix-conf-vars.list (SPEC:XBS5): Add sysconf prefix. * posix/confstr.c: Define NEED_SPEC_ARRAY to 0. * posix/posix-envs.def: Likewise. diff --git a/posix/getconf.c b/posix/getconf.c index bcde4c58a1..45eabb2a2c 100644 --- a/posix/getconf.c +++ b/posix/getconf.c @@ -528,7 +528,7 @@ environment SPEC.\n\n")); /* Check for the specifications we know. */ if (spec != NULL) { - int i; + size_t i; for (i = 0; i < nspecs; ++i) if (strcmp (spec, specs[i].name) == 0) break; diff --git a/scripts/gen-posix-conf-vars.awk b/scripts/gen-posix-conf-vars.awk index 0eca55d536..007cd744de 100644 --- a/scripts/gen-posix-conf-vars.awk +++ b/scripts/gen-posix-conf-vars.awk @@ -84,6 +84,6 @@ END { printf " { \"%s\", %s },\n", s, spec[s] } print " };" - print "static const int nspecs = sizeof (specs) / sizeof (specs[0]);" + print "static const size_t nspecs = sizeof (specs) / sizeof (specs[0]);" print "#endif" } -- 2.43.5