[Opensrf-commits] r999 - in trunk/src: jserver libopensrf objson
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jul 5 14:02:42 EDT 2007
Author: miker
Date: 2007-07-05 13:58:49 -0400 (Thu, 05 Jul 2007)
New Revision: 999
Modified:
trunk/src/jserver/osrf_chat.c
trunk/src/libopensrf/transport_message.c
trunk/src/libopensrf/transport_session.c
trunk/src/libopensrf/xml_utils.c
trunk/src/objson/json_parser.c
Log:
removing signedness warnings coming from libxml2
Modified: trunk/src/jserver/osrf_chat.c
===================================================================
--- trunk/src/jserver/osrf_chat.c 2007-07-05 16:00:42 UTC (rev 998)
+++ trunk/src/jserver/osrf_chat.c 2007-07-05 17:58:49 UTC (rev 999)
@@ -19,8 +19,11 @@
#include <time.h>
static int osrfChatXMLErrorOcurred = 0;
-static int osrfChatClientSentDisconnect = 0;
+/* This is used by code in osrfChatPushData, but that code is
+ currently commented out. Uncomment the next line if needed. */
+//static int osrfChatClientSentDisconnect = 0;
+
/* shorter version of strcmp */
static int eq(const char* a, const char* b) { return (a && b && !strcmp(a,b)); }
//#define eq(a,b) ((a && b && !strcmp(a,b)) ? 1 : 0)
@@ -613,7 +616,7 @@
if(eq(name,"message")) {
/* drop the old message and start with a new one */
- xmlNodePtr root = xmlNewNode(NULL, name);
+ xmlNodePtr root = xmlNewNode(NULL, BAD_CAST name);
xmlAddAttrs(root, atts);
xmlNodePtr oldRoot = xmlDocSetRootElement(node->msgDoc, root);
free(node->to);
@@ -628,7 +631,7 @@
} else {
/* all non "message" nodes are simply added to the message */
- xmlNodePtr nodep = xmlNewNode(NULL, name);
+ xmlNodePtr nodep = xmlNewNode(NULL, BAD_CAST name);
xmlAddAttrs(nodep, atts);
xmlAddChild(xmlDocGetRootElement(node->msgDoc), nodep);
}
Modified: trunk/src/libopensrf/transport_message.c
===================================================================
--- trunk/src/libopensrf/transport_message.c 2007-07-05 16:00:42 UTC (rev 998)
+++ trunk/src/libopensrf/transport_message.c 2007-07-05 17:58:49 UTC (rev 999)
@@ -95,7 +95,7 @@
xmlFree(router_class);
}
if(broadcast) {
- if(strcmp(broadcast,"0") )
+ if(strcmp((char*) broadcast,"0") )
new_msg->broadcast = 1;
xmlFree(broadcast);
}
@@ -211,9 +211,9 @@
// ---------------------------------------------------------------------------------
char* message_to_xml( const transport_message* msg ) {
- int bufsize;
+ //int bufsize;
//xmlChar* xmlbuf;
- char* encoded_body;
+ //char* encoded_body;
xmlNodePtr message_node;
xmlNodePtr body_node;
Modified: trunk/src/libopensrf/transport_session.c
===================================================================
--- trunk/src/libopensrf/transport_session.c 2007-07-05 16:00:42 UTC (rev 998)
+++ trunk/src/libopensrf/transport_session.c 2007-07-05 17:58:49 UTC (rev 999)
@@ -332,7 +332,7 @@
if( ! ses ) { return; }
- if( strcmp( name, "message" ) == 0 ) {
+ if( strcmp( (char*) name, "message" ) == 0 ) {
ses->state_machine->in_message = 1;
buffer_add( ses->from_buffer, get_xml_attr( atts, "from" ) );
buffer_add( ses->recipient_buffer, get_xml_attr( atts, "to" ) );
@@ -350,37 +350,37 @@
if( ses->state_machine->in_message ) {
- if( strcmp( name, "body" ) == 0 ) {
+ if( strcmp( (char*) name, "body" ) == 0 ) {
ses->state_machine->in_message_body = 1;
return;
}
- if( strcmp( name, "subject" ) == 0 ) {
+ if( strcmp( (char*) name, "subject" ) == 0 ) {
ses->state_machine->in_subject = 1;
return;
}
- if( strcmp( name, "thread" ) == 0 ) {
+ if( strcmp( (char*) name, "thread" ) == 0 ) {
ses->state_machine->in_thread = 1;
return;
}
}
- if( strcmp( name, "presence" ) == 0 ) {
+ if( strcmp( (char*) name, "presence" ) == 0 ) {
ses->state_machine->in_presence = 1;
buffer_add( ses->from_buffer, get_xml_attr( atts, "from" ) );
buffer_add( ses->recipient_buffer, get_xml_attr( atts, "to" ) );
return;
}
- if( strcmp( name, "status" ) == 0 ) {
+ if( strcmp( (char*) name, "status" ) == 0 ) {
ses->state_machine->in_status = 1;
return;
}
- if( strcmp( name, "stream:error" ) == 0 ) {
+ if( strcmp( (char*) name, "stream:error" ) == 0 ) {
ses->state_machine->in_error = 1;
ses->state_machine->connected = 0;
osrfLogWarning( OSRF_LOG_MARK, "Received <stream:error> message from Jabber server" );
@@ -389,21 +389,21 @@
/* first server response from a connect attempt */
- if( strcmp( name, "stream:stream" ) == 0 ) {
+ if( strcmp( (char*) name, "stream:stream" ) == 0 ) {
if( ses->state_machine->connecting == CONNECTING_1 ) {
ses->state_machine->connecting = CONNECTING_2;
buffer_add( ses->session_id, get_xml_attr(atts, "id") );
}
}
- if( strcmp( name, "handshake" ) == 0 ) {
+ if( strcmp( (char*) name, "handshake" ) == 0 ) {
ses->state_machine->connected = 1;
ses->state_machine->connecting = 0;
return;
}
- if( strcmp( name, "error" ) == 0 ) {
+ if( strcmp( (char*) name, "error" ) == 0 ) {
ses->state_machine->in_message_error = 1;
buffer_add( ses->message_error_type, get_xml_attr( atts, "type" ) );
ses->message_error_code = atoi( get_xml_attr( atts, "code" ) );
@@ -412,7 +412,7 @@
return;
}
- if( strcmp( name, "iq" ) == 0 ) {
+ if( strcmp( (char*) name, "iq" ) == 0 ) {
ses->state_machine->in_iq = 1;
if( strcmp( get_xml_attr(atts, "type"), "result") == 0
@@ -433,7 +433,7 @@
int i;
if (atts != NULL) {
for(i = 0;(atts[i] != NULL);i++) {
- if( strcmp( atts[i++], attr_name ) == 0 ) {
+ if( strcmp( (char*) atts[i++], attr_name ) == 0 ) {
if( atts[i] != NULL ) {
return (char*) atts[i];
}
@@ -451,7 +451,7 @@
transport_session* ses = (transport_session*) session;
if( ! ses ) { return; }
- if( strcmp( name, "message" ) == 0 ) {
+ if( strcmp( (char*) name, "message" ) == 0 ) {
/* pass off the message info the callback */
@@ -489,22 +489,22 @@
return;
}
- if( strcmp( name, "body" ) == 0 ) {
+ if( strcmp( (char*) name, "body" ) == 0 ) {
ses->state_machine->in_message_body = 0;
return;
}
- if( strcmp( name, "subject" ) == 0 ) {
+ if( strcmp( (char*) name, "subject" ) == 0 ) {
ses->state_machine->in_subject = 0;
return;
}
- if( strcmp( name, "thread" ) == 0 ) {
+ if( strcmp( (char*) name, "thread" ) == 0 ) {
ses->state_machine->in_thread = 0;
return;
}
- if( strcmp( name, "iq" ) == 0 ) {
+ if( strcmp( (char*) name, "iq" ) == 0 ) {
ses->state_machine->in_iq = 0;
if( ses->message_error_code > 0 ) {
osrfLogWarning( OSRF_LOG_MARK, "Error in IQ packet: code %d", ses->message_error_code );
@@ -514,7 +514,7 @@
return;
}
- if( strcmp( name, "presence" ) == 0 ) {
+ if( strcmp( (char*) name, "presence" ) == 0 ) {
ses->state_machine->in_presence = 0;
/*
if( ses->presence_callback ) {
@@ -525,17 +525,17 @@
return;
}
- if( strcmp( name, "status" ) == 0 ) {
+ if( strcmp( (char*) name, "status" ) == 0 ) {
ses->state_machine->in_status = 0;
return;
}
- if( strcmp( name, "error" ) == 0 ) {
+ if( strcmp( (char*) name, "error" ) == 0 ) {
ses->state_machine->in_message_error = 0;
return;
}
- if( strcmp( name, "error:error" ) == 0 ) {
+ if( strcmp( (char*) name, "error:error" ) == 0 ) {
ses->state_machine->in_error = 0;
return;
}
Modified: trunk/src/libopensrf/xml_utils.c
===================================================================
--- trunk/src/libopensrf/xml_utils.c 2007-07-05 16:00:42 UTC (rev 998)
+++ trunk/src/libopensrf/xml_utils.c 2007-07-05 17:58:49 UTC (rev 999)
@@ -97,7 +97,7 @@
if( atts && name ) {
int i;
for(i = 0; (atts[i] != NULL); i++) {
- if(!strcmp(atts[i], name)) {
+ if(!strcmp((char*) atts[i], name)) {
if(atts[++i]) return (char*) atts[i];
}
}
Modified: trunk/src/objson/json_parser.c
===================================================================
--- trunk/src/objson/json_parser.c 2007-07-05 16:00:42 UTC (rev 998)
+++ trunk/src/objson/json_parser.c 2007-07-05 17:58:49 UTC (rev 999)
@@ -503,18 +503,18 @@
if (ucs_char < 0x80) {
utf_out[0] = ucs_char;
- buffer_add(buf, utf_out);
+ buffer_add(buf, (char*) utf_out);
} else if (ucs_char < 0x800) {
utf_out[0] = 0xc0 | (ucs_char >> 6);
utf_out[1] = 0x80 | (ucs_char & 0x3f);
- buffer_add(buf, utf_out);
+ buffer_add(buf, (char*) utf_out);
} else {
utf_out[0] = 0xe0 | (ucs_char >> 12);
utf_out[1] = 0x80 | ((ucs_char >> 6) & 0x3f);
utf_out[2] = 0x80 | (ucs_char & 0x3f);
- buffer_add(buf, utf_out);
+ buffer_add(buf, (char*) utf_out);
}
/* ----------------------------------------------------------------------- */
/* ----------------------------------------------------------------------- */
More information about the opensrf-commits
mailing list