chiark / gitweb /
udp.c: Remove some (ab)use of variable name `i'
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 2 Sep 2014 07:59:44 +0000 (08:59 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 2 Oct 2014 15:30:21 +0000 (16:30 +0100)
I find it very odd to find `item_t *i' etc.  I would like to be able
to use `int i'.  So change some uses of `i' to `item'.  (`j' in this
function will go away in the next patch so isn't worth renaming.)

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
udp.c

diff --git a/udp.c b/udp.c
index b2ab85008213b06d2752667751befc3f411273a7..899a2c83499ffd91d2e8323d61beaff72566ce2d 100644 (file)
--- a/udp.c
+++ b/udp.c
@@ -275,7 +275,8 @@ static list_t *udp_apply(closure_t *self, struct cloc loc, dict_t *context,
                         list_t *args)
 {
     struct udp *st;
-    item_t *i,*j;
+    item_t *item;
+    item_t *j;
     dict_t *d;
     list_t *l;
     uint32_t a;
@@ -294,11 +295,11 @@ static list_t *udp_apply(closure_t *self, struct cloc loc, dict_t *context,
     FILLZERO(st->addr);
     st->use_proxy=False;
 
-    i=list_elem(args,0);
-    if (!i || i->type!=t_dict) {
+    item=list_elem(args,0);
+    if (!item || item->type!=t_dict) {
        cfgfatal(st->loc,"udp","first argument must be a dictionary\n");
     }
-    d=i->data.dict;
+    d=item->data.dict;
 
     st->addr.sa.sa_family=AF_INET;
     j=dict_find_item(d,"address",False,"udp",st->loc);
@@ -311,17 +312,17 @@ static list_t *udp_apply(closure_t *self, struct cloc loc, dict_t *context,
        st->use_proxy=True;
        FILLZERO(st->proxy);
        st->proxy.sa.sa_family=AF_INET;
-       i=list_elem(l,0);
-       if (!i || i->type!=t_string) {
+       item=list_elem(l,0);
+       if (!item || item->type!=t_string) {
            cfgfatal(st->loc,"udp","proxy must supply ""addr"",port\n");
        }
-       a=string_item_to_ipaddr(i,"proxy");
+       a=string_item_to_ipaddr(item,"proxy");
        st->proxy.sin.sin_addr.s_addr=htonl(a);
-       i=list_elem(l,1);
-       if (!i || i->type!=t_number) {
+       item=list_elem(l,1);
+       if (!item || item->type!=t_number) {
            cfgfatal(st->loc,"udp","proxy must supply ""addr"",port\n");
        }
-       st->proxy.sin.sin_port=htons(i->data.number);
+       st->proxy.sin.sin_port=htons(item->data.number);
     }
 
     update_max_start_pad(&comm_max_start_pad, st->use_proxy ? 8 : 0);