iscsi, ttxml: fix warning [-Wunused-but-set-variable]
authorTinggong <wangtinggong@gmail.com>
Fri, 8 Mar 2013 15:11:23 +0000 (23:11 +0800)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 12 Mar 2013 04:56:43 +0000 (15:26 +1030)
hi all,

here is a trival path to fix warning [-Wunused-but-set-variable].

Thanks.
Tinggong

Signed-off-by: Tinggong <wangtinggong@gmail.com>
ccan/iscsi/socket.c
ccan/ttxml/ttxml.c

index f79b31692b764dffb3e5136e1a1fb504a15c3c30..430be7211599c6ef65756c71d1b55c70e01585da 100644 (file)
@@ -45,7 +45,6 @@ static void set_nonblocking(int fd)
 
 int iscsi_connect_async(struct iscsi_context *iscsi, const char *target, iscsi_command_cb cb, void *private_data)
 {
-       int tpgt = -1;
        int port = 3260;
        char *str;
        char *addr;
@@ -73,7 +72,6 @@ int iscsi_connect_async(struct iscsi_context *iscsi, const char *target, iscsi_c
        
        /* check if we have a target portal group tag */
        if ((str = rindex(addr, ',')) != NULL) {
-               tpgt = atoi(str+1);
                str[0] = 0;
        }
 
index ffda34b832621d480203ee64fa60c0291700b117..410ac73a5eab8016bf217ed871f86fedf7f41842 100644 (file)
@@ -278,16 +278,14 @@ xml_read_attr_malloc:
  */
 static XmlNode* xml_parse(struct XMLBUF *xml)
 {
-       int offset;
        int toff;
        char **tmp;
        char *stmp;
        XmlNode **this, *ret = NULL;
-       
+
        this = &ret;
 
        xml_skip(xml, XML_SPACE);       // skip whitespace
-       offset=0;
        while( (xml->read_index < xml->len) || !xml->eof )
        {
                switch(is_special(xml_peek(xml)))