# HG changeset patch # User Richard Laager # Date 1138916083 0 # Node ID a0a4b44239e80fd53546059150d600f630d1cea0 # Parent e347b2217b1b3800710e77e2f24c2e4123c662e4 [gaim-migrate @ 15468] I was reading the gettext man page and it pointed out that it should be typed as const char *, but it's char * to avoid warnings in code predating ANSI C. So, for the heck of it, I changed added a cast in internal.h. As it turns out, there was a lot of code that relied on this. In the interest of type safety, I've fixed all the warnings. I feel this improved a number of function signatures (in terms of typing clarity). Flame me if you object. committer: Tailor Script diff -r e347b2217b1b -r a0a4b44239e8 plugins/ChangeLog.API --- a/plugins/ChangeLog.API Thu Feb 02 20:03:17 2006 +0000 +++ b/plugins/ChangeLog.API Thu Feb 02 21:34:43 2006 +0000 @@ -97,6 +97,18 @@ * Plugins: Depedencies are now honored when unloading plugins. * gaim_markup_extract_info_field(): Added format_cb parameter. * gaim_str_to_time(): Added support for parsing the MM/DD/YYYY format. + * gaim_plugin_action_new(): label is now const char * + * gaim_plugin_pref_new_with_name(): name is now const char * + * gaim_plugin_pref_new_with_label(): label is now const char * + * gaim_plugin_pref_new_with_name_and_label(): name and label are + now const char * + * gaim_plugin_pref_set_name(): name is now const char * + * gaim_plugin_pref_get_name(): return type is now const char * + * gaim_plugin_pref_set_label(): label is now const char * + * gaim_plugin_pref_get_label(): return type is now const char * + * gaim_plugin_pref_add_choice(): label is now const char * + * struct proto_chat_entry: label is now const char * + * struct proto_chat_entry: identifier is now const char * Removed: * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute @@ -254,6 +266,7 @@ * gaim_date_format_long() * gaim_date_format_full() * gaim_time_format() + * gaim_plugin_action_free() Signals - Changed: (See the Doxygen docs for details on all signals.) * Signal propagation now stops after a handler returns a non-NULL value. diff -r e347b2217b1b -r a0a4b44239e8 plugins/gevolution/gevo-util.c --- a/plugins/gevolution/gevo-util.c Thu Feb 02 20:03:17 2006 +0000 +++ b/plugins/gevolution/gevo-util.c Thu Feb 02 21:34:43 2006 +0000 @@ -61,7 +61,7 @@ if (gaim_get_blist()->root == NULL) { - list = g_list_append(list, _("Buddies")); + list = g_list_append(list, (gpointer)_("Buddies")); } else { diff -r e347b2217b1b -r a0a4b44239e8 plugins/perl/common/PluginPref.xs --- a/plugins/perl/common/PluginPref.xs Thu Feb 02 20:03:17 2006 +0000 +++ b/plugins/perl/common/PluginPref.xs Thu Feb 02 21:34:43 2006 +0000 @@ -32,7 +32,7 @@ void gaim_plugin_pref_add_choice(pref, label, choice) Gaim::PluginPref pref - char *label + const char *label gpointer choice void @@ -56,7 +56,7 @@ XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListItem"))); } -char * +const char * gaim_plugin_pref_get_label(pref) Gaim::PluginPref pref @@ -68,7 +68,7 @@ gaim_plugin_pref_get_max_length(pref) Gaim::PluginPref pref -char * +const char * gaim_plugin_pref_get_name(pref) Gaim::PluginPref pref @@ -82,20 +82,20 @@ Gaim::PluginPref gaim_plugin_pref_new_with_label(class, label) - char *label + const char *label C_ARGS: label Gaim::PluginPref gaim_plugin_pref_new_with_name(class, name) - char *name + const char *name C_ARGS: name Gaim::PluginPref gaim_plugin_pref_new_with_name_and_label(class, name, label) - char *name - char *label + const char *name + const char *label C_ARGS: name, label @@ -108,7 +108,7 @@ void gaim_plugin_pref_set_label(pref, label) Gaim::PluginPref pref - char *label + const char *label void gaim_plugin_pref_set_masked(pref, mask) @@ -123,7 +123,7 @@ void gaim_plugin_pref_set_name(pref, name) Gaim::PluginPref pref - char *name + const char *name void gaim_plugin_pref_set_type(pref, type) diff -r e347b2217b1b -r a0a4b44239e8 src/conversation.c --- a/src/conversation.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/conversation.c Thu Feb 02 21:34:43 2006 +0000 @@ -174,7 +174,7 @@ if (err < 0) { const char *who; - char *msg; + const char *msg; who = gaim_conversation_get_name(conv); @@ -182,9 +182,9 @@ msg = _("Unable to send message: The message is too large."); if (!gaim_conv_present_error(who, account, msg)) { - msg = g_strdup_printf(_("Unable to send message to %s."), who); - gaim_notify_error(gc, NULL, msg, _("The message is too large.")); - g_free(msg); + char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who); + gaim_notify_error(gc, NULL, msg2, _("The message is too large.")); + g_free(msg2); } } else if (err == -ENOTCONN) { @@ -195,9 +195,9 @@ msg = _("Unable to send message."); if (!gaim_conv_present_error(who, account, msg)) { - msg = g_strdup_printf(_("Unable to send message to %s."), who); - gaim_notify_error(gc, NULL, msg, NULL); - g_free(msg); + char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who); + gaim_notify_error(gc, NULL, msg2, NULL); + g_free(msg2); } } } diff -r e347b2217b1b -r a0a4b44239e8 src/gtkblist.c --- a/src/gtkblist.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/gtkblist.c Thu Feb 02 21:34:43 2006 +0000 @@ -122,7 +122,7 @@ static void gaim_gtk_blist_selection_changed(GtkTreeSelection *selection, gpointer data); static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node); static char *gaim_get_tooltip_text(GaimBlistNode *node, gboolean full); -static char *item_factory_translate_func (const char *path, gpointer func_data); +static const char *item_factory_translate_func (const char *path, gpointer func_data); static gboolean get_iter_from_node(GaimBlistNode *node, GtkTreeIter *iter); static void redo_buddy_list(GaimBuddyList *list, gboolean remove); static void gaim_gtk_blist_collapse_contact_cb(GtkWidget *w, GaimBlistNode *node); @@ -600,7 +600,7 @@ } gtk_label_set_mnemonic_widget(GTK_LABEL(label), input); gaim_set_accessible_label(input, label); - g_object_set_data(G_OBJECT(input), "identifier", pce->identifier); + g_object_set_data(G_OBJECT(input), "identifier", (gpointer)pce->identifier); g_object_set_data(G_OBJECT(input), "is_spin", GINT_TO_POINTER(pce->is_int)); g_object_set_data(G_OBJECT(input), "required", GINT_TO_POINTER(pce->required)); data->entries = g_list_append(data->entries, input); @@ -3363,7 +3363,7 @@ NUM_TARGETS }; -static char * +static const char * item_factory_translate_func (const char *path, gpointer func_data) { return _((char *)path); @@ -3612,7 +3612,7 @@ g_object_unref(accel_group); gtkblist->ift = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "", accel_group); gtk_item_factory_set_translate_func(gtkblist->ift, - item_factory_translate_func, + (GtkTranslateFunc)item_factory_translate_func, NULL, NULL); gtk_item_factory_create_items(gtkblist->ift, sizeof(blist_menu) / sizeof(*blist_menu), blist_menu, NULL); @@ -4745,7 +4745,7 @@ } gtk_label_set_mnemonic_widget(GTK_LABEL(label), input); gaim_set_accessible_label(input, label); - g_object_set_data(G_OBJECT(input), "identifier", pce->identifier); + g_object_set_data(G_OBJECT(input), "identifier", (gpointer)pce->identifier); g_object_set_data(G_OBJECT(input), "is_spin", GINT_TO_POINTER(pce->is_int)); g_object_set_data(G_OBJECT(input), "required", GINT_TO_POINTER(pce->required)); data->entries = g_list_append(data->entries, input); @@ -5467,6 +5467,8 @@ G_CALLBACK(plugin_act), action); g_object_set_data(G_OBJECT(menuitem), "plugin_action", action); gtk_widget_show(menuitem); + + gaim_plugin_action_free(action); } else gaim_separator(menu); diff -r e347b2217b1b -r a0a4b44239e8 src/gtkconv.c --- a/src/gtkconv.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/gtkconv.c Thu Feb 02 21:34:43 2006 +0000 @@ -160,7 +160,7 @@ static void gaim_gtkconv_updated(GaimConversation *conv, GaimConvUpdateType type); static void gtkconv_set_unseen(GaimGtkConversation *gtkconv, GaimUnseenState state); static void update_typing_icon(GaimGtkConversation *gtkconv); -static char *item_factory_translate_func (const char *path, gpointer func_data); +static const char *item_factory_translate_func (const char *path, gpointer func_data); gboolean gaim_gtkconv_has_focus(GaimConversation *conv); static void gaim_gtkconv_custom_smiley_allocated(GdkPixbufLoader *loader, gpointer user_data); static void gaim_gtkconv_custom_smiley_closed(GdkPixbufLoader *loader, gpointer user_data); @@ -2687,10 +2687,10 @@ static const int menu_item_count = sizeof(menu_items) / sizeof(*menu_items); -static char * +static const char * item_factory_translate_func (const char *path, gpointer func_data) { - return _((char *)path); + return _(path); } static void @@ -2758,7 +2758,7 @@ gtk_item_factory_new(GTK_TYPE_MENU_BAR, "
", accel_group); gtk_item_factory_set_translate_func(win->menu.item_factory, - item_factory_translate_func, + (GtkTranslateFunc)item_factory_translate_func, NULL, NULL); gtk_item_factory_create_items(win->menu.item_factory, menu_item_count, @@ -2912,7 +2912,8 @@ GaimGtkWindow *gtkwin; GaimConvIm *im = NULL; GaimConversation *conv = gtkconv->active_conv; - char *stock_id, *tooltip; + char *stock_id; + const char *tooltip; gtkwin = gtkconv->win; diff -r e347b2217b1b -r a0a4b44239e8 src/gtkft.c --- a/src/gtkft.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/gtkft.c Thu Feb 02 21:34:43 2006 +0000 @@ -973,7 +973,7 @@ { GaimGtkXferUiData *data; GdkPixbuf *pixbuf; - gchar *status; + const gchar *status; g_return_if_fail(dialog != NULL); g_return_if_fail(xfer != NULL); diff -r e347b2217b1b -r a0a4b44239e8 src/gtkpluginpref.c --- a/src/gtkpluginpref.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/gtkpluginpref.c Thu Feb 02 21:34:43 2006 +0000 @@ -72,8 +72,9 @@ static void make_string_pref(GtkWidget *parent, GaimPluginPref *pref, GtkSizeGroup *sg) { - GtkWidget *hbox, *gtk_label, *entry; - gchar *pref_name, *pref_label; + GtkWidget *box, *gtk_label, *entry; + const gchar *pref_name; + const gchar *pref_label; GaimStringFormatType format; pref_name = gaim_plugin_pref_get_name(pref); @@ -93,14 +94,18 @@ break; case GAIM_PLUGIN_PREF_NONE: default: - hbox = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE); - gtk_widget_show(hbox); - gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0); + if (format == GAIM_STRING_FORMAT_TYPE_NONE) + box = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE); + else + box = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); + + gtk_widget_show(box); + gtk_box_pack_start(GTK_BOX(parent), box, FALSE, FALSE, 0); gtk_label = gtk_label_new_with_mnemonic(pref_label); gtk_misc_set_alignment(GTK_MISC(gtk_label), 0, 0.5); gtk_widget_show(gtk_label); - gtk_box_pack_start(GTK_BOX(hbox), gtk_label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(box), gtk_label, FALSE, FALSE, 0); if(sg) gtk_size_group_add_widget(sg, gtk_label); @@ -121,11 +126,23 @@ (gpointer)pref_name); gtk_label_set_mnemonic_widget(GTK_LABEL(gtk_label), entry); gtk_widget_show(entry); - gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(box), entry, FALSE, FALSE, 0); } else { - GtkWidget *imhtml, *toolbar, *frame; + GtkWidget *hbox; + GtkWidget *spacer; + GtkWidget *imhtml; + GtkWidget *toolbar; + GtkWidget *frame; + + hbox = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE); + gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); + gtk_widget_show(hbox); + + spacer = gtk_label_new(" "); + gtk_box_pack_start(GTK_BOX(hbox), spacer, FALSE, FALSE, 0); + gtk_widget_show(spacer); frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar); if (!(format & GAIM_STRING_FORMAT_TYPE_HTML)) @@ -135,7 +152,7 @@ (format & GAIM_STRING_FORMAT_TYPE_MULTILINE) ? 0 : GTK_IMHTML_NO_NEWLINE); gtk_label_set_mnemonic_widget(GTK_LABEL(gtk_label), imhtml); gtk_widget_show_all(frame); - g_object_set_data(G_OBJECT(imhtml), "pref-key", pref_name); + g_object_set_data(G_OBJECT(imhtml), "pref-key", (gpointer)pref_name); g_signal_connect(G_OBJECT(gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml))), "changed", G_CALLBACK(imhtml_cb), imhtml); g_signal_connect(G_OBJECT(imhtml), @@ -150,7 +167,8 @@ static void make_int_pref(GtkWidget *parent, GaimPluginPref *pref, GtkSizeGroup *sg) { GtkWidget *gtk_label; - gchar *pref_name, *pref_label; + const gchar *pref_name; + const gchar *pref_label; gint max, min; pref_name = gaim_plugin_pref_get_name(pref); @@ -188,11 +206,9 @@ GtkWidget * gaim_gtk_plugin_pref_create_frame(GaimPluginPrefFrame *frame) { - GaimPluginPref *pref; GtkWidget *ret, *parent; GtkSizeGroup *sg; GList *pp; - gchar *name, *label; g_return_val_if_fail(frame, NULL); @@ -206,10 +222,10 @@ pp != NULL; pp = pp->next) { - pref = (GaimPluginPref *)pp->data; + GaimPluginPref *pref = (GaimPluginPref *)pp->data; - name = gaim_plugin_pref_get_name(pref); - label = gaim_plugin_pref_get_label(pref); + const char *name = gaim_plugin_pref_get_name(pref); + const char *label = gaim_plugin_pref_get_label(pref); if(name == NULL) { if(label == NULL) diff -r e347b2217b1b -r a0a4b44239e8 src/gtkprefs.c --- a/src/gtkprefs.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/gtkprefs.c Thu Feb 02 21:34:43 2006 +0000 @@ -1159,14 +1159,14 @@ int i = 0; char *browser_setting = (char *)gaim_prefs_get_string("/gaim/gtk/browsers/browser"); - browsers = g_list_prepend(browsers, "custom"); - browsers = g_list_prepend(browsers, _("Manual")); + browsers = g_list_prepend(browsers, (gpointer)"custom"); + browsers = g_list_prepend(browsers, (gpointer)_("Manual")); for (i = 0; i < num_possible_browsers; i++) { if (gaim_program_is_valid(possible_browsers[i].command)) { browsers = g_list_prepend(browsers, possible_browsers[i].command); - browsers = g_list_prepend(browsers, _(possible_browsers[i].name)); + browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name)); if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) browser_setting = NULL; } diff -r e347b2217b1b -r a0a4b44239e8 src/internal.h --- a/src/internal.h Thu Feb 02 20:03:17 2006 +0000 +++ b/src/internal.h Thu Feb 02 21:34:43 2006 +0000 @@ -43,7 +43,7 @@ #ifdef ENABLE_NLS # include # include -# define _(x) gettext(x) +# define _(x) ((const char *)gettext(x)) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else @@ -53,9 +53,9 @@ # include # define N_(String) (String) # ifndef _ -# define _(x) (x) +# define _(x) ((const char *)x) # endif -# define ngettext(Singular, Plural, Number) ((Number == 1) ? (Singular) : (Plural)) +# define ngettext(Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural)) #endif #ifdef HAVE_ENDIAN_H diff -r e347b2217b1b -r a0a4b44239e8 src/log.c --- a/src/log.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/log.c Thu Feb 02 21:34:43 2006 +0000 @@ -134,7 +134,7 @@ gaim_str_strip_char(ret, '\r'); return ret; } - return (_("The logger has no read function")); + return g_strdup(_("The logger has no read function")); } int gaim_log_get_size(GaimLog *log) diff -r e347b2217b1b -r a0a4b44239e8 src/plugin.c --- a/src/plugin.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/plugin.c Thu Feb 02 21:34:43 2006 +0000 @@ -1545,12 +1545,21 @@ GaimPluginAction * -gaim_plugin_action_new(char* label, void (*callback)(GaimPluginAction *)) +gaim_plugin_action_new(const char* label, void (*callback)(GaimPluginAction *)) { GaimPluginAction *act = g_new0(GaimPluginAction, 1); - act->label = label; + act->label = g_strdup(label); act->callback = callback; return act; } + +void +gaim_plugin_action_free(GaimPluginAction *action) +{ + g_return_if_fail(action != NULL); + + g_free(action->label); + g_free(action); +} diff -r e347b2217b1b -r a0a4b44239e8 src/plugin.h --- a/src/plugin.h Thu Feb 02 20:03:17 2006 +0000 +++ b/src/plugin.h Thu Feb 02 21:34:43 2006 +0000 @@ -627,8 +627,18 @@ /** * Allocates and returns a new GaimPluginAction. + * + * @param label The description of the action to show to the user. + * @param callback The callback to call when the user selects this action. */ -GaimPluginAction *gaim_plugin_action_new(char* label, void (*callback)(GaimPluginAction *)); +GaimPluginAction *gaim_plugin_action_new(const char* label, void (*callback)(GaimPluginAction *)); + +/** + * Frees a GaimPluginAction + * + * @param action The GaimPluginAction to free. + */ +void gaim_plugin_action_free(GaimPluginAction *action); #ifdef __cplusplus } diff -r e347b2217b1b -r a0a4b44239e8 src/pluginpref.c --- a/src/pluginpref.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/pluginpref.c Thu Feb 02 21:34:43 2006 +0000 @@ -102,7 +102,7 @@ } GaimPluginPref * -gaim_plugin_pref_new_with_name(char *name) { +gaim_plugin_pref_new_with_name(const char *name) { GaimPluginPref *pref; g_return_val_if_fail(name, NULL); @@ -114,7 +114,7 @@ } GaimPluginPref * -gaim_plugin_pref_new_with_label(char *label) { +gaim_plugin_pref_new_with_label(const char *label) { GaimPluginPref *pref; g_return_val_if_fail(label, NULL); @@ -126,7 +126,7 @@ } GaimPluginPref * -gaim_plugin_pref_new_with_name_and_label(char *name, char *label) { +gaim_plugin_pref_new_with_name_and_label(const char *name, const char *label) { GaimPluginPref *pref; g_return_val_if_fail(name, NULL); @@ -162,7 +162,7 @@ } void -gaim_plugin_pref_set_name(GaimPluginPref *pref, char *name) { +gaim_plugin_pref_set_name(GaimPluginPref *pref, const char *name) { g_return_if_fail(pref); g_return_if_fail(name); @@ -172,7 +172,7 @@ pref->name = g_strdup(name); } -char * +const char * gaim_plugin_pref_get_name(GaimPluginPref *pref) { g_return_val_if_fail(pref, NULL); @@ -180,7 +180,7 @@ } void -gaim_plugin_pref_set_label(GaimPluginPref *pref, char *label) { +gaim_plugin_pref_set_label(GaimPluginPref *pref, const char *label) { g_return_if_fail(pref); g_return_if_fail(label); @@ -190,7 +190,7 @@ pref->label = g_strdup(label); } -char * +const char * gaim_plugin_pref_get_label(GaimPluginPref *pref) { g_return_val_if_fail(pref, NULL); @@ -251,12 +251,12 @@ } void -gaim_plugin_pref_add_choice(GaimPluginPref *pref, char *label, gpointer choice) { +gaim_plugin_pref_add_choice(GaimPluginPref *pref, const char *label, gpointer choice) { g_return_if_fail(pref); g_return_if_fail(label); g_return_if_fail(choice); - pref->choices = g_list_append(pref->choices, label); + pref->choices = g_list_append(pref->choices, (gpointer)label); pref->choices = g_list_append(pref->choices, choice); } diff -r e347b2217b1b -r a0a4b44239e8 src/pluginpref.h --- a/src/pluginpref.h Thu Feb 02 20:03:17 2006 +0000 +++ b/src/pluginpref.h Thu Feb 02 21:34:43 2006 +0000 @@ -91,7 +91,7 @@ * @param name The name of the pref * @return a new GaimPluginPref */ -GaimPluginPref *gaim_plugin_pref_new_with_name(char *name); +GaimPluginPref *gaim_plugin_pref_new_with_name(const char *name); /** * Create a new plugin preference with label @@ -99,7 +99,7 @@ * @param label The label to be displayed * @return a new GaimPluginPref */ -GaimPluginPref *gaim_plugin_pref_new_with_label(char *label); +GaimPluginPref *gaim_plugin_pref_new_with_label(const char *label); /** * Create a new plugin preference with name and label @@ -108,7 +108,7 @@ * @param label The label to be displayed * @return a new GaimPluginPref */ -GaimPluginPref *gaim_plugin_pref_new_with_name_and_label(char *name, char *label); +GaimPluginPref *gaim_plugin_pref_new_with_name_and_label(const char *name, const char *label); /** * Destroy a plugin preference @@ -123,7 +123,7 @@ * @param pref The plugin pref * @param name The name of the pref */ -void gaim_plugin_pref_set_name(GaimPluginPref *pref, char *name); +void gaim_plugin_pref_set_name(GaimPluginPref *pref, const char *name); /** * Get a plugin pref name @@ -131,7 +131,7 @@ * @param pref The plugin pref * @return The name of the pref */ -char *gaim_plugin_pref_get_name(GaimPluginPref *pref); +const char *gaim_plugin_pref_get_name(GaimPluginPref *pref); /** * Set a plugin pref label @@ -139,7 +139,7 @@ * @param pref The plugin pref * @param label The label for the plugin pref */ -void gaim_plugin_pref_set_label(GaimPluginPref *pref, char *label); +void gaim_plugin_pref_set_label(GaimPluginPref *pref, const char *label); /** * Get a plugin pref label @@ -147,7 +147,7 @@ * @param pref The plugin pref * @return The label for the plugin pref */ -char *gaim_plugin_pref_get_label(GaimPluginPref *pref); +const char *gaim_plugin_pref_get_label(GaimPluginPref *pref); /** * Set the bounds for an integer pref @@ -190,7 +190,7 @@ * @param label The label for the choice * @param choice A gpointer of the choice */ -void gaim_plugin_pref_add_choice(GaimPluginPref *pref, char *label, gpointer choice); +void gaim_plugin_pref_add_choice(GaimPluginPref *pref, const char *label, gpointer choice); /** * Get the choices for a choices plugin pref diff -r e347b2217b1b -r a0a4b44239e8 src/protocols/oscar/aim.h --- a/src/protocols/oscar/aim.h Thu Feb 02 20:03:17 2006 +0000 +++ b/src/protocols/oscar/aim.h Thu Feb 02 21:34:43 2006 +0000 @@ -1297,8 +1297,8 @@ /* 0x0011 */ faim_export int aim_ssi_modbegin(aim_session_t *sess); /* 0x0012 */ faim_export int aim_ssi_modend(aim_session_t *sess); /* 0x0014 */ faim_export int aim_ssi_sendauth(aim_session_t *sess, char *sn, char *msg); -/* 0x0018 */ faim_export int aim_ssi_sendauthrequest(aim_session_t *sess, char *sn, char *msg); -/* 0x001a */ faim_export int aim_ssi_sendauthreply(aim_session_t *sess, char *sn, fu8_t reply, char *msg); +/* 0x0018 */ faim_export int aim_ssi_sendauthrequest(aim_session_t *sess, char *sn, const char *msg); +/* 0x001a */ faim_export int aim_ssi_sendauthreply(aim_session_t *sess, char *sn, fu8_t reply, const char *msg); /* Client functions for retrieving SSI data */ faim_export struct aim_ssi_item *aim_ssi_itemlist_find(struct aim_ssi_item *list, fu16_t gid, fu16_t bid); diff -r e347b2217b1b -r a0a4b44239e8 src/protocols/oscar/ssi.c --- a/src/protocols/oscar/ssi.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/protocols/oscar/ssi.c Thu Feb 02 21:34:43 2006 +0000 @@ -1759,7 +1759,7 @@ * granted, denied, or dropped. * */ -faim_export int aim_ssi_sendauthrequest(aim_session_t *sess, char *sn, char *msg) +faim_export int aim_ssi_sendauthrequest(aim_session_t *sess, char *sn, const char *msg) { aim_conn_t *conn; aim_frame_t *fr; @@ -1837,7 +1837,7 @@ * if reply=0x01 then grant * */ -faim_export int aim_ssi_sendauthreply(aim_session_t *sess, char *sn, fu8_t reply, char *msg) +faim_export int aim_ssi_sendauthreply(aim_session_t *sess, char *sn, fu8_t reply, const char *msg) { aim_conn_t *conn; aim_frame_t *fr; diff -r e347b2217b1b -r a0a4b44239e8 src/protocols/sametime/sametime.c --- a/src/protocols/sametime/sametime.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/protocols/sametime/sametime.c Thu Feb 02 21:34:43 2006 +0000 @@ -1394,7 +1394,7 @@ gpointer info) { struct mwGaimPluginData *pd; GaimConnection *gc; - char *msg = NULL; + const char *msg = NULL; pd = mwSession_getClientData(session); gc = pd->gc; @@ -1448,9 +1448,9 @@ case mwSession_STOPPING: if(GPOINTER_TO_UINT(info) & ERR_FAILURE) { - msg = mwError(GPOINTER_TO_UINT(info)); - gaim_connection_error(gc, msg); - g_free(msg); + char *err = mwError(GPOINTER_TO_UINT(info)); + gaim_connection_error(gc, err); + g_free(err); } break; @@ -1528,6 +1528,7 @@ GaimConnection *gc; GaimAccount *acct; const char *host; + const char *msg; char *prim; gc = session_to_gc(session); @@ -1538,9 +1539,9 @@ host = gaim_account_get_string(acct, MW_KEY_HOST, NULL); - prim = _("A Sametime administrator has issued the following announcement" + msg = _("A Sametime administrator has issued the following announcement" " on server %s"); - prim = g_strdup_printf(prim, NSTR(host)); + prim = g_strdup_printf(msg, NSTR(host)); gaim_notify_message(gc, GAIM_NOTIFY_MSG_INFO, _("Sametime Administrator Announcement"), @@ -3150,8 +3151,8 @@ static char *user_supports_text(struct mwServiceAware *srvc, const char *who) { - char *feat[] = {NULL, NULL, NULL, NULL, NULL}; - char **f = feat; + const char *feat[] = {NULL, NULL, NULL, NULL, NULL}; + const char **f = feat; if(user_supports(srvc, who, mwAttribute_AV_PREFS_SET)) { gboolean mic, speak, video; @@ -3168,7 +3169,7 @@ if(user_supports(srvc, who, mwAttribute_FILE_TRANSFER)) *f++ = _("File Transfer"); - return (*feat)? g_strjoinv(", ", feat): NULL; + return (*feat)? g_strjoinv(", ", (char **)feat): NULL; /* jenni loves siege */ } @@ -3288,7 +3289,9 @@ GaimAccount *acct; GaimConnection *gc; - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg1; g_return_if_fail(buddy != NULL); @@ -3312,14 +3315,14 @@ msgA = _("Create conference with user"); msgB = _("Please enter a topic for the new conference, and an invitation" " message to be sent to %s"); - msgB = g_strdup_printf(msgB, buddy->name); + msg1 = g_strdup_printf(msgB, buddy->name); gaim_request_fields(gc, _("New Conference"), - msgA, msgB, fields, + msgA, msg1, fields, _("Create"), G_CALLBACK(conf_create_prompt_join), _("Cancel"), G_CALLBACK(conf_create_prompt_cancel), buddy); - g_free(msgB); + g_free(msg1); } @@ -3365,7 +3368,9 @@ GaimAccount *acct; GaimConnection *gc; - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg; acct = buddy->account; g_return_if_fail(acct != NULL); @@ -3395,14 +3400,14 @@ msgB = _("Select a conference from the list below to send an invite to" " user %s. Select \"Create New Conference\" if you'd like to" " create a new conference to invite this user to."); - msgB = g_strdup_printf(msgB, buddy->name); + msg = g_strdup_printf(msgB, buddy->name); gaim_request_fields(gc, _("Invite to Conference"), - msgA, msgB, fields, + msgA, msg, fields, _("Invite"), G_CALLBACK(conf_select_prompt_invite), _("Cancel"), G_CALLBACK(conf_select_prompt_cancel), buddy); - g_free(msgB); + g_free(msg); } @@ -3515,13 +3520,14 @@ static void prompt_host(GaimConnection *gc) { GaimAccount *acct; + const char *msgA; char *msg; acct = gaim_connection_get_account(gc); - msg = _("No host or IP address has been configured for the" + msgA = _("No host or IP address has been configured for the" " Meanwhile account %s. Please enter one below to" " continue logging in."); - msg = g_strdup_printf(msg, NSTR(gaim_account_get_username(acct))); + msg = g_strdup_printf(msgA, NSTR(gaim_account_get_username(acct))); gaim_request_input(gc, _("Meanwhile Connection Setup"), _("No Sametime Community Server Specified"), msg, @@ -4151,7 +4157,9 @@ static void multi_resolved_query(struct mwResolveResult *result, GaimConnection *gc) { GList *l; - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg; GaimNotifySearchResults *sres; GaimNotifySearchColumn *scol; @@ -4189,12 +4197,12 @@ msgB = _("The identifier '%s' may possibly refer to any of the following" " users. Please select the correct user from the list below to" " add them to your buddy list."); - msgB = g_strdup_printf(msgB, result->name); + msg = g_strdup_printf(msgB, result->name); gaim_notify_searchresults(gc, _("Select User"), - msgA, msgB, sres, notify_close, NULL); - - g_free(msgB); + msgA, msg, sres, notify_close, NULL); + + g_free(msg); } @@ -4257,18 +4265,20 @@ if(res && res->name) { /* compose and display an error message */ - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg; msgA = _("Unable to add user: user not found"); msgB = _("The identifier '%s' did not match any users in your" " Sametime community. This entry has been removed from" " your buddy list."); - msgB = g_strdup_printf(msgB, NSTR(res->name)); - - gaim_notify_error(gc, _("Unable to add user"), msgA, msgB); - - g_free(msgB); + msg = g_strdup_printf(msgB, NSTR(res->name)); + + gaim_notify_error(gc, _("Unable to add user"), msgA, msg); + + g_free(msg); } } @@ -5116,15 +5126,17 @@ /* collision checking */ group = gaim_find_group(name); if(group) { - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg; msgA = _("Unable to add group: group exists"); msgB = _("A group named '%s' already exists in your buddy list."); - msgB = g_strdup_printf(msgB, name); - - gaim_notify_error(gc, _("Unable to add group"), msgA, msgB); - - g_free(msgB); + msg = g_strdup_printf(msgB, name); + + gaim_notify_error(gc, _("Unable to add group"), msgA, msg); + + g_free(msg); return; } @@ -5170,7 +5182,9 @@ GaimRequestFieldGroup *g; GaimRequestField *f; GList *l; - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg; GaimConnection *gc = pd->gc; @@ -5199,15 +5213,15 @@ msgB = _("The identifier '%s' may possibly refer to any of the following" " Notes Address Book groups. Please select the correct group from" " the list below to add it to your buddy list."); - msgB = g_strdup_printf(msgB, result->name); + msg = g_strdup_printf(msgB, result->name); gaim_request_fields(gc, _("Select Notes Address Book"), - msgA, msgB, fields, + msgA, msg, fields, _("Add Group"), G_CALLBACK(remote_group_multi_cb), _("Cancel"), G_CALLBACK(remote_group_multi_cleanup), pd); - g_free(msgB); + g_free(msg); } @@ -5239,17 +5253,19 @@ } if(res && res->name) { - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg; msgA = _("Unable to add group: group not found"); msgB = _("The identifier '%s' did not match any Notes Address Book" " groups in your Sametime community."); - msgB = g_strdup_printf(msgB, res->name); - - gaim_notify_error(gc, _("Unable to add group"), msgA, msgB); - - g_free(msgB); + msg = g_strdup_printf(msgB, res->name); + + gaim_notify_error(gc, _("Unable to add group"), msgA, msg); + + g_free(msg); } } @@ -5279,7 +5295,8 @@ static void remote_group_action(GaimPluginAction *act) { GaimConnection *gc; - const char *msgA, *msgB; + const char *msgA; + const char *msgB; gc = act->context; @@ -5298,7 +5315,10 @@ static void search_notify(struct mwResolveResult *result, GaimConnection *gc) { GList *l; - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg1; + char *msg2; GaimNotifySearchResults *sres; GaimNotifySearchColumn *scol; @@ -5334,14 +5354,14 @@ " users. You may add these users to your buddy list or send them" " messages with the action buttons below."); - msgA = g_strdup_printf(msgA, result->name); - msgB = g_strdup_printf(msgB, result->name); + msg1 = g_strdup_printf(msgA, result->name); + msg2 = g_strdup_printf(msgB, result->name); gaim_notify_searchresults(gc, _("Search Results"), - msgA, msgB, sres, notify_close, NULL); - - g_free(msgA); - g_free(msgB); + msg1, msg2, sres, notify_close, NULL); + + g_free(msg1); + g_free(msg2); } @@ -5358,15 +5378,18 @@ search_notify(res, gc); } else { - char *msgA, *msgB; + const char *msgA; + const char *msgB; + char *msg; + msgA = _("No matches"); msgB = _("The identifier '%s' did not match and users in your" " Sametime community."); - msgB = g_strdup_printf(msgB, NSTR(res->name)); - - gaim_notify_error(gc, _("No Matches"), msgA, msgB); - - g_free(msgB); + msg = g_strdup_printf(msgB, NSTR(res->name)); + + gaim_notify_error(gc, _("No Matches"), msgA, msg); + + g_free(msg); } } @@ -5396,7 +5419,8 @@ static void search_action(GaimPluginAction *act) { GaimConnection *gc; - const char *msgA, *msgB; + const char *msgA; + const char *msgB; gc = act->context; diff -r e347b2217b1b -r a0a4b44239e8 src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Thu Feb 02 20:03:17 2006 +0000 +++ b/src/protocols/yahoo/yahoo.c Thu Feb 02 21:34:43 2006 +0000 @@ -2651,7 +2651,7 @@ *ne = emblems[3]; } -static char *yahoo_get_status_string(enum yahoo_status a) +static const char *yahoo_get_status_string(enum yahoo_status a) { switch (a) { case YAHOO_STATUS_BRB: @@ -2788,7 +2788,9 @@ void yahoo_tooltip_text(GaimBuddy *b, GString *str, gboolean full) { YahooFriend *f; - char *escaped, *status = NULL, *presence = NULL; + char *escaped; + char *status = NULL; + const char *presence = NULL; f = yahoo_friend_find(b->account->gc, b->name); if (!f) diff -r e347b2217b1b -r a0a4b44239e8 src/prpl.h --- a/src/prpl.h Thu Feb 02 20:03:17 2006 +0000 +++ b/src/prpl.h Thu Feb 02 21:34:43 2006 +0000 @@ -74,8 +74,8 @@ #include "whiteboard.h" struct proto_chat_entry { - char *label; - char *identifier; + const char *label; + const char *identifier; gboolean required; gboolean is_int; int min;