env.c (__gnat_setenv): Use size_t.
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 16 Feb 2006 22:06:06 +0000 (22:06 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 16 Feb 2006 22:06:06 +0000 (22:06 +0000)
* env.c (__gnat_setenv): Use size_t.
(__gnat_unsetenv): Likewise.
(__gnat_clearenv): Likewise.

From-SVN: r111155

gcc/ada/ChangeLog
gcc/ada/env.c

index 6b66774385897edaa7ca284133ace41d4e0b31d3..b6d7f9231616280a8f772fdbbf9abaf978ca8876 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * env.c (__gnat_setenv): Use size_t.
+       (__gnat_unsetenv): Likewise.
+       (__gnat_clearenv): Likewise.
+
 2006-02-16  Arnaud Charlet  <charlet@adacore.com>
 
        * opt.ads (Ada_Version_Default): Set to Ada 2005 by default.
index 039e09ced6e78c9d243a4e5f877e3b6437305bb5..bdba790f4901352d5f84b6a5df030ce03cbb341c 100644 (file)
@@ -170,7 +170,7 @@ __gnat_setenv (char *name, char *value)
   setenv (name, value, 1);
 
 #else
-  int size = strlen (name) + strlen (value) + 2;
+  size_t size = strlen (name) + strlen (value) + 2;
   char *expression;
 
   expression = (char *) xmalloc (size * sizeof (char));
@@ -234,7 +234,7 @@ void __gnat_unsetenv (char *name) {
      As we are still supporting AIX 5.1 we cannot use unsetenv */
   char **env = __gnat_environ ();
   int index = 0;
-  int size = strlen (name);
+  size_t size = strlen (name);
 
   while (env[index] != NULL) {
      if (strlen (env[index]) > size) {
@@ -258,7 +258,7 @@ void __gnat_unsetenv (char *name) {
   /* On Windows platform putenv ("key=") is equivalent to unsetenv (a
      subsequent call to getenv ("key") will return NULL and not the "\0"
      string */
-  int size = strlen (name) + 2;
+  size_t size = strlen (name) + 2;
   char *expression;
   expression = (char *) xmalloc (size * sizeof (char));
 
@@ -293,7 +293,7 @@ void __gnat_clearenv (void) {
      environment but there is a "clean" way to unset a variable. So go
      through the environ table and call __gnat_unsetenv on all entries */
   char **env = __gnat_environ ();
-  int size;
+  size_t size;
 
   while (env[0] != NULL) {
     size = 0;