Minor code changes to enable warning-free compile with gcc 4.0
This commit is contained in:
parent
38e36613c9
commit
df8bbcb660
|
@ -78,7 +78,7 @@ static int parse_header(xmlNodePtr node, List *headers, int *sigparent)
|
|||
int skip = 0;
|
||||
int tag;
|
||||
char *hname;
|
||||
char *s = NULL;
|
||||
unsigned char *s = NULL;
|
||||
char *nvalue;
|
||||
Octstr *value = NULL, *tmp;
|
||||
|
||||
|
@ -136,8 +136,8 @@ static int parse_header(xmlNodePtr node, List *headers, int *sigparent)
|
|||
*sigparent = tag; /* We wait for number and stuff below. */
|
||||
break;
|
||||
case MM7_TAG_Content:
|
||||
if ((s = xmlGetProp(node, "href")) != NULL) {
|
||||
value = octstr_create(s);
|
||||
if ((s = xmlGetProp(node, (unsigned char *)"href")) != NULL) {
|
||||
value = octstr_create((char *)s);
|
||||
xmlFree(s);
|
||||
}
|
||||
/* we keep 'cid:' bit. ignore the bit about adaptation. */
|
||||
|
@ -150,10 +150,10 @@ static int parse_header(xmlNodePtr node, List *headers, int *sigparent)
|
|||
case MM7_TAG_RFC2822Address:
|
||||
if (!value)
|
||||
value = octstr_create(nvalue);
|
||||
hname = mms_mm7tag_to_cstr(*sigparent); /* real tag is parent. */
|
||||
hname = (char *)mms_mm7tag_to_cstr(*sigparent); /* real tag is parent. */
|
||||
|
||||
s = xmlGetProp(node, "displayOnly");
|
||||
if (s && strcasecmp(s, "true") == 0) /* a '-' indicates don't use this to send. */
|
||||
s = xmlGetProp(node, (unsigned char *)"displayOnly");
|
||||
if (s && strcasecmp((char *)s, "true") == 0) /* a '-' indicates don't use this to send. */
|
||||
octstr_insert(value, octstr_imm("- "), 0);
|
||||
else
|
||||
octstr_insert(value, octstr_imm("+ "), 0);
|
||||
|
@ -171,12 +171,12 @@ static int parse_header(xmlNodePtr node, List *headers, int *sigparent)
|
|||
case MM7_TAG_ReplyCharging:
|
||||
value = octstr_imm("Requested");
|
||||
|
||||
if ((s = xmlGetProp(node, "replyChargingSize")) != NULL) {
|
||||
http_header_add(headers, "replyChargingSize", s);
|
||||
if ((s = xmlGetProp(node, (unsigned char *)"replyChargingSize")) != NULL) {
|
||||
http_header_add(headers, "replyChargingSize", (char *)s);
|
||||
xmlFree(s);
|
||||
}
|
||||
if ((s = xmlGetProp(node, "replyDeadline")) != NULL) {
|
||||
Octstr *t = parse_time(s);
|
||||
if ((s = xmlGetProp(node, (unsigned char *)"replyDeadline")) != NULL) {
|
||||
Octstr *t = parse_time((char *)s);
|
||||
http_header_add(headers, "replyDeadline", octstr_get_cstr(t));
|
||||
xmlFree(s);
|
||||
octstr_destroy(t);
|
||||
|
@ -839,7 +839,7 @@ static MSoapMsg_t *mm7_soap_create(int msgtype, Octstr *otransid)
|
|||
m->envelope = http_create_empty_headers();
|
||||
m->msg = NULL;
|
||||
|
||||
http_header_add(m->envelope, "MessageType", mms_mm7tag_to_cstr(msgtype));
|
||||
http_header_add(m->envelope, "MessageType", (char *)mms_mm7tag_to_cstr(msgtype));
|
||||
http_header_add(m->envelope, "MM7Version", MM7_DEFAULT_VERSION);
|
||||
http_header_add(m->envelope, "TransactionID",
|
||||
otransid ? octstr_get_cstr(otransid) : "0000");
|
||||
|
@ -949,7 +949,7 @@ MSoapMsg_t *mm7_make_resp(MSoapMsg_t *mreq, int status, Octstr *msgid)
|
|||
Octstr *transid;
|
||||
MSoapMsg_t *mresp;
|
||||
char scode[64];
|
||||
char *statustxt = mms_soap_status_to_cstr(status);
|
||||
unsigned char *statustxt = mms_soap_status_to_cstr(status);
|
||||
|
||||
transid = mreq ? http_header_value(mreq->envelope, octstr_imm("TransactionID")) : NULL;
|
||||
|
||||
|
@ -961,7 +961,7 @@ MSoapMsg_t *mm7_make_resp(MSoapMsg_t *mreq, int status, Octstr *msgid)
|
|||
sprintf(scode, "%d", status);
|
||||
http_header_add(mresp->envelope, "Status", ""); /* So that we get output. */
|
||||
http_header_add(mresp->envelope, "StatusCode", scode);
|
||||
http_header_add(mresp->envelope, "StatusText", statustxt ? statustxt : "Error");
|
||||
http_header_add(mresp->envelope, "StatusText", statustxt ? (char *)statustxt : "Error");
|
||||
|
||||
if (msgid)
|
||||
http_header_add(mresp->envelope, "MessageID", octstr_get_cstr(msgid));
|
||||
|
|
|
@ -554,7 +554,7 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
|||
}
|
||||
|
||||
if (ch == NULL && decoded != NULL)
|
||||
ch = (char *)octstr_get_cstr(decoded);
|
||||
ch = (unsigned char *)octstr_get_cstr(decoded);
|
||||
|
||||
if (ch == NULL)
|
||||
goto value_error;
|
||||
|
|
|
@ -57,13 +57,13 @@ static long string_to_versioned_number(Octstr *ostr, struct table *table, int ve
|
|||
#define LINEAR(name, strings) \
|
||||
static const struct linear_element name##_strings[] = { strings }; \
|
||||
static struct table name##_table;
|
||||
#define STRING(string) { string, 0 },
|
||||
#define VSTRING(version, string) { string, version },
|
||||
#define STRING(string) { (unsigned char *)string, 0 },
|
||||
#define VSTRING(version, string) { (unsigned char *)string, version },
|
||||
#define NUMBERED(name, strings) \
|
||||
static const struct numbered_element name##_strings[] = { strings }; \
|
||||
static struct table name##_table;
|
||||
#define ASSIGN(string, number) { string, number, 0 },
|
||||
#define VASSIGN(version, string, number) { string, number, version },
|
||||
#define ASSIGN(string, number) { (unsigned char *)string, number, 0 },
|
||||
#define VASSIGN(version, string, number) { (unsigned char *)string, number, version },
|
||||
#include "mms_strings.def"
|
||||
|
||||
/* Define the functions for translating number to Octstr */
|
||||
|
@ -118,11 +118,11 @@ static unsigned char *number_to_cstr(long number, struct table *table)
|
|||
|
||||
if (table->linear) {
|
||||
if (number >= 0 && number < table->size)
|
||||
return octstr_get_cstr(table->strings[number]);
|
||||
return (unsigned char *)octstr_get_cstr(table->strings[number]);
|
||||
} else {
|
||||
for (i = 0; i < table->size; i++) {
|
||||
if (table->numbers[i] == number)
|
||||
return octstr_get_cstr(table->strings[i]);
|
||||
return (unsigned char *)octstr_get_cstr(table->strings[i]);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
@ -179,7 +179,7 @@ static void construct_linear_table(struct table *table, const struct linear_elem
|
|||
table->linear = 1;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
table->strings[i] = octstr_imm(strings[i].str);
|
||||
table->strings[i] = octstr_imm((char *)strings[i].str);
|
||||
table->versions[i] = strings[i].version;
|
||||
}
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ static void construct_numbered_table(struct table *table, const struct numbered_
|
|||
table->linear = 0;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
table->strings[i] = octstr_imm(strings[i].str);
|
||||
table->strings[i] = octstr_imm((char *)strings[i].str);
|
||||
table->numbers[i] = strings[i].number;
|
||||
table->versions[i] = strings[i].version;
|
||||
}
|
||||
|
|
|
@ -140,9 +140,9 @@ static xmlNodePtr find_node(xmlNodePtr start, char *name, char *id, int level, i
|
|||
if (!id)
|
||||
return list;
|
||||
else {
|
||||
char *s;
|
||||
if ((s= xmlGetProp(list,"ID")) != NULL &&
|
||||
xmlStrcasecmp(s,id) == 0) {
|
||||
unsigned char *s;
|
||||
if ((s= xmlGetProp(list,(unsigned char *)"ID")) != NULL &&
|
||||
xmlStrcasecmp(s,(unsigned char *)id) == 0) {
|
||||
xmlFree(s);
|
||||
return list;
|
||||
}
|
||||
|
@ -156,9 +156,9 @@ static xmlNodePtr find_node(xmlNodePtr start, char *name, char *id, int level, i
|
|||
if (!id)
|
||||
return node;
|
||||
else {
|
||||
char *s;
|
||||
if ((s = xmlGetProp(node,"ID")) != NULL &&
|
||||
xmlStrcasecmp(s,id) == 0) {
|
||||
unsigned char *s;
|
||||
if ((s = xmlGetProp(node,(unsigned char *)"ID")) != NULL &&
|
||||
xmlStrcasecmp(s,(unsigned char *)id) == 0) {
|
||||
xmlFree(s);
|
||||
return node;
|
||||
}
|
||||
|
@ -289,8 +289,8 @@ static MmsUaProfile *parse_uaprofile(Octstr *xml)
|
|||
|
||||
for (xnode = node->xmlChildrenNode; xnode; xnode = xnode->next) {
|
||||
xmlNodePtr child = xnode->xmlChildrenNode, lnode, rdfnode;
|
||||
const char *xname = xnode->name;
|
||||
char *childtext = xmlNodeListGetString(doc, child, 1);
|
||||
const unsigned char *xname = xnode->name;
|
||||
unsigned char *childtext = xmlNodeListGetString(doc, child, 1);
|
||||
List *l;
|
||||
|
||||
/* If there is a Bag, get the list. */
|
||||
|
@ -298,9 +298,9 @@ static MmsUaProfile *parse_uaprofile(Octstr *xml)
|
|||
l = list_create();
|
||||
for (lnode = rdfnode->xmlChildrenNode; lnode; lnode = lnode->next)
|
||||
if (xmlStrcasecmp(lnode->name, (const xmlChar *)"li") == 0) {
|
||||
char *t = xmlNodeListGetString(doc, lnode->xmlChildrenNode,1);
|
||||
unsigned char *t = xmlNodeListGetString(doc, lnode->xmlChildrenNode,1);
|
||||
if (t) {
|
||||
list_append(l, octstr_create(t));
|
||||
list_append(l, octstr_create((char *)t));
|
||||
xmlFree(t);
|
||||
}
|
||||
}
|
||||
|
@ -308,9 +308,9 @@ static MmsUaProfile *parse_uaprofile(Octstr *xml)
|
|||
l = NULL;
|
||||
|
||||
if (xmlStrcasecmp(xname, (const xmlChar *)"MmsMaxMessageSize") == 0)
|
||||
sscanf(childtext, "%ld", &prof->maxmsgsize);
|
||||
sscanf((char *)childtext, "%ld", &prof->maxmsgsize);
|
||||
else if (xmlStrcasecmp(xname, (const xmlChar *)"MmsMaxImageResolution") == 0)
|
||||
sscanf(childtext, "%ldx%ld", &prof->maxres.x, &prof->maxres.y);
|
||||
sscanf((char *)childtext, "%ldx%ld", &prof->maxres.x, &prof->maxres.y);
|
||||
else if (xmlStrcasecmp(xname, (const xmlChar *)"MmsCcppAcceptCharSet") == 0 ||
|
||||
xmlStrcasecmp(xname, (const xmlChar *)"MmsCcppAccept-CharSet") == 0) {/* Cranky old ones! */
|
||||
int i, n;
|
||||
|
@ -325,7 +325,7 @@ static MmsUaProfile *parse_uaprofile(Octstr *xml)
|
|||
else if (xmlStrcasecmp(xname, (const xmlChar *)"MmsVersion") == 0) {
|
||||
if (!l && childtext) { /* SonyEriccson uses old format! */
|
||||
l = list_create();
|
||||
list_append(l, octstr_create(childtext));
|
||||
list_append(l, octstr_create((char *)childtext));
|
||||
}
|
||||
prof->versions = l;
|
||||
} else if (xmlStrcasecmp(xname, (const xmlChar *)"MmsCcppAccept") == 0) {
|
||||
|
|
|
@ -1616,7 +1616,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
|
|||
time_t expiryt = -1, delivert = -1;
|
||||
MmsMsg *m = NULL;
|
||||
int status = 1000;
|
||||
char *msgtype = "";
|
||||
unsigned char *msgtype = (unsigned char *)"";
|
||||
Octstr *qf = NULL;
|
||||
|
||||
|
||||
|
@ -1627,7 +1627,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
|
|||
debug("mmsprox.mm7sendinterface", 0,
|
||||
" --> Enterred mm7dispatch interface, mreq=%s mtype = %s <-- ",
|
||||
mreq ? "Ok" : "Null",
|
||||
mreq ? msgtype : "Null");
|
||||
mreq ? (char *)msgtype : "Null");
|
||||
|
||||
|
||||
if (!mreq) {
|
||||
|
|
Loading…
Reference in New Issue