Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5037 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20767 invoked by uid 1010); 27 Oct 2003 12:31:55 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20737 invoked from network); 27 Oct 2003 12:31:54 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by pb1.pair.com with SMTP; 27 Oct 2003 12:31:54 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9RCVrM27103; Mon, 27 Oct 2003 07:31:53 -0500 Received: from lacrosse.corp.redhat.com (lacrosse.corp.redhat.com [172.16.52.154]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9RCVr611488; Mon, 27 Oct 2003 07:31:53 -0500 Received: from radish.cambridge.redhat.com (radish.cambridge.redhat.com [172.16.18.90]) by lacrosse.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9RCVpi09317; Mon, 27 Oct 2003 07:31:51 -0500 Received: from radish.cambridge.redhat.com (localhost.localdomain [127.0.0.1]) by radish.cambridge.redhat.com (8.12.10/8.12.7) with ESMTP id h9RCVong027116; Mon, 27 Oct 2003 12:31:50 GMT Received: (from jorton@localhost) by radish.cambridge.redhat.com (8.12.10/8.12.10/Submit) id h9RCVmoG027115; Mon, 27 Oct 2003 12:31:48 GMT Date: Mon, 27 Oct 2003 12:31:47 +0000 To: dan@libby.com, internals@lists.php.net Message-ID: <20031027123147.GA8389@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: [PATCH] libxmlrpc warning fixes From: jorton@redhat.com (Joe Orton) Hi, this patch fixes compiler warnings in the version of libxmlrpc included in the PHP 4.3 branch. (unspecified return value, format string bugs, missing includes, unused function/variables) Index: ext/xmlrpc/libxmlrpc/simplestring.c =================================================================== RCS file: /repository/php-src/ext/xmlrpc/libxmlrpc/simplestring.c,v retrieving revision 1.3 diff -u -r1.3 simplestring.c --- ext/xmlrpc/libxmlrpc/simplestring.c 22 Aug 2002 01:25:50 -0000 1.3 +++ ext/xmlrpc/libxmlrpc/simplestring.c 27 Oct 2003 12:27:21 -0000 @@ -79,6 +79,7 @@ ******/ #include +#include #include "simplestring.h" #define my_free(thing) if(thing) {free(thing); thing = 0;} Index: ext/xmlrpc/libxmlrpc/xml_element.c =================================================================== RCS file: /repository/php-src/ext/xmlrpc/libxmlrpc/xml_element.c,v retrieving revision 1.3.4.1 diff -u -r1.3.4.1 xml_element.c --- ext/xmlrpc/libxmlrpc/xml_element.c 27 Nov 2002 04:07:00 -0000 1.3.4.1 +++ ext/xmlrpc/libxmlrpc/xml_element.c 27 Oct 2003 12:27:21 -0000 @@ -471,18 +471,20 @@ } /* print buf to file */ -static file_out_fptr(void *f, const char *text, int size) +static int file_out_fptr(void *f, const char *text, int size) { fputs(text, (FILE *)f); + return 0; } /* print buf to simplestring */ -static simplestring_out_fptr(void *f, const char *text, int size) +static int simplestring_out_fptr(void *f, const char *text, int size) { simplestring* buf = (simplestring*)f; if(buf) { simplestring_addn(buf, text, size); } + return 0; } /****f* xml_element/xml_elem_serialize_to_string @@ -696,7 +698,7 @@ if(byte_idx >= 0) { snprintf(buf, sizeof(buf), - "\n\tdata beginning %i before byte index: %s\n", + "\n\tdata beginning %ld before byte index: %s\n", byte_idx > 10 ? 10 : byte_idx, in_buf + (byte_idx > 10 ? byte_idx - 10 : byte_idx)); } @@ -705,7 +707,7 @@ "\tdescription: %s\n" "\tline: %i\n" "\tcolumn: %i\n" - "\tbyte index: %i\n" + "\tbyte index: %ld\n" "\ttotal bytes: %i\n%s ", err_code, error_str, line_num, col_num, byte_idx, byte_total, buf); Index: ext/xmlrpc/libxmlrpc/xmlrpc.c =================================================================== RCS file: /repository/php-src/ext/xmlrpc/libxmlrpc/xmlrpc.c,v retrieving revision 1.4 diff -u -r1.4 xmlrpc.c --- ext/xmlrpc/libxmlrpc/xmlrpc.c 5 Jul 2002 04:43:53 -0000 1.4 +++ ext/xmlrpc/libxmlrpc/xmlrpc.c 27 Oct 2003 12:27:22 -0000 @@ -122,6 +122,7 @@ #include #include #include +#include #include "queue.h" #include "xmlrpc.h" @@ -704,7 +705,7 @@ XMLRPC_ERROR_CODE code; char buf[1024]; snprintf(buf, sizeof(buf), - "error occurred at line %i, column %i, byte index %i", + "error occurred at line %ld, column %ld, byte index %ld", error->line, error->column, error->byte_index); /* expat specific errors */ @@ -815,13 +816,6 @@ return v; } -static const char* get_string(const char* buf, int bDup) { - if(bDup) { - return strdup(buf); - } - return buf; -} - /*******/ /****f* VALUE/XMLRPC_SetValueID_Case @@ -1047,8 +1041,6 @@ val = XMLRPC_CreateValueEmpty(); if(val) { - XMLRPC_VECTOR *pSIV = NULL; - if(XMLRPC_SetIsVector(val, type)) { if(id) { const char *pSVI = NULL; @@ -1609,6 +1601,8 @@ } } break; + default: + break; } } return xReturn; @@ -2447,6 +2441,7 @@ return "struct"; } } + return "unknown"; } /****f* VALUE/XMLRPC_ServerFindMethod Index: ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c =================================================================== RCS file: /repository/php-src/ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c,v retrieving revision 1.3 diff -u -r1.3 xmlrpc_introspection.c --- ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c 5 Jul 2002 04:43:53 -0000 1.3 +++ ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c 27 Oct 2003 12:27:22 -0000 @@ -346,7 +346,7 @@ const char* ptype = !strcmp(el->name, "value") ? type : basetype; if(ptype) { if(Q_Size(&el->children) && - !strcmp(ptype, "array") || !strcmp(ptype, "struct") || !strcmp(ptype, "mixed")) { + (!strcmp(ptype, "array") || !strcmp(ptype, "struct") || !strcmp(ptype, "mixed"))) { xSubList = XMLRPC_CreateVector("member", xmlrpc_vector_array); if(xSubList) {