diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 23:13:25 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-29 00:13:23 +0800 |
commit | fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056 (patch) | |
tree | ae78be371695c3dc18847b87d3f014f985aa3a40 /calendar/conduits | |
parent | 6f5464f34ceec9e5701e3e3e651a40f9e6b3a072 (diff) | |
download | gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.gz gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.zst gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.zip |
Prefer GLib basic types over C types.
Diffstat (limited to 'calendar/conduits')
-rw-r--r-- | calendar/conduits/calendar/calendar-conduit.c | 116 | ||||
-rw-r--r-- | calendar/conduits/common/libecalendar-common-conduit.c | 62 | ||||
-rw-r--r-- | calendar/conduits/common/libecalendar-common-conduit.h | 18 | ||||
-rw-r--r-- | calendar/conduits/memo/memo-conduit.c | 86 | ||||
-rw-r--r-- | calendar/conduits/todo/todo-conduit.c | 106 |
5 files changed, 194 insertions, 194 deletions
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index 5aef1aeb53..3654f5bed1 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -151,9 +151,9 @@ calconduit_load_configuration (guint32 pilot_id) c->secret = e_pilot_setup_get_bool (prefix, "secret", FALSE); c->multi_day_split = e_pilot_setup_get_bool (prefix, "multi_day_split", TRUE); if ((c->last_uri = e_pilot_setup_get_string (prefix, "last_uri", NULL)) && !strncmp (c->last_uri, "file://", 7)) { - char *filename = g_filename_from_uri (c->last_uri, NULL, NULL); - const char *path = filename; - const char *home; + gchar *filename = g_filename_from_uri (c->last_uri, NULL, NULL); + const gchar *path = filename; + const gchar *home; home = g_get_home_dir (); @@ -379,10 +379,10 @@ e_calendar_context_destroy (ECalConduitContext *ctxt) } /* Debug routines */ -static char * +static gchar * print_local (ECalLocalRecord *local) { - static char buff[ 4096 ]; + static gchar buff[ 4096 ]; if (local == NULL) { sprintf (buff, "[NULL]"); @@ -403,9 +403,9 @@ print_local (ECalLocalRecord *local) return ""; } -static char *print_remote (GnomePilotRecord *remote) +static gchar *print_remote (GnomePilotRecord *remote) { - static char buff[ 4096 ]; + static gchar buff[ 4096 ]; struct Appointment appt; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; @@ -446,10 +446,10 @@ static char *print_remote (GnomePilotRecord *remote) return buff; } -static char * -auth_func_cb (ECal *ecal, const char* prompt, const char *key, gpointer user_data) +static gchar * +auth_func_cb (ECal *ecal, const gchar * prompt, const gchar *key, gpointer user_data) { - char *password; + gchar *password; ESource *source; const gchar *auth_domain, *component_name; @@ -464,9 +464,9 @@ auth_func_cb (ECal *ecal, const char* prompt, const char *key, gpointer user_dat static int start_calendar_server (ECalConduitContext *ctxt) { - char *str_uri = NULL; - char *pass_key = NULL; - int retval = 0; + gchar *str_uri = NULL; + gchar *pass_key = NULL; + gint retval = 0; g_return_val_if_fail (ctxt != NULL, -2); @@ -505,7 +505,7 @@ start_calendar_server (ECalConduitContext *ctxt) /* Utility routines */ static icaltimezone * -get_timezone (ECal *client, const char *tzid) +get_timezone (ECal *client, const gchar *tzid) { icaltimezone *timezone = NULL; @@ -521,7 +521,7 @@ get_default_timezone (void) { EConfigListener *listener; icaltimezone *timezone = NULL; - char *location; + gchar *location; listener = e_config_listener_new (); @@ -541,10 +541,10 @@ get_default_timezone (void) } -static char * +static gchar * map_name (ECalConduitContext *ctxt) { - char *filename; + gchar *filename; filename = g_strdup_printf ("%s/.evolution/calendar/local/system/pilot-map-calendar-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id); @@ -553,7 +553,7 @@ map_name (ECalConduitContext *ctxt) } static icalrecurrencetype_weekday -get_ical_day (int day) +get_ical_day (gint day) { switch (day) { case 0: @@ -634,7 +634,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp icaltimezone *tz_start, *tz_end; time_t event_start, event_end, day_end; struct icaltimetype *old_start_value, *old_end_value; - const char *uid; + const gchar *uid; gboolean is_date = FALSE; gboolean last = FALSE; gboolean ret = TRUE; @@ -677,7 +677,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp while (!last) { ECalComponent *clone = e_cal_component_clone (ccc->comp); icalcomponent *ical_comp = NULL; - char *new_uid = e_cal_component_gen_uid (); + gchar *new_uid = e_cal_component_gen_uid (); struct icaltimetype start_value, end_value; ECalChange *c = NULL; @@ -743,7 +743,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp } static short -nth_weekday (int pos, icalrecurrencetype_weekday weekday) +nth_weekday (gint pos, icalrecurrencetype_weekday weekday) { g_assert ((pos > 0 && pos <= 5) || (pos == -1)); @@ -757,7 +757,7 @@ next_changed_item (ECalConduitContext *ctxt, GList *changes) GList *l; for (l = changes; l != NULL; l = l->next) { - const char *uid; + const gchar *uid; ccc = l->data; @@ -770,7 +770,7 @@ next_changed_item (ECalConduitContext *ctxt, GList *changes) } static void -compute_status (ECalConduitContext *ctxt, ECalLocalRecord *local, const char *uid) +compute_status (ECalConduitContext *ctxt, ECalLocalRecord *local, const gchar *uid) { ECalChange *ccc; @@ -834,7 +834,7 @@ local_record_to_pilot_record (ECalLocalRecord *local, #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #else - static char record[0xffff]; + static gchar record[0xffff]; #endif memset(&p, 0, sizeof (p)); @@ -865,7 +865,7 @@ local_record_to_pilot_record (ECalLocalRecord *local, pi_buffer_free(buffer); #else - p.record = (unsigned char *)record; + p.record = (guchar *)record; p.length = pack_Appointment (local->appt, p.record, 0xffff); #endif return p; @@ -877,14 +877,14 @@ local_record_to_pilot_record (ECalLocalRecord *local, static void local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduitContext *ctxt) { - const char *uid; + const gchar *uid; ECalComponentText summary; GSList *d_list = NULL, *edl = NULL, *l; ECalComponentText *description; ECalComponentDateTime dt_start, dt_end; ECalComponentClassification classif; icaltimezone *default_tz = ctxt->timezone; - int i; + gint i; g_return_if_fail (local != NULL); g_return_if_fail (comp != NULL); @@ -902,7 +902,7 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit * we don't overwrite them */ if (local->local.ID != 0) { - int cat = 0; + gint cat = 0; #ifdef PILOT_LINK_0_12 struct Appointment appt; pi_buffer_t * record; @@ -914,7 +914,7 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit } #else struct Appointment appt; - char record[0xffff]; + gchar record[0xffff]; #endif if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, ctxt->dbi->db_handle, @@ -930,7 +930,7 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit #ifdef PILOT_LINK_0_12 unpack_Appointment (&appt, record, datebook_v1); #else - unpack_Appointment (&appt, (unsigned char *)record, 0xffff); + unpack_Appointment (&appt, (guchar *)record, 0xffff); #endif local->appt->alarm = appt.alarm; local->appt->advance = appt.advance; @@ -1152,7 +1152,7 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit static void local_record_from_uid (ECalLocalRecord *local, - const char *uid, + const gchar *uid, ECalConduitContext *ctxt) { ECalComponent *comp; @@ -1199,8 +1199,8 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, ECalComponentText summary = {NULL, NULL}; ECalComponentDateTime dt = {NULL, NULL}; GSList *edl = NULL; - char *txt; - int pos, i; + gchar *txt; + gint pos, i; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #endif @@ -1456,8 +1456,8 @@ static void check_for_slow_setting (GnomePilotConduit *c, ECalConduitContext *ctxt) { GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c); - int map_count; - const char *uri; + gint map_count; + const gchar *uri; /* If there are objects but no log */ map_count = g_hash_table_size (ctxt->map->pid_map); @@ -1488,9 +1488,9 @@ pre_sync (GnomePilotConduit *conduit, { GnomePilotConduitSyncAbs *abs_conduit; GList *removed = NULL, *added = NULL, *l; - int len; - unsigned char *buf; - char *filename, *change_id; + gint len; + guchar *buf; + gchar *filename, *change_id; icalcomponent *icalcomp; gint num_records, add_records = 0, mod_records = 0, del_records = 0; #ifdef PILOT_LINK_0_12 @@ -1560,7 +1560,7 @@ pre_sync (GnomePilotConduit *conduit, ctxt->changed = g_list_concat (ctxt->changed, added); for (l = removed; l != NULL; l = l->next) { ECalChange *ccc = l->data; - const char *uid; + const gchar *uid; e_cal_component_get_uid (ccc->comp, &uid); if (e_pilot_map_lookup_pid (ctxt->map, uid, FALSE) == 0) { @@ -1573,7 +1573,7 @@ pre_sync (GnomePilotConduit *conduit, for (l = ctxt->changed; l != NULL; l = l->next) { ECalChange *ccc = l->data; - const char *uid; + const gchar *uid; e_cal_component_get_uid (ccc->comp, &uid); if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) { @@ -1614,9 +1614,9 @@ pre_sync (GnomePilotConduit *conduit, DLP_BUF_SIZE, buffer); #else - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0, - (unsigned char *)buf, 0xffff); + (guchar *)buf, 0xffff); #endif if (len < 0) { WARN (_("Could not read pilot's Calendar application block")); @@ -1649,18 +1649,18 @@ post_sync (GnomePilotConduit *conduit, { GList *changed; gchar *filename, *change_id; - unsigned char *buf; - int dlpRetVal, len; + guchar *buf; + gint dlpRetVal, len; LOG (g_message ( "post_sync: Calendar Conduit v.%s", CONDUIT_VERSION )); /* Write AppBlock to PDA - updates categories */ - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = pack_AppointmentAppInfo (&(ctxt->ai), buf, 0xffff); dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, - (unsigned char *)buf, len); + (guchar *)buf, len); g_free (buf); @@ -1699,7 +1699,7 @@ set_pilot_id (GnomePilotConduitSyncAbs *conduit, guint32 ID, ECalConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ( "set_pilot_id: setting to %d\n", ID )); @@ -1714,7 +1714,7 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, ECalLocalRecord *local, ECalConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ( "set_status_cleared: clearing status\n" )); @@ -1730,7 +1730,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, ECalConduitContext *ctxt) { static GList *comps, *iterator; - static int count; + static gint count; GList *unused; g_return_val_if_fail (local != NULL, -1); @@ -1789,7 +1789,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, ECalConduitContext *ctxt) { static GList *iterator; - static int count; + static gint count; GList *unused; g_return_val_if_fail (local != NULL, -1); @@ -1851,7 +1851,7 @@ compare (GnomePilotConduitSyncAbs *conduit, { /* used by the quick compare */ GnomePilotRecord local_pilot; - int retval = 0; + gint retval = 0; LOG (g_message ("compare: local=%s remote=%s...\n", print_local (local), print_remote (remote))); @@ -1879,8 +1879,8 @@ add_record (GnomePilotConduitSyncAbs *conduit, ECalConduitContext *ctxt) { ECalComponent *comp; - char *uid; - int retval = 0; + gchar *uid; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1911,7 +1911,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, ECalConduitContext *ctxt) { ECalComponent *new_comp; - int retval = 0; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1934,7 +1934,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, ECalLocalRecord *local, ECalConduitContext *ctxt) { - const char *uid; + const gchar *uid; g_return_val_if_fail (local != NULL, -1); g_assert (local->comp != NULL); @@ -1959,8 +1959,8 @@ archive_record (GnomePilotConduitSyncAbs *conduit, gboolean archive, ECalConduitContext *ctxt) { - const char *uid; - int retval = 0; + const gchar *uid; + gint retval = 0; g_return_val_if_fail (local != NULL, -1); @@ -1978,7 +1978,7 @@ match (GnomePilotConduitSyncAbs *conduit, ECalLocalRecord **local, ECalConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ("match: looking for local copy of %s\n", print_remote (remote))); diff --git a/calendar/conduits/common/libecalendar-common-conduit.c b/calendar/conduits/common/libecalendar-common-conduit.c index cdb4a10d2d..1be106929d 100644 --- a/calendar/conduits/common/libecalendar-common-conduit.c +++ b/calendar/conduits/common/libecalendar-common-conduit.c @@ -58,11 +58,11 @@ * in UTF-8 format. A conversion must take place before calling * this function (see e_pilot_utf8_to_pchar() in e-pilot-util.c) */ -int -e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *category) +gint +e_pilot_add_category_if_possible(gchar *cat_to_add, struct CategoryAppInfo *category) { - int i, j; - int retval = 0; /* 0 is the Unfiled category */ + gint i, j; + gint retval = 0; /* 0 is the Unfiled category */ LOG(g_message("e_pilot_add_category_if_possible\n")); for(i=0; i<PILOT_MAX_CATEGORIES; i++){ @@ -70,8 +70,8 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ the PalmOS doesn't let 0-length strings for categories */ if(strlen(category->name[i]) == 0){ - int cat_to_add_len; - int desktopUniqueID; + gint cat_to_add_len; + gint desktopUniqueID; cat_to_add_len = strlen(cat_to_add); retval = i; @@ -95,7 +95,7 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ /* find a desktop id that is not in use between 128 and 255 */ for (desktopUniqueID = 128; desktopUniqueID <= 255; desktopUniqueID++) { - int found = 0; + gint found = 0; for(j=0; j<PILOT_MAX_CATEGORIES; j++){ if (category->ID[i] == desktopUniqueID) { found = 1; @@ -126,15 +126,15 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ /* *conversion from an evolution category to a palm category */ -void e_pilot_local_category_to_remote(int * pilotCategory, ECalComponent *comp, struct CategoryAppInfo *category) +void e_pilot_local_category_to_remote(gint * pilotCategory, ECalComponent *comp, struct CategoryAppInfo *category) { GSList *c_list = NULL; - char * category_string; - int i; + gchar * category_string; + gint i; e_cal_component_get_categories_list (comp, &c_list); if (c_list) { /* list != 0, so at least 1 category is assigned */ - category_string = e_pilot_utf8_to_pchar((const char *)c_list->data); + category_string = e_pilot_utf8_to_pchar((const gchar *)c_list->data); if (c_list->next != 0) { LOG (g_message ("Note: item has more categories in evolution, first chosen")); } @@ -162,9 +162,9 @@ void e_pilot_local_category_to_remote(int * pilotCategory, ECalComponent *comp, /* *conversion from a palm category to an evolution category */ -void e_pilot_remote_category_to_local(int pilotCategory, ECalComponent *comp, struct CategoryAppInfo *category) +void e_pilot_remote_category_to_local(gint pilotCategory, ECalComponent *comp, struct CategoryAppInfo *category) { - char *category_string = NULL; + gchar *category_string = NULL; if (pilotCategory != 0) { /* pda has category assigned */ @@ -206,17 +206,17 @@ void e_pilot_remote_category_to_local(int pilotCategory, ECalComponent *comp, st } } -static char * -build_setup_path (const char *path, const char *key) +static gchar * +build_setup_path (const gchar *path, const gchar *key) { return g_strconcat ("/apps/evolution/conduit", "/", path, "/", key, NULL); } gboolean -e_pilot_setup_get_bool (const char *path, const char *key, gboolean def) +e_pilot_setup_get_bool (const gchar *path, const gchar *key, gboolean def) { gboolean res = def; - char *full_path; + gchar *full_path; GConfValue *value; GConfClient *gconf; @@ -241,10 +241,10 @@ e_pilot_setup_get_bool (const char *path, const char *key, gboolean def) } void -e_pilot_setup_set_bool (const char *path, const char *key, gboolean value) +e_pilot_setup_set_bool (const gchar *path, const gchar *key, gboolean value) { GError *error = NULL; - char *full_path; + gchar *full_path; GConfClient *gconf; g_return_if_fail (path != NULL); @@ -264,11 +264,11 @@ e_pilot_setup_set_bool (const char *path, const char *key, gboolean value) } } -int -e_pilot_setup_get_int (const char *path, const char *key, int def) +gint +e_pilot_setup_get_int (const gchar *path, const gchar *key, gint def) { - int res = def; - char *full_path; + gint res = def; + gchar *full_path; GConfValue *value; GConfClient *gconf; @@ -293,10 +293,10 @@ e_pilot_setup_get_int (const char *path, const char *key, int def) } void -e_pilot_setup_set_int (const char *path, const char *key, int value) +e_pilot_setup_set_int (const gchar *path, const gchar *key, gint value) { GError *error = NULL; - char *full_path; + gchar *full_path; GConfClient *gconf; g_return_if_fail (path != NULL); @@ -316,11 +316,11 @@ e_pilot_setup_set_int (const char *path, const char *key, int value) } } -char * -e_pilot_setup_get_string (const char *path, const char *key, const char *def) +gchar * +e_pilot_setup_get_string (const gchar *path, const gchar *key, const gchar *def) { - char *res = g_strdup (def); - char *full_path; + gchar *res = g_strdup (def); + gchar *full_path; GConfValue *value; GConfClient *gconf; @@ -347,10 +347,10 @@ e_pilot_setup_get_string (const char *path, const char *key, const char *def) } void -e_pilot_setup_set_string (const char *path, const char *key, const char *value) +e_pilot_setup_set_string (const gchar *path, const gchar *key, const gchar *value) { GError *error = NULL; - char *full_path; + gchar *full_path; GConfClient *gconf; g_return_if_fail (path != NULL); diff --git a/calendar/conduits/common/libecalendar-common-conduit.h b/calendar/conduits/common/libecalendar-common-conduit.h index aab5a58b56..8110fc5094 100644 --- a/calendar/conduits/common/libecalendar-common-conduit.h +++ b/calendar/conduits/common/libecalendar-common-conduit.h @@ -25,13 +25,13 @@ #define PILOT_MAX_CATEGORIES 16 -int e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *category); -void e_pilot_local_category_to_remote(int * pilotCategory, ECalComponent *comp, struct CategoryAppInfo *category); -void e_pilot_remote_category_to_local(int pilotCategory, ECalComponent *comp, struct CategoryAppInfo *category); +gint e_pilot_add_category_if_possible(gchar *cat_to_add, struct CategoryAppInfo *category); +void e_pilot_local_category_to_remote(gint * pilotCategory, ECalComponent *comp, struct CategoryAppInfo *category); +void e_pilot_remote_category_to_local(gint pilotCategory, ECalComponent *comp, struct CategoryAppInfo *category); -gboolean e_pilot_setup_get_bool (const char *path, const char *key, gboolean def); -void e_pilot_setup_set_bool (const char *path, const char *key, gboolean value); -int e_pilot_setup_get_int (const char *path, const char *key, int def); -void e_pilot_setup_set_int (const char *path, const char *key, int value); -char *e_pilot_setup_get_string (const char *path, const char *key, const char *def); -void e_pilot_setup_set_string (const char *path, const char *key, const char *value); +gboolean e_pilot_setup_get_bool (const gchar *path, const gchar *key, gboolean def); +void e_pilot_setup_set_bool (const gchar *path, const gchar *key, gboolean value); +gint e_pilot_setup_get_int (const gchar *path, const gchar *key, gint def); +void e_pilot_setup_set_int (const gchar *path, const gchar *key, gint value); +gchar *e_pilot_setup_get_string (const gchar *path, const gchar *key, const gchar *def); +void e_pilot_setup_set_string (const gchar *path, const gchar *key, const gchar *value); diff --git a/calendar/conduits/memo/memo-conduit.c b/calendar/conduits/memo/memo-conduit.c index 61e5c852e3..1d32917760 100644 --- a/calendar/conduits/memo/memo-conduit.c +++ b/calendar/conduits/memo/memo-conduit.c @@ -86,7 +86,7 @@ struct _EMemoLocalRecord { struct Memo *memo; }; -int lastDesktopUniqueID; +gint lastDesktopUniqueID; static void memoconduit_destroy_record (EMemoLocalRecord *local) @@ -297,10 +297,10 @@ e_memo_context_destroy (EMemoConduitContext *ctxt) } /* Debug routines */ -static char * +static gchar * print_local (EMemoLocalRecord *local) { - static char buff[ 64 ]; + static gchar buff[ 64 ]; if (local == NULL) { sprintf (buff, "[NULL]"); @@ -317,9 +317,9 @@ print_local (EMemoLocalRecord *local) return ""; } -static char *print_remote (GnomePilotRecord *remote) +static gchar *print_remote (GnomePilotRecord *remote) { - static char buff[ 64 ]; + static gchar buff[ 64 ]; struct Memo memo; #ifdef PILOT_LINK_0_12 pi_buffer_t *buffer; @@ -377,7 +377,7 @@ get_default_timezone (void) { EConfigListener *listener; icaltimezone *timezone = NULL; - char *location; + gchar *location; listener = e_config_listener_new (); @@ -396,10 +396,10 @@ get_default_timezone (void) return timezone; } -static char * +static gchar * map_name (EMemoConduitContext *ctxt) { - char *filename; + gchar *filename; filename = g_strdup_printf ("%s/.evolution/memos/local/system/pilot-map-memo-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id); @@ -413,7 +413,7 @@ next_changed_item (EMemoConduitContext *ctxt, GList *changes) GList *l; for (l = changes; l != NULL; l = l->next) { - const char *uid; + const gchar *uid; ccc = l->data; @@ -426,7 +426,7 @@ next_changed_item (EMemoConduitContext *ctxt, GList *changes) } static void -compute_status (EMemoConduitContext *ctxt, EMemoLocalRecord *local, const char *uid) +compute_status (EMemoConduitContext *ctxt, EMemoLocalRecord *local, const gchar *uid) { ECalChange *ccc; @@ -461,7 +461,7 @@ local_record_to_pilot_record (EMemoLocalRecord *local, #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #else - static char record[0xffff]; + static gchar record[0xffff]; #endif memset(&p, 0, sizeof (p)); @@ -494,7 +494,7 @@ local_record_to_pilot_record (EMemoLocalRecord *local, pi_buffer_free(buffer); #else - p.record = (unsigned char *)record; + p.record = (guchar *)record; p.length = pack_Memo (local->memo, p.record, 0xffff); #endif return p; @@ -506,7 +506,7 @@ local_record_to_pilot_record (EMemoLocalRecord *local, static void local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoConduitContext *ctxt) { - const char *uid; + const gchar *uid; GSList *d_list = NULL; ECalComponentText *description; ECalComponentClassification classif; @@ -537,9 +537,9 @@ local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoCondu struct Memo memo; pi_buffer_t * record; #else - char record[0xffff]; + gchar record[0xffff]; #endif - int cat = 0; + gint cat = 0; #ifdef PILOT_LINK_0_12 record = pi_buffer_new(DLP_BUF_SIZE); @@ -602,7 +602,7 @@ local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoCondu static void local_record_from_uid (EMemoLocalRecord *local, - const char *uid, + const gchar *uid, EMemoConduitContext *ctxt) { ECalComponent *comp; @@ -648,8 +648,8 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, struct Memo memo; struct icaltimetype now; icaltimezone *utc_zone; - char *txt, *txt2, *txt3; - int i; + gchar *txt, *txt2, *txt3; + gint i; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #endif @@ -694,7 +694,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, e_cal_component_set_comment_list (comp, NULL); e_cal_component_set_summary(comp, NULL); } else { - int idxToUse = -1, ntext = strlen(memo.text); + gint idxToUse = -1, ntext = strlen(memo.text); gboolean foundNL = FALSE; GSList l; ECalComponentText text, sumText; @@ -755,8 +755,8 @@ static void check_for_slow_setting (GnomePilotConduit *c, EMemoConduitContext *ctxt) { GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c); - int map_count; - const char *uri; + gint map_count; + const gchar *uri; /* If there are no objects or objects but no log */ map_count = g_hash_table_size (ctxt->map->pid_map); @@ -787,9 +787,9 @@ pre_sync (GnomePilotConduit *conduit, { GnomePilotConduitSyncAbs *abs_conduit; GList *l; - int len; - unsigned char *buf; - char *filename, *change_id; + gint len; + guchar *buf; + gchar *filename, *change_id; icalcomponent *icalcomp; gint num_records, add_records = 0, mod_records = 0, del_records = 0; #ifdef PILOT_LINK_0_12 @@ -851,7 +851,7 @@ pre_sync (GnomePilotConduit *conduit, for (l = ctxt->changed; l != NULL; l = l->next) { ECalChange *ccc = l->data; - const char *uid; + const gchar *uid; e_cal_component_get_uid (ccc->comp, &uid); if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) { @@ -895,9 +895,9 @@ pre_sync (GnomePilotConduit *conduit, DLP_BUF_SIZE, buffer); #else - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0, - (unsigned char *)buf, 0xffff); + (guchar *)buf, 0xffff); #endif if (len < 0) { WARN (_("Could not read pilot's Memo application block")); @@ -934,15 +934,15 @@ post_sync (GnomePilotConduit *conduit, { GList *changed; gchar *filename, *change_id; - unsigned char *buf; - int dlpRetVal, len; + guchar *buf; + gint dlpRetVal, len; - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = pack_MemoAppInfo (&(ctxt->ai), buf, 0xffff); dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, - (unsigned char *)buf, len); + (guchar *)buf, len); g_free (buf); @@ -984,7 +984,7 @@ set_pilot_id (GnomePilotConduitSyncAbs *conduit, guint32 ID, EMemoConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ( "set_pilot_id: setting to %d\n", ID )); @@ -999,7 +999,7 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, EMemoLocalRecord *local, EMemoConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ( "set_status_cleared: clearing status\n" )); @@ -1015,7 +1015,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, EMemoConduitContext *ctxt) { static GList *comps, *iterator; - static int count; + static gint count; GList *unused; g_return_val_if_fail (local != NULL, -1); @@ -1075,7 +1075,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, EMemoConduitContext *ctxt) { static GList *iterator; - static int count; + static gint count; GList *unused; g_return_val_if_fail (local != NULL, 0); @@ -1138,7 +1138,7 @@ compare (GnomePilotConduitSyncAbs *conduit, { /* used by the quick compare */ GnomePilotRecord local_pilot; - int retval = 0; + gint retval = 0; LOG (g_message ("compare: local=%s remote=%s...\n", print_local (local), print_remote (remote))); @@ -1166,8 +1166,8 @@ add_record (GnomePilotConduitSyncAbs *conduit, EMemoConduitContext *ctxt) { ECalComponent *comp; - char *uid; - int retval = 0; + gchar *uid; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1196,7 +1196,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, EMemoConduitContext *ctxt) { ECalComponent *new_comp; - int retval = 0; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1219,7 +1219,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, EMemoLocalRecord *local, EMemoConduitContext *ctxt) { - const char *uid; + const gchar *uid; g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (local->comp != NULL, -1); @@ -1241,8 +1241,8 @@ archive_record (GnomePilotConduitSyncAbs *conduit, gboolean archive, EMemoConduitContext *ctxt) { - const char *uid; - int retval = 0; + const gchar *uid; + gint retval = 0; g_return_val_if_fail (local != NULL, -1); @@ -1260,7 +1260,7 @@ match (GnomePilotConduitSyncAbs *conduit, EMemoLocalRecord **local, EMemoConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ("match: looking for local copy of %s\n", print_remote (remote))); diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c index 3a684e0751..1ced6acfa3 100644 --- a/calendar/conduits/todo/todo-conduit.c +++ b/calendar/conduits/todo/todo-conduit.c @@ -88,7 +88,7 @@ struct _EToDoLocalRecord { struct ToDo *todo; }; -int lastDesktopUniqueID; +gint lastDesktopUniqueID; static void todoconduit_destroy_record (EToDoLocalRecord *local) @@ -361,10 +361,10 @@ e_todo_context_destroy (EToDoConduitContext *ctxt) } /* Debug routines */ -static char * +static gchar * print_local (EToDoLocalRecord *local) { - static char buff[ 4096 ]; + static gchar buff[ 4096 ]; if (local == NULL) { sprintf (buff, "[NULL]"); @@ -388,9 +388,9 @@ print_local (EToDoLocalRecord *local) return ""; } -static char *print_remote (GnomePilotRecord *remote) +static gchar *print_remote (GnomePilotRecord *remote) { - static char buff[ 4096 ]; + static gchar buff[ 4096 ]; struct ToDo todo; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; @@ -432,10 +432,10 @@ static char *print_remote (GnomePilotRecord *remote) return buff; } -static char * -auth_func_cb (ECal *ecal, const char* prompt, const char *key, gpointer user_data) +static gchar * +auth_func_cb (ECal *ecal, const gchar * prompt, const gchar *key, gpointer user_data) { - char *password; + gchar *password; ESource *source; const gchar *auth_domain, *component_name; @@ -452,9 +452,9 @@ auth_func_cb (ECal *ecal, const char* prompt, const char *key, gpointer user_dat static int start_calendar_server (EToDoConduitContext *ctxt) { - char *str_uri = NULL; - char *pass_key = NULL; - int retval = 0; + gchar *str_uri = NULL; + gchar *pass_key = NULL; + gint retval = 0; g_return_val_if_fail (ctxt != NULL, -2); if (ctxt->cfg->source) { @@ -492,7 +492,7 @@ start_calendar_server (EToDoConduitContext *ctxt) /* Utility routines */ static icaltimezone * -get_timezone (ECal *client, const char *tzid) +get_timezone (ECal *client, const gchar *tzid) { icaltimezone *timezone = NULL; @@ -508,7 +508,7 @@ get_default_timezone (void) { EConfigListener *listener; icaltimezone *timezone = NULL; - char *location; + gchar *location; listener = e_config_listener_new (); @@ -527,10 +527,10 @@ get_default_timezone (void) return timezone; } -static char * +static gchar * map_name (EToDoConduitContext *ctxt) { - char *filename; + gchar *filename; filename = g_strdup_printf ("%s/.evolution/tasks/local/system/pilot-map-todo-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id); @@ -554,7 +554,7 @@ next_changed_item (EToDoConduitContext *ctxt, GList *changes) GList *l; for (l = changes; l != NULL; l = l->next) { - const char *uid; + const gchar *uid; ccc = l->data; @@ -567,7 +567,7 @@ next_changed_item (EToDoConduitContext *ctxt, GList *changes) } static void -compute_status (EToDoConduitContext *ctxt, EToDoLocalRecord *local, const char *uid) +compute_status (EToDoConduitContext *ctxt, EToDoLocalRecord *local, const gchar *uid) { ECalChange *ccc; @@ -602,7 +602,7 @@ local_record_to_pilot_record (EToDoLocalRecord *local, #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #else - static char record[0xffff]; + static gchar record[0xffff]; #endif g_assert (local->comp != NULL); @@ -635,7 +635,7 @@ local_record_to_pilot_record (EToDoLocalRecord *local, pi_buffer_free(buffer); #else - p.record = (unsigned char *)record; + p.record = (guchar *)record; p.length = pack_ToDo (local->todo, p.record, 0xffff); #endif return p; @@ -647,8 +647,8 @@ local_record_to_pilot_record (EToDoLocalRecord *local, static void local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoConduitContext *ctxt) { - const char *uid; - int *priority; + const gchar *uid; + gint *priority; icalproperty_status status; ECalComponentText summary; GSList *d_list = NULL; @@ -674,7 +674,7 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu /* Don't overwrite the category */ if (local->local.ID != 0) { - int cat = 0; + gint cat = 0; #ifdef PILOT_LINK_0_12 pi_buffer_t * record; record = pi_buffer_new(DLP_BUF_SIZE); @@ -683,7 +683,7 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu return; } #else - char record[0xffff]; + gchar record[0xffff]; #endif if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, @@ -771,7 +771,7 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu static void local_record_from_uid (EToDoLocalRecord *local, - const char *uid, + const gchar *uid, EToDoConduitContext *ctxt) { ECalComponent *comp; @@ -819,8 +819,8 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, ECalComponentDateTime dt = {NULL, icaltimezone_get_tzid (timezone)}; struct icaltimetype due, now; icaltimezone *utc_zone; - int priority; - char *txt; + gint priority; + gchar *txt; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #endif @@ -882,20 +882,20 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, } if (todo.complete) { - int percent = 100; + gint percent = 100; e_cal_component_set_completed (comp, &now); e_cal_component_set_percent (comp, &percent); e_cal_component_set_status (comp, ICAL_STATUS_COMPLETED); } else { - int *percent = NULL; + gint *percent = NULL; icalproperty_status status; e_cal_component_set_completed (comp, NULL); e_cal_component_get_percent (comp, &percent); if (percent == NULL || *percent == 100) { - int p = 0; + gint p = 0; e_cal_component_set_percent (comp, &p); } if (percent != NULL) @@ -948,8 +948,8 @@ static void check_for_slow_setting (GnomePilotConduit *c, EToDoConduitContext *ctxt) { GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c); - int map_count; - const char *uri; + gint map_count; + const gchar *uri; /* If there are no objects or objects but no log */ map_count = g_hash_table_size (ctxt->map->pid_map); @@ -980,9 +980,9 @@ pre_sync (GnomePilotConduit *conduit, { GnomePilotConduitSyncAbs *abs_conduit; GList *l; - int len; - unsigned char *buf; - char *filename, *change_id; + gint len; + guchar *buf; + gchar *filename, *change_id; icalcomponent *icalcomp; gint num_records, add_records = 0, mod_records = 0, del_records = 0; #ifdef PILOT_LINK_0_12 @@ -1041,7 +1041,7 @@ pre_sync (GnomePilotConduit *conduit, for (l = ctxt->changed; l != NULL; l = l->next) { ECalChange *ccc = l->data; - const char *uid; + const gchar *uid; e_cal_component_get_uid (ccc->comp, &uid); if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) { @@ -1084,9 +1084,9 @@ pre_sync (GnomePilotConduit *conduit, DLP_BUF_SIZE, buffer); #else - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0, - (unsigned char *)buf, 0xffff); + (guchar *)buf, 0xffff); #endif if (len < 0) { WARN (_("Could not read pilot's ToDo application block")); @@ -1121,15 +1121,15 @@ post_sync (GnomePilotConduit *conduit, { GList *changed; gchar *filename, *change_id; - unsigned char *buf; - int dlpRetVal, len; + guchar *buf; + gint dlpRetVal, len; - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = pack_ToDoAppInfo (&(ctxt->ai), buf, 0xffff); dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, - (unsigned char *)buf, len); + (guchar *)buf, len); g_free (buf); @@ -1171,7 +1171,7 @@ set_pilot_id (GnomePilotConduitSyncAbs *conduit, guint32 ID, EToDoConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ( "set_pilot_id: setting to %d\n", ID )); @@ -1186,7 +1186,7 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, EToDoLocalRecord *local, EToDoConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ( "set_status_cleared: clearing status\n" )); @@ -1202,7 +1202,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, EToDoConduitContext *ctxt) { static GList *comps, *iterator; - static int count; + static gint count; GList *unused; g_return_val_if_fail (local != NULL, -1); @@ -1261,7 +1261,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, EToDoConduitContext *ctxt) { static GList *iterator; - static int count; + static gint count; GList *unused; g_return_val_if_fail (local != NULL, 0); @@ -1323,7 +1323,7 @@ compare (GnomePilotConduitSyncAbs *conduit, { /* used by the quick compare */ GnomePilotRecord local_pilot; - int retval = 0; + gint retval = 0; LOG (g_message ("compare: local=%s remote=%s...\n", print_local (local), print_remote (remote))); @@ -1351,8 +1351,8 @@ add_record (GnomePilotConduitSyncAbs *conduit, EToDoConduitContext *ctxt) { ECalComponent *comp; - char *uid; - int retval = 0; + gchar *uid; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1382,7 +1382,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, EToDoConduitContext *ctxt) { ECalComponent *new_comp; - int retval = 0; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1405,7 +1405,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, EToDoLocalRecord *local, EToDoConduitContext *ctxt) { - const char *uid; + const gchar *uid; g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (local->comp != NULL, -1); @@ -1427,8 +1427,8 @@ archive_record (GnomePilotConduitSyncAbs *conduit, gboolean archive, EToDoConduitContext *ctxt) { - const char *uid; - int retval = 0; + const gchar *uid; + gint retval = 0; g_return_val_if_fail (local != NULL, -1); @@ -1446,7 +1446,7 @@ match (GnomePilotConduitSyncAbs *conduit, EToDoLocalRecord **local, EToDoConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ("match: looking for local copy of %s\n", print_remote (remote))); |