1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
From: Jari Aalto <jari.aalto@cante.net>
Subject: Correct gcc -Wpointer-sign
---
src/data.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
--- a/src/data.c
+++ b/src/data.c
@@ -184,15 +184,15 @@ gint i;
g_print("WARNING: datafile is empty.\n");
}
- if(!xmlStrcmp(cur->name, "data")) {
+ if(!xmlStrcmp(cur->name, (const xmlChar *)"data")) {
- prop = xmlGetProp(cur, "records");
- if(prop) records = atoi(prop);
+ prop = xmlGetProp(cur, (const xmlChar *)"records");
+ if(prop) records = atoi((const char *)prop);
cur = cur->xmlChildrenNode;
while (cur != NULL) {
- if(!xmlStrcmp(cur->name, "record")) {
+ if(!xmlStrcmp(cur->name, (const xmlChar *)"record")) {
memset(&rec_entry, 0, sizeof(recordstr));
@@ -200,7 +200,7 @@ gint i;
while (acur != NULL) {
for(i=0; i < nfields; i++) {
- if(!xmlStrcmp(acur->name, fields[i])) {
+ if(!xmlStrcmp(acur->name, (const xmlChar *)fields[i])) {
key = xmlNodeListGetString(doc, acur->xmlChildrenNode, 1);
if(key!=NULL) {
@@ -208,7 +208,7 @@ gint i;
if(i==FIRST_NAME || i==LAST_NAME)
key[0] = toupper(key[0]);
- strncpy(fields_ptr[i], key, fields_size[i]-1);
+ strncpy(fields_ptr[i], (const char *)key, fields_size[i]-1);
strcat(fields_ptr[i], "\0");
}
}
@@ -238,8 +238,8 @@ gchar c[10];
gint i, j;
- doc = xmlNewDoc("1.0");
- doc->xmlRootNode = xmlNewDocNode(doc, NULL, "data", NULL);
+ doc = xmlNewDoc((const xmlChar *)"1.0");
+ doc->xmlRootNode = xmlNewDocNode(doc, NULL, (const xmlChar *)"data", NULL);
i = 0;
node = list;
@@ -248,19 +248,19 @@ gint i, j;
while (node) {
- xmlAddChild(doc->xmlRootNode, xmlNewText("\n"));
- record_node = xmlNewChild(doc->xmlRootNode, NULL, "record", NULL);
- xmlAddChild(record_node, xmlNewText("\n"));
+ xmlAddChild(doc->xmlRootNode, xmlNewText((const xmlChar *)"\n"));
+ record_node = xmlNewChild(doc->xmlRootNode, NULL, (const xmlChar *)"record", NULL);
+ xmlAddChild(record_node, xmlNewText((const xmlChar *)"\n"));
rdata = node->data;
memcpy(&rec_entry, rdata, sizeof(recordstr));
for(j=0; j < nfields; j++)
if(strlen(fields_ptr[j])) {
- xmlAddChild(record_node, xmlNewText("\t"));
+ xmlAddChild(record_node, xmlNewText((const xmlChar *)"\t"));
content = xmlEncodeEntitiesReentrant(doc, fields_ptr[j]);
- xmlNewChild(record_node, NULL, fields[j], content);
- xmlAddChild(record_node, xmlNewText("\n"));
+ xmlNewChild(record_node, NULL, (const xmlChar *)fields[j], content);
+ xmlAddChild(record_node, xmlNewText((const xmlChar *)"\n"));
free(content);
}
@@ -269,8 +269,8 @@ gint i, j;
}
snprintf(c, 10, "%d", i);
- xmlSetProp(doc->xmlRootNode, "records", c);
- xmlAddChild(doc->xmlRootNode, xmlNewText("\n"));
+ xmlSetProp(doc->xmlRootNode, (const xmlChar *)"records", (const xmlChar *)c);
+ xmlAddChild(doc->xmlRootNode, xmlNewText((const xmlChar *)"\n"));
gchar *file = get_data_filename(DATADIR, DATAFILE);
|