Mercurial > pidgin
comparison libgaim/xmlnode.c @ 14628:58202142e9ad
[gaim-migrate @ 17369]
This is what we decided to do about the signedness warnings, right?
committer: Tailor Script <tailor@pidgin.im>
| author | Daniel Atallah <daniel.atallah@gmail.com> |
|---|---|
| date | Tue, 26 Sep 2006 21:37:37 +0000 |
| parents | 289490ee84d1 |
| children | c6978ee9ac4d |
comparison
equal
deleted
inserted
replaced
| 14627:134f4d999ff0 | 14628:58202142e9ad |
|---|---|
| 384 | 384 |
| 385 if(!element_name) { | 385 if(!element_name) { |
| 386 return; | 386 return; |
| 387 } else { | 387 } else { |
| 388 if(xpd->current) | 388 if(xpd->current) |
| 389 node = xmlnode_new_child(xpd->current, element_name); | 389 node = xmlnode_new_child(xpd->current, (const char*) element_name); |
| 390 else | 390 else |
| 391 node = xmlnode_new(element_name); | 391 node = xmlnode_new((const char *) element_name); |
| 392 | 392 |
| 393 xmlnode_set_namespace(node, namespace); | 393 xmlnode_set_namespace(node, (const char *) namespace); |
| 394 | 394 |
| 395 for(i=0; i < nb_attributes * 5; i+=5) { | 395 for(i=0; i < nb_attributes * 5; i+=5) { |
| 396 char *txt; | 396 char *txt; |
| 397 int attrib_len = attributes[i+4] - attributes[i+3]; | 397 int attrib_len = attributes[i+4] - attributes[i+3]; |
| 398 char *attrib = g_malloc(attrib_len + 1); | 398 char *attrib = g_malloc(attrib_len + 1); |
| 399 memcpy(attrib, attributes[i+3], attrib_len); | 399 memcpy(attrib, attributes[i+3], attrib_len); |
| 400 attrib[attrib_len] = '\0'; | 400 attrib[attrib_len] = '\0'; |
| 401 txt = attrib; | 401 txt = attrib; |
| 402 attrib = gaim_unescape_html(txt); | 402 attrib = gaim_unescape_html(txt); |
| 403 g_free(txt); | 403 g_free(txt); |
| 404 xmlnode_set_attrib(node, attributes[i], attrib); | 404 xmlnode_set_attrib(node, (const char*) attributes[i], attrib); |
| 405 g_free(attrib); | 405 g_free(attrib); |
| 406 } | 406 } |
| 407 | 407 |
| 408 xpd->current = node; | 408 xpd->current = node; |
| 409 } | 409 } |
| 417 | 417 |
| 418 if(!element_name || !xpd->current) | 418 if(!element_name || !xpd->current) |
| 419 return; | 419 return; |
| 420 | 420 |
| 421 if(xpd->current->parent) { | 421 if(xpd->current->parent) { |
| 422 if(!strcmp(xpd->current->name, element_name)) | 422 if(!xmlStrcmp((xmlChar*) xpd->current->name, element_name)) |
| 423 xpd->current = xpd->current->parent; | 423 xpd->current = xpd->current->parent; |
| 424 } | 424 } |
| 425 } | 425 } |
| 426 | 426 |
| 427 static void | 427 static void |
| 433 return; | 433 return; |
| 434 | 434 |
| 435 if(!text || !text_len) | 435 if(!text || !text_len) |
| 436 return; | 436 return; |
| 437 | 437 |
| 438 xmlnode_insert_data(xpd->current, text, text_len); | 438 xmlnode_insert_data(xpd->current, (const char*) text, text_len); |
| 439 } | 439 } |
| 440 | 440 |
| 441 static xmlSAXHandler xmlnode_parser_libxml = { | 441 static xmlSAXHandler xmlnode_parser_libxml = { |
| 442 .internalSubset = NULL, | 442 .internalSubset = NULL, |
| 443 .isStandalone = NULL, | 443 .isStandalone = NULL, |
