Moin, I compiled today Multisync on an AMD64 and noticed various warnings during the compilation. Most of them are quite harmless, but one or two catched my attention: In syncml_plugin/src/syncml_engine.c I found a '==' where I expected an '=', and in irmc_sync/src/irmc_sync.c I'm not quite sure if there aren't some parentheses needed in line 522. Most other changes are headerfile-includes and prototyping in headerfiles. I'm quite sure that I didn't fix every warning, but at least a few :) Two problems are not fixed (yet): both the ldap_plugin and the palm_sync won't build with '-Wall'. I'll try to fix this as soon as I've a free timeslot.
Patches were tested with 0.81, and adapted to the cvs-version. ciao, Stefan -- Stefan Behlert
diff -urN multisync-0.81.orig/plugins/evolution_sync/src/evolution_sync.c multisync-0.81/plugins/evolution_sync/src/evolution_sync.c --- multisync-0.81.orig/plugins/evolution_sync/src/evolution_sync.c 2003-12-03 02:23:55.000000000 +0100 +++ multisync-0.81/plugins/evolution_sync/src/evolution_sync.c 2004-02-09 13:58:08.000000000 +0100 @@ -25,6 +25,9 @@ */ #include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> +#include <string.h> #include <glib.h> #include <gmodule.h> #include <bonobo/bonobo-main.h> @@ -804,7 +807,7 @@ char **uidret) { // UID exists, this is modify CalComponent *calcomp = NULL; - CalClientResult res; + CalClientResult res = 0; int modified = 0; if (obj->comp) {
diff -urN multisync-cvs.orig/plugins/irmc_sync/src/cobex_bfb.c multisync-cvs/plugins/irmc_sync/src/cobex_bfb.c --- multisync-cvs.orig/plugins/irmc_sync/src/cobex_bfb.c 2004-02-09 14:38:29.134397291 +0100 +++ multisync-cvs/plugins/irmc_sync/src/cobex_bfb.c 2004-02-09 14:39:31.135022786 +0100 @@ -129,7 +129,7 @@ int cobex_handleinput(obex_t *self, void *data, int timeout) { struct timeval time; fd_set fdset; - int actual; + int actual = 0; bfb_frame_t *frame; obexdata_t *c; diff -urN multisync-cvs.orig/plugins/irmc_sync/src/gui.c multisync-cvs/plugins/irmc_sync/src/gui.c --- multisync-cvs.orig/plugins/irmc_sync/src/gui.c 2004-02-09 14:38:29.133397443 +0100 +++ multisync-cvs/plugins/irmc_sync/src/gui.c 2004-02-09 14:39:59.014808157 +0100 @@ -564,6 +564,8 @@ iru->serial); } } break; + default: + break; } close_unitdialog(); } diff -urN multisync-cvs.orig/plugins/irmc_sync/src/irmc_obex.c multisync-cvs/plugins/irmc_sync/src/irmc_obex.c --- multisync-cvs.orig/plugins/irmc_sync/src/irmc_obex.c 2004-02-09 14:38:29.133397443 +0100 +++ multisync-cvs/plugins/irmc_sync/src/irmc_obex.c 2004-02-09 14:40:35.601276577 +0100 @@ -492,7 +492,7 @@ obex_cable_handleinput, 0 }; #endif obexdata_t *userdata; - obex_t *handle; + obex_t *handle = NULL; if (bluetoothplugin) { g_module_symbol(bluetoothplugin,"obex_connect", @@ -561,7 +561,7 @@ } gint irmc_obex_connect(obex_t* handle, char* target) { - int ret; + int ret = -1; obex_object_t *object; obex_headerdata_t hd; obexdata_t *userdata; diff -urN multisync-cvs.orig/plugins/irmc_sync/src/irmc_obex.h multisync-cvs/plugins/irmc_sync/src/irmc_obex.h --- multisync-cvs.orig/plugins/irmc_sync/src/irmc_obex.h 2004-02-09 14:38:29.133397443 +0100 +++ multisync-cvs/plugins/irmc_sync/src/irmc_obex.h 2004-02-09 14:41:28.829227432 +0100 @@ -73,6 +73,10 @@ char *body, gint body_size, char *rspbuf, int *rspbuflen, char *apparam, int apparamlen); int irmc_obex_get(obex_t *handle, char* name, char* buffer, int *buflen); +gint obex_cable_disconnect(obex_t *handle, gpointer ud); +gint obex_cable_write(obex_t *handle, gpointer ud, + guint8 *buf, gint buflen); +gint obex_cable_handleinput(obex_t *handle, gpointer ud, gint timeout); gint irmc_obex_handleinput(obex_t* handle, int timeout); int obex_error_to_sync_msg(int obexerr); void server_done(obex_t *handle, obex_object_t *object, diff -urN multisync-cvs.orig/plugins/irmc_sync/src/irmc_sync.c multisync-cvs/plugins/irmc_sync/src/irmc_sync.c --- multisync-cvs.orig/plugins/irmc_sync/src/irmc_sync.c 2004-02-09 14:38:29.134397291 +0100 +++ multisync-cvs/plugins/irmc_sync/src/irmc_sync.c 2004-02-09 14:42:41.961165524 +0100 @@ -34,6 +34,8 @@ #include <unistd.h> #include <string.h> #include <dirent.h> +#include "gui.h" + #define IRMCFILE "irmc" @@ -522,15 +524,16 @@ objtype = SYNC_OBJECT_TYPE_CALENDAR; event_start = strstr(start, "BEGIN:VEVENT"); todo_start = strstr(start, "BEGIN:VTODO"); - if (!event_start || todo_start && (todo_start < event_start)) { + /* not sure about parentheses -sb */ + if (!event_start || (todo_start && (todo_start < event_start))) { event_start = todo_start; objtype = SYNC_OBJECT_TYPE_TODO; } if (objtype == SYNC_OBJECT_TYPE_CALENDAR) - if (event_end = strstr(start, "END:VEVENT")) + if ((event_end = strstr(start, "END:VEVENT"))) event_end += strlen("END:VEVENT"); if (objtype == SYNC_OBJECT_TYPE_TODO) - if (event_end = strstr(start, "END:VTODO")) + if ((event_end = strstr(start, "END:VTODO"))) event_end += strlen("END:VTODO"); if (event_start && event_end) { int pos = 0; @@ -704,7 +707,7 @@ char *start = event_start; objtype = SYNC_OBJECT_TYPE_PHONEBOOK; event_start = strstr(start, "BEGIN:VCARD"); - if (event_end = strstr(start, "END:VCARD")) + if ((event_end = strstr(start, "END:VCARD"))) event_end += strlen("END:VCARD"); if (event_start && event_end) {
diff -urN multisync-cvs.orig/plugins/opie_sync/src/opie_changes.c multisync-cvs/plugins/opie_sync/src/opie_changes.c --- multisync-cvs.orig/plugins/opie_sync/src/opie_changes.c 2004-02-09 14:38:29.185389547 +0100 +++ multisync-cvs/plugins/opie_sync/src/opie_changes.c 2004-02-09 14:46:17.666519163 +0100 @@ -26,6 +26,7 @@ #include <glib.h> #include <stdio.h> +#include <string.h> #include <multisync.h> #include "opie_comms.h" diff -urN multisync-cvs.orig/plugins/opie_sync/src/opie_comms.c multisync-cvs/plugins/opie_sync/src/opie_comms.c --- multisync-cvs.orig/plugins/opie_sync/src/opie_comms.c 2004-02-09 14:38:29.184389699 +0100 +++ multisync-cvs/plugins/opie_sync/src/opie_comms.c 2004-02-09 14:46:17.667519012 +0100 @@ -26,6 +26,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> @@ -976,8 +977,8 @@ gboolean contact_equals(contact_data* c1, contact_data* c2) { gboolean rc = FALSE; - unsigned char* c1_hash; - unsigned char* c2_hash; + unsigned char* c1_hash = NULL; + unsigned char* c2_hash = NULL; /* TODO * Should be caching the hash value rather than recomputing @@ -1170,8 +1171,8 @@ gboolean todo_equals(todo_data* t1, todo_data* t2) { gboolean rc = FALSE; - unsigned char* t1_hash; - unsigned char* t2_hash; + unsigned char* t1_hash = NULL; + unsigned char* t2_hash = NULL; /* TODO * Should be caching the hash value rather than recomputing @@ -1272,8 +1273,8 @@ gboolean cal_equals(cal_data* c1, cal_data* c2) { gboolean rc = FALSE; - unsigned char* c1_hash; - unsigned char* c2_hash; + unsigned char* c1_hash = NULL; + unsigned char* c2_hash = NULL; /* TODO * Should be caching the hash value rather than recomputing diff -urN multisync-cvs.orig/plugins/opie_sync/src/opie_config.c multisync-cvs/plugins/opie_sync/src/opie_config.c --- multisync-cvs.orig/plugins/opie_sync/src/opie_config.c 2004-02-09 14:38:29.187389244 +0100 +++ multisync-cvs/plugins/opie_sync/src/opie_config.c 2004-02-09 14:46:41.567900070 +0100 @@ -26,6 +26,7 @@ #include "opie_config.h" #include <multisync.h> +#include <string.h> #include <expat.h> diff -urN multisync-cvs.orig/plugins/opie_sync/src/opie_qcop.c multisync-cvs/plugins/opie_sync/src/opie_qcop.c --- multisync-cvs.orig/plugins/opie_sync/src/opie_qcop.c 2004-02-09 14:38:29.181390155 +0100 +++ multisync-cvs/plugins/opie_sync/src/opie_qcop.c 2004-02-09 14:47:35.739696283 +0100 @@ -33,10 +33,12 @@ */ #include <stdio.h> +#include <string.h> #include <sys/types.h> #include <sys/time.h> #include <netinet/in.h> #include <sys/socket.h> +#include <arpa/inet.h> #include <netdb.h> #include <glib.h> #include <pthread.h> @@ -74,7 +76,7 @@ buffer = g_string_new(""); curr_char = g_strndup("",1); - while (received = read(qconn->socket, curr_char, 1) && !(strstr(curr_char, "\n"))) + while ((received = read(qconn->socket, curr_char, 1) && !(strstr(curr_char, "\n")))) { if(received < 0) { @@ -336,7 +338,7 @@ return NULL; } - if (start=strstr(strstr(pc,"/")+1,"/")) /* We need the second slash */ + if ((start=strstr(strstr(pc,"/")+1,"/"))) /* We need the second slash */ { /* caller responsible for free()ing temp */ temp = g_strndup(start,strstr(start," ")-start); /* from slash to blank is our path */ diff -urN multisync-cvs.orig/plugins/opie_sync/src/opie_sync.c multisync-cvs/plugins/opie_sync/src/opie_sync.c --- multisync-cvs.orig/plugins/opie_sync/src/opie_sync.c 2004-02-09 14:38:29.182390003 +0100 +++ multisync-cvs/plugins/opie_sync/src/opie_sync.c 2004-02-09 14:49:07.317823882 +0100 @@ -25,6 +25,7 @@ */ #include <stdlib.h> +#include <string.h> #include <errno.h> #include <glib.h> #include <multisync.h> @@ -33,6 +34,10 @@ #include "opie_log.h" #include "opie_debug.h" #include "opie_qcop.h" +#include "opie_config.h" +#include "opie_changes.h" +#include "opie_vtype.h" + /* this should match MULTISYNC_API_VER in * multisync.h if everything is up to date */ @@ -937,7 +942,7 @@ { categories_file = g_strdup_printf("%s/Categories.xml", sync_get_datapath(conn->sync_pair)); - if(fd = fopen(categories_file, "w")) + if ((fd = fopen(categories_file, "w"))) { /* write to disk */ categories_xml = serialize_category_data(conn, categories); @@ -997,7 +1002,7 @@ { contacts_file = g_strdup_printf("%s/addressbook.xml", sync_get_datapath(conn->sync_pair)); - if(fd = fopen(contacts_file, "w")) + if ((fd = fopen(contacts_file, "w"))) { /* write to disk */ contacts_xml = serialize_contact_data(conn, contacts); @@ -1059,7 +1064,7 @@ todo_file = g_strdup_printf("%s/todolist.xml", sync_get_datapath(conn->sync_pair)); - if(fd = fopen(todo_file, "w")) + if ((fd = fopen(todo_file, "w"))) { /* write to disk */ todo_xml = serialize_todo_data(conn, todos); diff -urN multisync-cvs.orig/plugins/opie_sync/src/opie_vtype.c multisync-cvs/plugins/opie_sync/src/opie_vtype.c --- multisync-cvs.orig/plugins/opie_sync/src/opie_vtype.c 2004-02-09 14:38:29.184389699 +0100 +++ multisync-cvs/plugins/opie_sync/src/opie_vtype.c 2004-02-09 14:49:30.082374741 +0100 @@ -29,6 +29,7 @@ #include "opie_log.h" #include "opie_debug.h" +#include <string.h> #include <vobject.h> #include <vcc.h> diff -urN multisync-cvs.orig/plugins/opie_sync/src/opie_xml.c multisync-cvs/plugins/opie_sync/src/opie_xml.c --- multisync-cvs.orig/plugins/opie_sync/src/opie_xml.c 2004-02-09 14:38:29.186389395 +0100 +++ multisync-cvs/plugins/opie_sync/src/opie_xml.c 2004-02-09 14:49:41.346667941 +0100 @@ -27,6 +27,7 @@ #include "opie_xml.h" #include "opie_comms.h" +#include <string.h> #include <expat.h> #define PARSE_BUF_SIZE (512)
diff -urN multisync-cvs.orig/plugins/syncml_plugin/src/syncml_engine.c multisync-cvs/plugins/syncml_plugin/src/syncml_engine.c --- multisync-cvs.orig/plugins/syncml_plugin/src/syncml_engine.c 2004-02-09 14:38:29.120399416 +0100 +++ multisync-cvs/plugins/syncml_plugin/src/syncml_engine.c 2004-02-09 14:52:39.979591683 +0100 @@ -34,6 +34,7 @@ * $Id: syncml_engine.c,v 1.61 2004/01/12 18:05:48 lincoln Exp $ */ +#include <unistd.h> #include <string.h> #include <libxml/tree.h> #include <libxml/parser.h> @@ -43,6 +44,7 @@ #include "syncml_engine.h" #include "base64.h" #include "syncml_plugin.h" +#include "syncml_cmd.h" #include "config.h" extern gboolean multisync_debug; @@ -1210,6 +1212,10 @@ } } break; + /* SYNCML_DISCONNECT_DISCONNECT, SYNCML_AUTH_NONESYNCML_AUTH_NONE */ + default: + break; + } g_free(data); } @@ -2006,6 +2012,9 @@ syncml_error(state, state->userdata, SYNCML_ERROR_CONNECTIONFAILED); syncml_reset_state(state); break; + /* SYNCML_DISCONNECT_DISCONNECT */ + default: + break; } } else { if (!state->isserver) @@ -2217,7 +2226,7 @@ state->waitforcmd = SYNCML_ENGINE_CMD_MAP; } - state->task == SYNCML_ENGINE_CMD_NONE; + state->task = SYNCML_ENGINE_CMD_NONE; state->syncstatusreceived = FALSE; } if (state->syncreceived) { diff -urN multisync-cvs.orig/plugins/syncml_plugin/src/syncml_plugin.c multisync-cvs/plugins/syncml_plugin/src/syncml_plugin.c --- multisync-cvs.orig/plugins/syncml_plugin/src/syncml_plugin.c 2004-02-09 14:38:29.118399720 +0100 +++ multisync-cvs/plugins/syncml_plugin/src/syncml_plugin.c 2004-02-09 14:53:17.081965755 +0100 @@ -36,10 +36,12 @@ #include <stdio.h> #include <unistd.h> +#include <string.h> #include <multisync.h> #include "syncml_plugin.h" #include "syncml_engine.h" #include "syncml_cmd.h" +#include "gui.h" extern gboolean multisync_debug; diff -urN multisync-cvs.orig/plugins/syncml_plugin/src/syncml_plugin.h multisync-cvs/plugins/syncml_plugin/src/syncml_plugin.h --- multisync-cvs.orig/plugins/syncml_plugin/src/syncml_plugin.h 2004-02-09 14:38:29.118399720 +0100 +++ multisync-cvs/plugins/syncml_plugin/src/syncml_plugin.h 2004-02-09 14:53:52.399609777 +0100 @@ -71,6 +71,8 @@ void resp_objchanged(syncml_connection *conn); void resp_get_changes(syncml_connection *conn, int respcode, change_info *changes); +void syncml_reget_changes(syncml_state *state, syncml_connection *conn, + sync_object_type object_types); syncml_connection* sync_connect(sync_pair* handle, connection_type type, sync_object_type object_types); void syncml_free_connection(syncml_connection *conn); diff -urN multisync-cvs.orig/plugins/syncml_plugin/src/syncml_ssl.c multisync-cvs/plugins/syncml_plugin/src/syncml_ssl.c --- multisync-cvs.orig/plugins/syncml_plugin/src/syncml_ssl.c 2004-02-09 14:38:29.123398961 +0100 +++ multisync-cvs/plugins/syncml_plugin/src/syncml_ssl.c 2004-02-09 14:54:52.792449609 +0100 @@ -37,11 +37,13 @@ #include "config.h" #include <stdio.h> #include <unistd.h> +#include <string.h> #include <openssl/ssl.h> #include <sys/types.h> #include <sys/socket.h> #include <errno.h> #include <sys/stat.h> +#include <sys/wait.h> #include <openssl/dh.h> #include "syncml_engine.h" #include "syncml_plugin.h" @@ -227,6 +229,7 @@ } SSL_set_accept_state(ssl); state->ssl = ssl; + return(TRUE); } @@ -245,6 +248,7 @@ } SSL_set_connect_state(ssl); state->ssl = ssl; + return(TRUE); } @@ -299,6 +303,7 @@ SSL_CTX_set_tmp_dh(ctx, syncml_strong_dh2048()); SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE); state->sslctx = ctx; + return(TRUE); } // Initialization, called only once.