From: <dg...@su...> - 2009-01-19 18:11:33
|
Author: savago Date: Mon Jan 19 19:10:32 2009 New Revision: 5191 URL: http://www.opensync.org/changeset/5191 Log: Cleaning up some compiler warnings. This required to change the conversion order between formats from (change -> xmlobj -> string) to (change -> string), I'm not sure if the current logic is correct. Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Mon Jan 19 18:22:08 2009 (r5190) +++ plugins/google-calendar/src/gcalendar.c Mon Jan 19 19:10:32 2009 (r5191) @@ -203,7 +203,7 @@ struct gc_plgdata *plgdata = data; char slow_sync_flag = 0; OSyncError *error = NULL; - OSyncXMLFormat *xmlformat; + /* OSyncXMLFormat *xmlformat; */ OSyncData *odata = NULL; OSyncChange *chg = NULL; int result = 0, i; @@ -287,6 +287,7 @@ goto error; raw_xml = plgdata->xslt_ctx_gcal->xml_str; + /* xmlformat = osync_xmlformat_parse(raw_xml, strlen(raw_xml), &error); @@ -300,6 +301,11 @@ odata = osync_data_new(xmlformat, osync_xmlformat_size(), plgdata->gcal_format, &error); + */ + + odata = osync_data_new(raw_xml, + strlen(raw_xml), + plgdata->gcal_format, &error); if (!odata) goto cleanup; @@ -343,7 +349,7 @@ cleanup: osync_error_unref(&error); - osync_xmlformat_unref(&xmlformat); + /* osync_xmlformat_unref(&xmlformat); */ error: osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, msg); @@ -359,7 +365,7 @@ struct gc_plgdata *plgdata = data; char slow_sync_flag = 0; OSyncError *error = NULL; - OSyncXMLFormat *xmlformat; + /* OSyncXMLFormat *xmlformat; */ OSyncData *odata = NULL; OSyncChange *chg = NULL; int result = 0, i; @@ -443,7 +449,9 @@ if ((result = xslt_transform(plgdata->xslt_ctx_gcont, raw_xml))) goto error; + raw_xml = plgdata->xslt_ctx_gcont->xml_str; + /* xmlformat = osync_xmlformat_parse(raw_xml, strlen(raw_xml), &error); @@ -458,7 +466,11 @@ odata = osync_data_new(xmlformat, osync_xmlformat_size(), plgdata->gcont_format, &error); + */ + odata = osync_data_new(raw_xml, + strlen(raw_xml), + plgdata->gcont_format, &error); if (!odata) goto cleanup; @@ -502,7 +514,7 @@ cleanup: osync_error_unref(&error); - osync_xmlformat_unref(&xmlformat); + /* osync_xmlformat_unref(&xmlformat); */ error: osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, msg); @@ -519,13 +531,15 @@ int size, result; char *osync_xml = NULL, *msg = NULL, *raw_xml = NULL, *updated_event = NULL; OSyncData *odata = NULL; - OSyncXMLFormat *xmlformat = NULL; + /* OSyncXMLFormat *xmlformat = NULL; */ if (!(odata = osync_change_get_data(change))) { msg = "Cannot get raw data from change obj!\n"; goto error; } + //void osync_data_get_data(OSyncData *data, char **buffer, unsigned int *size) + /* osync_data_get_data(odata, &xmlformat, &size); if (!osync_xml) { msg = "Failed getting xmlobj from change obj!\n"; @@ -537,6 +551,13 @@ msg = "Failed getting xml from xmlobj!\n"; goto error; } + */ + + osync_data_get_data(odata, &osync_xml, &size); + if (!osync_xml) { + msg = "Failed getting xml from xmlobj!\n"; + goto error; + } /* Convert to gdata format */ if ((result = xslt_transform(plgdata->xslt_ctx_gcal, osync_xml))) { @@ -634,13 +655,14 @@ int size, result; char *osync_xml = NULL, *msg = NULL, *raw_xml = NULL, *updated_contact = NULL; OSyncData *odata = NULL; - OSyncXMLFormat *xmlformat = NULL; + /* OSyncXMLFormat *xmlformat = NULL; */ if (!(odata = osync_change_get_data(change))) { msg = "Cannot get raw data from change obj!\n"; goto error; } + /* osync_data_get_data(odata, &xmlformat, &size); if (!xmlformat) { msg = "Failed getting xmlobj from change obj!\n"; @@ -651,6 +673,13 @@ if (!osync_xml) { msg = "Failed getting xml from xmlobj!\n"; goto error; + } + */ + + osync_data_get_data(odata, &osync_xml, &size); + if (!osync_xml) { + msg = "Failed getting xml from xmlobj!\n"; + goto error; } /* Convert to gdata format */ |