Branch: refs/heads/master Author: Lex Trotman elextr@gmail.com Committer: Colomban Wendling ban@herbesfolles.org Date: Mon, 04 Mar 2013 16:30:11 UTC Commit: 2160931bd6644441a8db9f76b12bb1fbd5bbacea https://github.com/geany/geany-plugins/commit/2160931bd6644441a8db9f76b12bb1...
Log Message: ----------- Fix various warnings
Modified Paths: -------------- codenav/src/switch_head_impl.c geanyprj/src/sidebar.c gproject/src/gproject-main.c gproject/src/gproject-menu.c treebrowser/src/treebrowser.c
Modified: codenav/src/switch_head_impl.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -219,7 +219,7 @@ GSList* iter_lang = NULL; GSList* iter_ext = NULL; GSList* iter_filename = NULL; - gint i=0; + guint i=0;
gchar* dirname = NULL; gchar* basename = NULL; @@ -570,7 +570,7 @@ on_configure_cell_edited(GtkCellRendererText* text, gchar* arg1, gchar* arg2, gpointer data) { /* TODO !! */ - Column col = (Column)(GPOINTER_TO_INT(data)); + /* Column col = (Column)(GPOINTER_TO_INT(data)); */ log_debug("arg1 == %s, arg2 == %s\n", arg1, arg2); }
Modified: geanyprj/src/sidebar.c 10 files changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -307,7 +307,7 @@ static void prepare_file_view(void) { GtkCellRenderer *text_renderer; GtkTreeViewColumn *column; - GtkTreeSelection *select; + GtkTreeSelection *selection; PangoFontDescription *pfd;
file_store = gtk_list_store_new(FILEVIEW_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING); @@ -330,8 +330,8 @@ static void prepare_file_view(void) pango_font_description_free(pfd);
/* selection handling */ - select = gtk_tree_view_get_selection(GTK_TREE_VIEW(file_view)); - gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(file_view)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
g_signal_connect(G_OBJECT(file_view), "button-release-event", G_CALLBACK(on_button_release), NULL); @@ -347,7 +347,7 @@ static void sidebar_clear(void) gtk_list_store_clear(file_store); }
- +#if 0 static gint mycmp(const gchar *a, const gchar *b) { const gchar *p1 = a; @@ -395,7 +395,7 @@ static gint mycmp(const gchar *a, const gchar *b) return 1; return -1; } - +#endif
static void add_item(gpointer name, G_GNUC_UNUSED gpointer value, gpointer user_data) {
Modified: gproject/src/gproject-main.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -91,7 +91,7 @@ static void on_doc_close(G_GNUC_UNUSED GObject * obj, GeanyDocument * doc,
static void on_build_start(GObject *obj, gpointer user_data) { - gint i; + guint i;
foreach_document(i) {
Modified: gproject/src/gproject-menu.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -122,7 +122,7 @@ static void on_swap_header_source(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_U { gboolean swapped; GSList *elem, *list = NULL; - gint i; + guint i;
foreach_document(i) {
Modified: treebrowser/src/treebrowser.c 47 files changed, 27 insertions(+), 20 deletions(-) =================================================================== @@ -235,7 +235,7 @@ enum static gchar* path_is_in_dir(gchar* src, gchar* find) { - int i = 0; + guint i = 0;
gchar *diffed_path = NULL, *tmp = NULL; gchar **src_segments = NULL, **find_segments = NULL; @@ -436,23 +436,30 @@ enum }
static void -treebrowser_chroot(gchar *directory) +treebrowser_chroot(const gchar *dir) { + gchar *directory; + if (g_str_has_suffix(directory, G_DIR_SEPARATOR_S)) - g_strlcpy(directory, directory, strlen(directory)); + directory = g_strndup(dir, strlen(dir)-1); + else + directory = g_strdup(dir);
gtk_entry_set_text(GTK_ENTRY(addressbar), directory);
if (!directory || strlen(directory) == 0) - directory = G_DIR_SEPARATOR_S; + setptr(directory, g_strdup(G_DIR_SEPARATOR_S));
if (! treebrowser_checkdir(directory)) + { + g_free(directory); return; + }
treebrowser_bookmarks_set_state();
gtk_tree_store_clear(treestore); - setptr(addressbar_last_address, g_strdup(directory)); + setptr(addressbar_last_address, directory);
treebrowser_browse(addressbar_last_address, NULL); treebrowser_load_bookmarks(); @@ -795,7 +802,7 @@ enum static gboolean treebrowser_expand_to_path(gchar* root, gchar* find) { - int i = 0; + guint i = 0; gboolean founded = FALSE, global_founded = FALSE; gchar *new = NULL; gchar **root_segments = NULL, **find_segments = NULL; @@ -1151,16 +1158,16 @@ enum on_menu_close_children(GtkMenuItem *menuitem, gchar *uri) { guint i; - int uri_len = strlen(uri); + size_t uri_len = strlen(uri); for (i=0; i < GEANY(documents_array)->len; i++) { if (documents[i]->is_valid) { /* the docuemnt filename shoudl always be longer than the uri when closing children * Compare the beginingin of the filename string to see if it matchs the uri*/ - if (strlen(documents[i]->file_name) > uri_len ) + if (strlen(documents[i]->file_name) > uri_len) { - if (strncmp(uri,documents[i]->file_name, uri_len)==0) + if (strncmp(uri, documents[i]->file_name, uri_len)==0) document_close(documents[i]); } } @@ -1197,7 +1204,7 @@ enum }
static GtkWidget* -create_popup_menu(gchar *name, gchar *uri) +create_popup_menu(const gchar *name, const gchar *uri) { GtkWidget *item, *menu = gtk_menu_new();
@@ -1215,16 +1222,16 @@ enum
item = ui_image_menu_item_new(GTK_STOCK_OPEN, _("Open externally")); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_open_externally), uri); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_open_externally), (gpointer)uri); gtk_widget_set_sensitive(item, is_exists);
item = ui_image_menu_item_new("utilities-terminal", _("Open Terminal")); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_open_terminal), uri); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_open_terminal), (gpointer)uri);
item = ui_image_menu_item_new(GTK_STOCK_GOTO_TOP, _("Set as root")); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_set_as_root), uri); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_set_as_root), (gpointer)uri); gtk_widget_set_sensitive(item, is_dir);
item = ui_image_menu_item_new(GTK_STOCK_REFRESH, _("Refresh")); @@ -1233,7 +1240,7 @@ enum
item = ui_image_menu_item_new(GTK_STOCK_FIND, _("Find in Files")); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_find_in_files), uri); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_find_in_files), (gpointer)uri); gtk_widget_set_sensitive(item, is_dir);
item = gtk_separator_menu_item_new(); @@ -1241,11 +1248,11 @@ enum
item = ui_image_menu_item_new(GTK_STOCK_ADD, _("Create new directory")); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), "directory"); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), (gpointer)"directory");
item = ui_image_menu_item_new(GTK_STOCK_NEW, _("Create new file")); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), "file"); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), (gpointer)"file");
item = ui_image_menu_item_new(GTK_STOCK_SAVE_AS, _("Rename")); gtk_container_add(GTK_CONTAINER(menu), item); @@ -1262,17 +1269,17 @@ enum
item = ui_image_menu_item_new(GTK_STOCK_CLOSE, g_strdup_printf(_("Close: %s"), name)); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_close), uri); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_close), (gpointer)uri); gtk_widget_set_sensitive(item, is_document);
item = ui_image_menu_item_new(GTK_STOCK_CLOSE, g_strdup_printf(_("Close Child Documents "))); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_close_children), uri); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_close_children), (gpointer)uri); gtk_widget_set_sensitive(item, is_dir);
item = ui_image_menu_item_new(GTK_STOCK_COPY, _("Copy full path to clipboard")); gtk_container_add(GTK_CONTAINER(menu), item); - g_signal_connect(item, "activate", G_CALLBACK(on_menu_copy_uri), uri); + g_signal_connect(item, "activate", G_CALLBACK(on_menu_copy_uri), (gpointer)uri); gtk_widget_set_sensitive(item, is_exists);
item = gtk_separator_menu_item_new(); @@ -1388,7 +1395,7 @@ enum GtkTreeIter iter; GtkTreeModel *model; GtkTreePath *path; - gchar *name = "", *uri = ""; + const gchar *name = "", *uri = "";
if (gtk_tree_selection_get_selected(selection, &model, &iter)) /* FIXME: name and uri should be freed, but they are passed to create_popup_menu()
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org