OSSP CVS Repository

ossp - Check-in [1430]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1430
Date: 2001-Dec-14 14:47:01 (local)
2001-Dec-14 13:47:01 (UTC)
User:rse
Branch:
Comment: Get rid of the following warnings under "gcc -O2 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-align -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long":

var.h:91: warning: declaration of `index' shadows global declaration var.c: In function `expression': var.c:693: warning: declaration of `index' shadows global declaration var.c: At top level: var.c:1769: warning: declaration of `varname' shadows global declaration var.c:1769: warning: declaration of `index' shadows global declaration var.c: In function `lookup_wrapper': var.c:1772: warning: declaration of `index' shadows global declaration var.c:1772: warning: declaration of `varname' shadows global declaration var_test.c:13: warning: declaration of `index' shadows global declaration var_test.c: In function `var_lookup': var_test.c:16: warning: declaration of `index' shadows global declaration

Tickets:
Inspections:
Files:
ossp-pkg/var/var.c      1.49 -> 1.50     6 inserted, 6 deleted
ossp-pkg/var/var.h      1.17 -> 1.18     1 inserted, 1 deleted
ossp-pkg/var/var_test.c      1.25 -> 1.26     4 inserted, 4 deleted

ossp-pkg/var/var.c 1.49 -> 1.50

--- var.c        2001/12/14 13:42:56     1.49
+++ var.c        2001/12/14 13:47:01     1.50
@@ -690,7 +690,7 @@
     size_t len, buffer_size;
     int failed = 0;
     int rc;
-    int index = 0;
+    int idx = 0;
     tokenbuf_t name;
     tokenbuf_t tmp;
 
@@ -747,7 +747,7 @@
     /* If the next token is START-INDEX, read the index specification. */
 
     if (config->startindex && *p == config->startindex) {
-        rc = num_exp(++p, end, current_index, &index, &failed, 
+        rc = num_exp(++p, end, current_index, &idx, &failed, 
                      rel_lookup_flag, config, nameclass, lookup, lookup_context);
         if (rc < 0)
             goto error_return;
@@ -785,7 +785,7 @@
         result->buffer_size = 0;
     }
     else {
-        rc = (*lookup) (lookup_context, name.begin, name.end - name.begin, index,
+        rc = (*lookup) (lookup_context, name.begin, name.end - name.begin, idx,
                         &data, &len, &buffer_size);
         if (rc < 0)
             goto error_return;
@@ -1766,7 +1766,7 @@
 };
 
 static int lookup_wrapper(void *context,
-                          const char *varname, size_t name_len, int index,
+                          const char *name, size_t name_len, int idx,
                           const char **data, size_t *data_len,
                           size_t *buffer_size)
 {
@@ -1774,8 +1774,8 @@
     struct wrapper_context *wcon = context;
     int rc;
 
-    rc = (*wcon->lookup)(wcon->context, varname, name_len, 
-                         index, data, data_len, buffer_size);
+    rc = (*wcon->lookup)(wcon->context, name, name_len, 
+                         idx, data, data_len, buffer_size);
     if (rc == 0) {
         (*wcon->rel_lookup_flag)--;
         *data = buf;


ossp-pkg/var/var.h 1.17 -> 1.18

--- var.h        2001/12/12 16:51:20     1.17
+++ var.h        2001/12/14 13:47:01     1.18
@@ -88,7 +88,7 @@
 /* Prototype for the lookup callback used in var_expand(). */
 
 typedef int (*var_cb_t) (void *context,
-    const char *varname, size_t name_len, int index,
+    const char *varname, size_t name_len, int idx,
     const char **data, size_t *data_len,
     size_t *buffer_size);
 


ossp-pkg/var/var_test.c 1.25 -> 1.26

--- var_test.c   2001/12/13 16:03:42     1.25
+++ var_test.c   2001/12/14 13:47:01     1.26
@@ -5,12 +5,12 @@
 
 struct variable {
     const char *name;
-    const unsigned int index;
+    const unsigned int idx;
     const char *data;
 };
 
 static int var_lookup(void *context,
-    const char *varname, size_t name_len, int index,
+    const char *varname, size_t name_len, int idx,
     const char **data, size_t *data_len,
     size_t *buffer_size)
 {
@@ -18,11 +18,11 @@
     size_t i, counter, length;
     static char buf[((sizeof(int)*8)/3)+10]; /* sufficient size: <#bits> x log_10(2) + safety */
 
-    if (index >= 0)
+    if (idx >= 0)
         {
         for (i = 0; vars[i].name; ++i)
             {
-            if (strncmp(varname, vars[i].name, name_len) == 0 && vars[i].index == index)
+            if (strncmp(varname, vars[i].name, name_len) == 0 && vars[i].idx == idx)
                 {
                 *data = vars[i].data;
                 *data_len = strlen(*data);

CVSTrac 2.0.1