From: Richard Kettlewell Date: Sun, 15 Jun 2008 14:39:54 +0000 (+0100) Subject: Build fixes for GCC 4.1 X-Git-Tag: 4.1~15^2~6 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/abf99697b4852dc7c29006d17b8fd35fe66b5cc3?hp=ad492e00c1aafb3aec7c385e1a29606742433e7e Build fixes for GCC 4.1 --- diff --git a/disobedience/added.c b/disobedience/added.c index 146872f..ce747c4 100644 --- a/disobedience/added.c +++ b/disobedience/added.c @@ -28,10 +28,10 @@ * with a valid and unique @c id field. This function fakes it. */ static void added_completed(void attribute((unused)) *v, - const char *error, + const char *err, int nvec, char **vec) { - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); return; } /* Convert the vector result to a queue linked list */ diff --git a/disobedience/choose-search.c b/disobedience/choose-search.c index 77ad813..6d78f6b 100644 --- a/disobedience/choose-search.c +++ b/disobedience/choose-search.c @@ -264,11 +264,11 @@ static void choose_make_visible(const char attribute((unused)) *event, /** @brief Called with search results */ static void choose_search_completed(void attribute((unused)) *v, - const char *error, + const char *err, int nvec, char **vec) { //fprintf(stderr, "choose_search_completed\n"); - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); return; } choose_searching = 0; diff --git a/disobedience/choose.c b/disobedience/choose.c index c054162..8433288 100644 --- a/disobedience/choose.c +++ b/disobedience/choose.c @@ -337,29 +337,29 @@ skip: } static void choose_dirs_completed(void *v, - const char *error, + const char *err, int nvec, char **vec) { - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); return; } choose_populate(v, nvec, vec, 0/*!isfile*/); } static void choose_files_completed(void *v, - const char *error, + const char *err, int nvec, char **vec) { - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); return; } choose_populate(v, nvec, vec, 1/*isfile*/); } void choose_play_completed(void attribute((unused)) *v, - const char *error) { - if(error) - popup_protocol_error(0, error); + const char *err) { + if(err) + popup_protocol_error(0, err); } static void choose_state_toggled diff --git a/disobedience/control.c b/disobedience/control.c index 3ccd7c2..50aaebe 100644 --- a/disobedience/control.c +++ b/disobedience/control.c @@ -391,9 +391,9 @@ static void icon_changed(const char attribute((unused)) *event, } static void icon_action_completed(void attribute((unused)) *v, - const char *error) { - if(error) - popup_protocol_error(0, error); + const char *err) { + if(err) + popup_protocol_error(0, err); } static void clicked_icon(GtkButton attribute((unused)) *button, @@ -420,11 +420,11 @@ static void toggled_menu(GtkCheckMenuItem attribute((unused)) *menuitem, /** @brief Called when a volume command completes */ static void volume_completed(void attribute((unused)) *v, - const char *error, + const char *err, int attribute((unused)) l, int attribute((unused)) r) { - if(error) - popup_protocol_error(0, error); + if(err) + popup_protocol_error(0, err); /* We don't set the UI's notion of the volume here, it is set from the log * regardless of the reason it changed */ } diff --git a/disobedience/disobedience.c b/disobedience/disobedience.c index 7225bc8..afcd921 100644 --- a/disobedience/disobedience.c +++ b/disobedience/disobedience.c @@ -197,12 +197,12 @@ static void make_toplevel_window(void) { } static void userinfo_rights_completed(void attribute((unused)) *v, - const char *error, + const char *err, const char *value) { rights_type r; - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); r = 0; } else { if(parse_rights(value, &r, 0)) @@ -271,7 +271,7 @@ static gboolean periodic_fast(gpointer attribute((unused)) data) { /** @brief Called when a NOP completes */ static void nop_completed(void attribute((unused)) *v, - const char attribute((unused)) *error) { + const char attribute((unused)) *err) { /* TODO report the error somewhere */ nop_in_flight = 0; } @@ -297,7 +297,7 @@ static gboolean maybe_send_nop(gpointer attribute((unused)) data) { /** @brief Called when a rtp-address command succeeds */ static void got_rtp_address(void attribute((unused)) *v, - const char *error, + const char *err, int attribute((unused)) nvec, char attribute((unused)) **vec) { const int rtp_was_supported = rtp_supported; @@ -305,7 +305,7 @@ static void got_rtp_address(void attribute((unused)) *v, ++suppress_actions; rtp_address_in_flight = 0; - if(error) { + if(err) { /* An error just means that we're not using network play */ rtp_supported = 0; rtp_is_running = 0; diff --git a/disobedience/lookup.c b/disobedience/lookup.c index 51c06bf..9b6a5b5 100644 --- a/disobedience/lookup.c +++ b/disobedience/lookup.c @@ -36,10 +36,10 @@ static void namepart_completed_or_failed(void) { } /** @brief Called when a namepart lookup has completed */ -static void namepart_completed(void *v, const char *error, const char *value) { +static void namepart_completed(void *v, const char *err, const char *value) { D(("namepart_completed")); - if(error) { - gtk_label_set_text(GTK_LABEL(report_label), error); + if(err) { + gtk_label_set_text(GTK_LABEL(report_label), err); value = "?"; } const char *key = v; @@ -49,10 +49,10 @@ static void namepart_completed(void *v, const char *error, const char *value) { } /** @brief Called when a length lookup has completed */ -static void length_completed(void *v, const char *error, long l) { +static void length_completed(void *v, const char *err, long l) { D(("length_completed")); - if(error) { - gtk_label_set_text(GTK_LABEL(report_label), error); + if(err) { + gtk_label_set_text(GTK_LABEL(report_label), err); l = -1; } const char *key = v; diff --git a/disobedience/menu.c b/disobedience/menu.c index 23bc688..73773dd 100644 --- a/disobedience/menu.c +++ b/disobedience/menu.c @@ -165,7 +165,7 @@ static void manual_popup(gpointer attribute((unused)) callback_data, /** @brief Called when version arrives, displays about... popup */ static void about_popup_got_version(void attribute((unused)) *v, - const char attribute((unused)) *error, + const char attribute((unused)) *err, const char *value) { GtkWidget *w; char *server_version_string; diff --git a/disobedience/properties.c b/disobedience/properties.c index ade23fb..8b46109 100644 --- a/disobedience/properties.c +++ b/disobedience/properties.c @@ -344,9 +344,9 @@ static void set_namepart(struct prefdata *f, const char *value) { } /* Called when we've set a namepart */ -static void set_namepart_completed(void *v, const char *error) { - if(error) - popup_protocol_error(0, error); +static void set_namepart_completed(void *v, const char *err) { + if(err) + popup_protocol_error(0, err); else { struct prefdata *f = v; @@ -377,9 +377,9 @@ static void set_edited_string(struct prefdata *f, const char *value) { } static void set_string_completed(void attribute((unused)) *v, - const char *error) { - if(error) - popup_protocol_error(0, error); + const char *err) { + if(err) + popup_protocol_error(0, err); } static void set_string(struct prefdata *f, const char *value) { @@ -441,8 +441,8 @@ static void prefdata_onerror(struct callbackdata *cbd, } /* Got the value of a pref */ -static void prefdata_completed(void *v, const char *error, const char *value) { - if(error) { +static void prefdata_completed(void *v, const char *err, const char *value) { + if(err) { } else { struct callbackdata *cbd = v; diff --git a/disobedience/queue-generic.c b/disobedience/queue-generic.c index e32cf85..8c7458a 100644 --- a/disobedience/queue-generic.c +++ b/disobedience/queue-generic.c @@ -321,7 +321,6 @@ void ql_new_queue(struct queuelike *ql, for(struct queue_entry *q = newq; q; q = q->next) { const struct newqueue_data *nqd = hash_find(h, q->id); if(!nqd->old) { - GtkTreeIter iter[1]; if(after) { /* Try to insert at the right sort of place */ GtkTreeIter where[1]; diff --git a/disobedience/queue-menu.c b/disobedience/queue-menu.c index fcc34bf..75ddeb6 100644 --- a/disobedience/queue-menu.c +++ b/disobedience/queue-menu.c @@ -81,9 +81,9 @@ int ql_scratch_sensitive(void attribute((unused)) *extra) { } static void ql_scratch_completed(void attribute((unused)) *v, - const char *error) { - if(error) - popup_protocol_error(0, error); + const char *err) { + if(err) + popup_protocol_error(0, err); } void ql_scratch_activate(GtkMenuItem attribute((unused)) *menuitem, @@ -116,9 +116,9 @@ int ql_remove_sensitive(void *extra) { } static void ql_remove_completed(void attribute((unused)) *v, - const char *error) { - if(error) - popup_protocol_error(0, error); + const char *err) { + if(err) + popup_protocol_error(0, err); } static void ql_remove_activate_callback(GtkTreeModel *model, @@ -146,9 +146,9 @@ int ql_play_sensitive(void *extra) { && gtk_tree_selection_count_selected_rows(ql->selection) > 0; } -static void ql_play_completed(void attribute((unused)) *v, const char *error) { - if(error) - popup_protocol_error(0, error); +static void ql_play_completed(void attribute((unused)) *v, const char *err) { + if(err) + popup_protocol_error(0, err); } static void ql_play_activate_callback(GtkTreeModel *model, @@ -186,7 +186,7 @@ gboolean ql_button_release(GtkWidget *widget, } struct tabtype *ql_tabtype(struct queuelike *ql) { - static const struct tabtype ql_tabtype = { + static const struct tabtype queuelike_tabtype = { ql_properties_sensitive, ql_selectall_sensitive, ql_selectnone_sensitive, @@ -197,7 +197,7 @@ struct tabtype *ql_tabtype(struct queuelike *ql) { 0 }; - ql->tabtype = ql_tabtype; + ql->tabtype = queuelike_tabtype; ql->tabtype.extra = ql; return &ql->tabtype; } diff --git a/disobedience/queue.c b/disobedience/queue.c index f298b1f..7dbe563 100644 --- a/disobedience/queue.c +++ b/disobedience/queue.c @@ -75,10 +75,10 @@ static void queue_playing_changed(void) { /** @brief Update the queue itself */ static void queue_completed(void attribute((unused)) *v, - const char *error, + const char *err, struct queue_entry *q) { - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); return; } actual_queue = q; @@ -87,10 +87,10 @@ static void queue_completed(void attribute((unused)) *v, /** @brief Update the playing track */ static void playing_completed(void attribute((unused)) *v, - const char *error, + const char *err, struct queue_entry *q) { - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); return; } actual_playing_track = q; @@ -198,9 +198,9 @@ struct queuelike ql_queue = { static int queue_drag_target = -1; static void queue_move_completed(void attribute((unused)) *v, - const char *error) { - if(error) { - popup_protocol_error(0, error); + const char *err) { + if(err) { + popup_protocol_error(0, err); return; } /* The log should tell us the queue changed so we do no more here */ diff --git a/disobedience/recent.c b/disobedience/recent.c index 49333e7..109ee5a 100644 --- a/disobedience/recent.c +++ b/disobedience/recent.c @@ -23,10 +23,10 @@ /** @brief Update the recently played list */ static void recent_completed(void attribute((unused)) *v, - const char *error, + const char *err, struct queue_entry *q) { - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); return; } /* The recent list is backwards compared to what we wanted */ diff --git a/disobedience/users.c b/disobedience/users.c index bb099f2..60bdef6 100644 --- a/disobedience/users.c +++ b/disobedience/users.c @@ -116,13 +116,13 @@ static int users_find_user(const char *user, * If users_deferred_select is set then that user is selected. */ static void users_got_list(void attribute((unused)) *v, - const char *error, + const char *err, int nvec, char **vec) { int n; GtkTreeIter iter; - if(error) { - popup_protocol_error(0, error); + if(err) { + popup_protocol_error(0, err); return; } /* Present users in alphabetical order */ @@ -436,16 +436,16 @@ static rights_type users_get_rights(void) { /** @brief Called when a user setting has been edited */ static void users_edituser_completed(void attribute((unused)) *v, - const char *error) { - if(error) - popup_submsg(users_window, GTK_MESSAGE_ERROR, error); + const char *err) { + if(err) + popup_submsg(users_window, GTK_MESSAGE_ERROR, err); } /** @brief Called when a new user has been created */ static void users_adduser_completed(void *v, - const char *error) { - if(error) { - popup_submsg(users_window, GTK_MESSAGE_ERROR, error); + const char *err) { + if(err) { + popup_submsg(users_window, GTK_MESSAGE_ERROR, err); mode(ADD); /* Let the user try again */ } else { const struct kvp *const kvp = v; @@ -534,9 +534,9 @@ static void users_apply(GtkButton attribute((unused)) *button, /** @brief Called when a user has been deleted */ static void users_delete_completed(void *v, - const char *error) { - if(error) - popup_submsg(users_window, GTK_MESSAGE_ERROR, error); + const char *err) { + if(err) + popup_submsg(users_window, GTK_MESSAGE_ERROR, err); else { const struct kvp *const kvp = v; const char *const user = kvp_get(kvp, "user"); @@ -572,26 +572,26 @@ static void users_delete(GtkButton attribute((unused)) *button, } static void users_got_email(void attribute((unused)) *v, - const char *error, + const char *err, const char *value) { - if(error) - popup_protocol_error(0, error); + if(err) + popup_protocol_error(0, err); users_email = value; } static void users_got_rights(void attribute((unused)) *v, - const char *error, + const char *err, const char *value) { - if(error) - popup_protocol_error(0, error); + if(err) + popup_protocol_error(0, err); users_rights = value; } static void users_got_password(void attribute((unused)) *v, - const char *error, + const char *err, const char *value) { - if(error) - popup_protocol_error(0, error); + if(err) + popup_protocol_error(0, err); /* TODO if an error occurred gathering user info, we should react in some * different way */ users_password = value;