]> www.infradead.org Git - users/dwmw2/ews-sync.git/commitdiff
Clean up final fprintf(stderr) calls.
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 21 Jul 2010 00:01:13 +0000 (01:01 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 21 Jul 2010 00:01:13 +0000 (01:01 +0100)
calitem_to_ical.c

index 6fd16a17f7ce398a1be504ac34c7e3b8f1f3348e..06130e0d4de09d5727b60691e6bea09e22c49d33 100644 (file)
@@ -768,7 +768,7 @@ static const char *ews_tz_to_ical(const char *ewstz)
                        return table[i].ical;
        }
 
-       fprintf(stderr, "Unrecognised TimeZone '%s'\n", ewstz);
+       g_warning("Unrecognised TimeZone '%s'", ewstz);
        return NULL;
        
 }
@@ -786,7 +786,7 @@ icaltimezone *get_timezone(xmlNode *xml_node, GError **error)
                        break;
        }
        if (!xml_node) {
-               fprintf(stderr, "Failed to find TimeZone element; falling back to UTC\n");
+               g_warning("Failed to find TimeZone element; falling back to UTC");
                return NULL;
        }
 
@@ -803,8 +803,8 @@ icaltimezone *get_timezone(xmlNode *xml_node, GError **error)
        if (zone)
                return zone;
 
-       fprintf(stderr, "Failed to load ical timezone for '%s' (%s)\n", tzname,
-               ews_tzname);
+       g_warning("Failed to load ical timezone for '%s' (%s)",
+                 tzname, ews_tzname);
        return NULL;
 }
 
@@ -821,19 +821,19 @@ gboolean get_baseoffset(xmlNode *xml_node, int *retval, GError **error)
        }
        if (!xml_node) {
                g_set_error(error, EWS_ERROR, EWS_ERROR_PARSE,
-                           "<MeetingTimeZone> has no <BaseOffset>\n");
+                           "<MeetingTimeZone> has no <BaseOffset>");
                return FALSE;
        }
        baseoffset = (const char *)xmlNodeGetContent(xml_node);
        if (!baseoffset) {
                g_set_error(error, EWS_ERROR, EWS_ERROR_PARSE,
-                           "<BaseOffset> is empty\n");
+                           "<BaseOffset> is empty");
                return FALSE;
        }
        ofs = icaldurationtype_from_string(baseoffset);
        if (icaldurationtype_is_bad_duration(ofs)) {
                g_set_error(error, EWS_ERROR, EWS_ERROR_PARSE,
-                           "Failed to parse <BaseOffset> '%s'\n", baseoffset);
+                           "Failed to parse <BaseOffset> '%s'", baseoffset);
                return FALSE;
        }
        if (ofs.is_neg)
@@ -1189,16 +1189,16 @@ icalcomponent *process_timezone_rule(xmlNode *xml_node, icalcomponent_kind kind,
                } else if (!strcmp((char *)xml_node->name, "AbsoluteDate")) {
                        /* Are there really timezones which change on the same date
                           every year? */
-                       fprintf(stderr, "Don't know how to handle AbsoluteDate for timezone change: '%s'\n",
-                               xmlNodeGetContent(xml_node));
+                       g_warning("Don't know how to handle AbsoluteDate for timezone change: '%s'",
+                                 xmlNodeGetContent(xml_node));
                } else if (!strcmp((char *)xml_node->name, "Time")) {
                        struct icaltimetype dtstart;
                        char *time_string = (char *)xmlNodeGetContent(xml_node);
 
                        if (strlen(time_string) != 8 || time_string[2] != ':' ||
                            time_string[5] != ':') {
-                               fprintf(stderr, "Cannot parse dst change time '%s'\n",
-                                       time_string);
+                               g_warning("Cannot parse dst change time '%s'",
+                                         time_string);
                                return NULL;
                        }
                        memset(&dtstart, 0, sizeof(dtstart));
@@ -1258,8 +1258,8 @@ icaltimezone *get_meeting_timezone(xmlNode *xml_node, GError **error)
                                                         ICAL_XDAYLIGHT_COMPONENT,
                                                         &dst_offset, error);
                } else {
-                       fprintf(stderr, "Unknown element in MeetingTimeZone: %s\n",
-                               xml_node->name);
+                       g_warning("Unknown element in MeetingTimeZone: %s",
+                                 xml_node->name);
                }
        }