the big relocation patch
[monky] / src / prss.c
index 5c7d191..5a57f6b 100644 (file)
@@ -78,12 +78,13 @@ static inline void read_item(PRSS_Item *res, xmlNodePtr data)
 
        res->title = res->link = res->description = NULL;
        for (; data; data = data->next) {
+               xmlNodePtr child;
                const char *name;
 
                if (data->type != XML_ELEMENT_NODE) {
                        continue;
                }
-               xmlNodePtr child = data->children;
+               child = data->children;
 
                if (!child) {
                        continue;
@@ -107,12 +108,13 @@ static inline void read_item(PRSS_Item *res, xmlNodePtr data)
 }
 static inline void read_element(PRSS *res, xmlNodePtr n)
 {
+       xmlNodePtr child;
        const char *name;
 
        if (n->type != XML_ELEMENT_NODE) {
                return;
        }
-       xmlNodePtr child = n->children;
+       child = n->children;
 
        if (!child) {
                return;
@@ -151,6 +153,8 @@ static inline void read_element(PRSS *res, xmlNodePtr n)
 static inline int parse_rss_2_0(PRSS *res, xmlNodePtr root)
 {
        xmlNodePtr channel = root->children;
+       xmlNodePtr n;
+       int items = 0;
 
        while (channel && (channel->type != XML_ELEMENT_NODE
                        || strcmp((const char *) channel->name, "channel"))) {
@@ -160,9 +164,6 @@ static inline int parse_rss_2_0(PRSS *res, xmlNodePtr root)
                return 0;
        }
 
-       int items = 0;
-       xmlNodePtr n;
-
        for (n = channel->children; n; n = n->next) {
                if (n->type == XML_ELEMENT_NODE &&
                                !strcmp((const char *) n->name, "item")) {