Revision: 332 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=332&view=rev Author: eht16 Date: 2008-12-06 17:25:41 +0000 (Sat, 06 Dec 2008)
Log Message: ----------- Fix some trivial compiler warnings.
Modified Paths: -------------- trunk/geanydebug/src/gdb-io-envir.c trunk/geanydebug/src/gdb-io-frame.c trunk/geanydebug/src/gdb-io-priv.h trunk/geanydebug/src/gdb-io-run.c trunk/geanydebug/src/gdb-io-stack.c trunk/geanydebug/src/gdb-lex.c trunk/geanydebug/src/gdb-ui-break.c trunk/geanydebug/src/gdb-ui-frame.c trunk/geanydebug/src/gdb-ui-main.c trunk/geanydebug/src/geanydebug.c
Modified: trunk/geanydebug/src/gdb-io-envir.c =================================================================== --- trunk/geanydebug/src/gdb-io-envir.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-io-envir.c 2008-12-06 17:25:41 UTC (rev 332) @@ -60,8 +60,7 @@ args = unquote(list[i] + 1); if (args && *args) { - g_strstrip(args); - gchar *quote = strchr(args, '"'); + gchar *quote = strchr(g_strstrip(args), '"'); if (quote) { memmove(args, quote + 1, strlen(quote));
Modified: trunk/geanydebug/src/gdb-io-frame.c =================================================================== --- trunk/geanydebug/src/gdb-io-frame.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-io-frame.c 2008-12-06 17:25:41 UTC (rev 332) @@ -102,9 +102,10 @@ static void var_deleted(gint seq, gchar ** list, gchar * resp) { + GdbVar *lv; gdbio_pop_seq(seq); (*which_index)++; - GdbVar *lv = g_slist_nth_data(*which_list, *which_index); + lv = g_slist_nth_data(*which_list, *which_index); if (lv) { create_var(lv->name); @@ -215,7 +216,7 @@ HSTR(v->hash, name); if (name) { - GdbVar *lv = g_new0(GdbVar, 1); + lv = g_new0(GdbVar, 1); lv->name = g_strdup(name); *which_list = g_slist_append(*which_list, lv); }
Modified: trunk/geanydebug/src/gdb-io-priv.h =================================================================== --- trunk/geanydebug/src/gdb-io-priv.h 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-io-priv.h 2008-12-06 17:25:41 UTC (rev 332) @@ -1,6 +1,6 @@
/* - * gdb-io-priv.h - private header for GDB wrapper library. + * gdb-io-priv.h - private header for GDB wrapper library. * * See the file "gdb-io.h" for license information. * @@ -50,9 +50,9 @@ expands to: gchar *somevar = gdblx_lookup_string ( myhash, "somevar" ); */ -#define HSTR(hash,token) gchar* token = gdblx_lookup_string(hash, #token""); -#define HTAB(hash,token) GHashTable* token = gdblx_lookup_hash(hash, #token""); -#define HLST(hash,token) GSList* token = gdblx_lookup_list(hash, #token""); +#define HSTR(hash,token) gchar* token = gdblx_lookup_string(hash, #token"") +#define HTAB(hash,token) GHashTable* token = gdblx_lookup_hash(hash, #token"") +#define HLST(hash,token) GSList* token = gdblx_lookup_list(hash, #token"")
#if 0
Modified: trunk/geanydebug/src/gdb-io-run.c =================================================================== --- trunk/geanydebug/src/gdb-io-run.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-io-run.c 2008-12-06 17:25:41 UTC (rev 332) @@ -135,15 +135,16 @@ gdbio_error_func(gchar * fmt, ...) { va_list args; + gchar *msg; va_start(args, fmt); - gchar *msg = g_strdup_vprintf(fmt, args); + msg = g_strdup_vprintf(fmt, args); if (gdbio_setup.error_func) { gdbio_setup.error_func(g_strstrip(msg)); } else { - g_printerr(msg); + g_printerr("%s", msg); } g_free(msg); va_end(args); @@ -154,15 +155,16 @@ gdbio_info_func(gchar * fmt, ...) { va_list args; + gchar *msg; va_start(args, fmt); - gchar *msg = g_strdup_vprintf(fmt, args); + msg = g_strdup_vprintf(fmt, args); if (gdbio_setup.info_func) { gdbio_setup.info_func(g_strstrip(msg)); } else { - g_printerr(msg); + g_printerr("%s", msg); } g_free(msg); va_end(args);
Modified: trunk/geanydebug/src/gdb-io-stack.c =================================================================== --- trunk/geanydebug/src/gdb-io-stack.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-io-stack.c 2008-12-06 17:25:41 UTC (rev 332) @@ -72,13 +72,13 @@ fullname = file; if (level && addr && func && fullname && line) { - GdbFrameInfo *frame = g_new0(GdbFrameInfo, 1); - strncpy(frame->level, level, sizeof(frame->level) - 1); - strncpy(frame->addr, addr, sizeof(frame->addr) - 1); - strncpy(frame->line, line, sizeof(frame->line) - 1); - frame->func = g_strdup(func); - frame->filename = g_strdup(fullname); - frame_list = g_slist_append(frame_list, frame); + GdbFrameInfo *frame_info = g_new0(GdbFrameInfo, 1); + strncpy(frame_info->level, level, sizeof(frame_info->level) - 1); + strncpy(frame_info->addr, addr, sizeof(frame_info->addr) - 1); + strncpy(frame_info->line, line, sizeof(frame_info->line) - 1); + frame_info->func = g_strdup(func); + frame_info->filename = g_strdup(fullname); + frame_list = g_slist_append(frame_list, frame_info); } } }
Modified: trunk/geanydebug/src/gdb-lex.c =================================================================== --- trunk/geanydebug/src/gdb-lex.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-lex.c 2008-12-06 17:25:41 UTC (rev 332) @@ -125,8 +125,8 @@ GHashTable *rv = new_hash(); GdbLxValue *top = new_value(vt_HASH, rv); GQueue *queue = g_queue_new(); + GTokenType tt; g_queue_push_head(queue, top); - GTokenType tt; if (!scanner) { scanner = init_scanner(); @@ -247,7 +247,7 @@ case vt_LIST: { indent("["); - g_slist_foreach(v->list, dump_list_cb, GINT_TO_POINTER(depth) + 1); + g_slist_foreach(v->list, dump_list_cb, GINT_TO_POINTER(depth + 1)); indent("]"); break; } @@ -279,7 +279,7 @@ { if (h) { - g_hash_table_foreach(h, dump_rec_cb, GINT_TO_POINTER(depth) + 1); + g_hash_table_foreach(h, dump_rec_cb, GINT_TO_POINTER(depth + 1)); } else {
Modified: trunk/geanydebug/src/gdb-ui-break.c =================================================================== --- trunk/geanydebug/src/gdb-ui-break.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-ui-break.c 2008-12-06 17:25:41 UTC (rev 332) @@ -87,7 +87,7 @@ GtkWidget *dlg = gtk_message_dialog_new(GTK_WINDOW(gdbui_setup.main_window), GTK_MESSAGE_QUESTION, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_BUTTONS_YES_NO, question); + GTK_BUTTONS_YES_NO, "%s", question); gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_YES); rv = gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_YES; gtk_widget_destroy(dlg); @@ -351,7 +351,7 @@ GtkWidget *listview; GtkTreeViewColumn *column; GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); - GtkTreeSelection *select; + GtkTreeSelection *selection; GtkWidget *scroll; GtkWidget *delete_btn; GtkWidget *add_btn; @@ -475,9 +475,9 @@ bcCond, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column);
- select = gtk_tree_view_get_selection(GTK_TREE_VIEW(listview)); - gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(break_select_cb), &bpd); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listview)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); + g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(break_select_cb), &bpd);
bpd.dlg = gdbui_new_dialog(is_watchlist ? _("Watchpoints") : _("Breakpoints"));
Modified: trunk/geanydebug/src/gdb-ui-frame.c =================================================================== --- trunk/geanydebug/src/gdb-ui-frame.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-ui-frame.c 2008-12-06 17:25:41 UTC (rev 332) @@ -191,7 +191,7 @@ GtkWidget *scroll; GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); GtkListStore *store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); - GtkTreeSelection *select; + GtkTreeSelection *selection; gint width, height; gint len = g_slist_length((GSList *) list); const GSList *p; @@ -208,9 +208,9 @@ column = gtk_tree_view_column_new_with_attributes(title, renderer, "text", 0, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column);
- select = gtk_tree_view_get_selection(GTK_TREE_VIEW(listview)); - gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(locals_select_cb), vw); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listview)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); + g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(locals_select_cb), vw);
gtk_cell_renderer_get_size(GTK_CELL_RENDERER(renderer), listview, NULL, NULL, NULL, &width, &height); @@ -269,10 +269,10 @@ GtkWidget *btn; gchar *heading; gchar *value = fmt_val(obj->value); + gint resp;
heading = g_strdup_printf("\n%s %s = %s\n", strval(obj->type), strval(obj->name), value); g_free(value); - gint resp; memset(&vw, 0, sizeof(vw)); vw.dlg = gdbui_new_dialog(_("Object info")); vbox = GTK_BOX(GTK_DIALOG(vw.dlg)->vbox); @@ -413,9 +413,10 @@ gtk_tree_model_get(model, &iter, fcFrame, &frame, -1); if (frame) { + gchar *path; sw->frame = frame; strncpy(current_frame, frame->level, sizeof(current_frame) - 1); - gchar *path = g_strdup_printf("%s:%s", frame->filename, frame->line); + path = g_strdup_printf("%s:%s", frame->filename, frame->line); monospace(sw->path_label, NULL, path); g_free(path);
@@ -495,7 +496,7 @@ GtkWidget *listview; GtkTreeViewColumn *column; GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); - GtkTreeSelection *select; + GtkTreeSelection *selection; GtkWidget *scroll; GtkWidget *locals_btn; gint most_args = 0; @@ -570,9 +571,9 @@ gtk_misc_set_alignment(GTK_MISC(sw.args_label), 0.0f, 0.0f); gtk_misc_set_alignment(GTK_MISC(sw.code_label), 0.0f, 0.0f);
- select = gtk_tree_view_get_selection(GTK_TREE_VIEW(listview)); - gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE); - g_signal_connect(G_OBJECT(select), "changed", G_CALLBACK(stack_select_cb), &sw); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listview)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); + g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(stack_select_cb), &sw);
sw.dlg = gdbui_new_dialog(_("Stack trace"));
Modified: trunk/geanydebug/src/gdb-ui-main.c =================================================================== --- trunk/geanydebug/src/gdb-ui-main.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/gdb-ui-main.c 2008-12-06 17:25:41 UTC (rev 332) @@ -227,7 +227,7 @@ GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, _("Program received signal:"));
- gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dlg), msg); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dlg), "%s", msg); gtk_window_set_title(GTK_WINDOW(dlg), "debugger"); gtk_window_set_keep_above(GTK_WINDOW(dlg), TRUE); gtk_dialog_run(GTK_DIALOG(dlg)); @@ -270,7 +270,7 @@ } else { - g_printerr(msg); + g_printerr("%s", msg); } }
@@ -297,7 +297,7 @@ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("Error:")); gtk_window_set_keep_above(GTK_WINDOW(dlg), TRUE); gtk_window_set_title(GTK_WINDOW(dlg), "debugger"); - gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dlg), msg); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dlg), "%s", msg); gtk_window_set_keep_above(GTK_WINDOW(dlg), TRUE); gtk_dialog_run(GTK_DIALOG(dlg)); gtk_widget_destroy(dlg);
Modified: trunk/geanydebug/src/geanydebug.c =================================================================== --- trunk/geanydebug/src/geanydebug.c 2008-12-06 17:22:58 UTC (rev 331) +++ trunk/geanydebug/src/geanydebug.c 2008-12-06 17:25:41 UTC (rev 332) @@ -75,7 +75,7 @@ info_message_cb(const gchar * msg) { show_compwin(); - msgwin_compiler_add(COLOR_BLACK, msg); + msgwin_compiler_add(COLOR_BLACK, "%s", msg); }
@@ -83,7 +83,7 @@ warn_message_cb(const gchar * msg) { show_compwin(); - msgwin_compiler_add(COLOR_RED, msg); + msgwin_compiler_add(COLOR_RED, "%s", msg); }
@@ -111,7 +111,7 @@ gint line_num = gdbio_atoi((gchar *) line) - 1; if (reason) { - msgwin_compiler_add(COLOR_BLUE, reason); + msgwin_compiler_add(COLOR_BLUE, "%s", reason); } doc = document_open_file(filename, FALSE, NULL, NULL); if (!(doc && doc->is_valid))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org