X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=inline;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Fgtkdirsel.c;h=5df585afabd122687772eb73c79fa83384d69e4c;hb=b1053af5f2ccec64807fa21d22bb62bfc05873a1;hp=a52e877db1c5fee86df556ad5f7b9f5e96a2a8a7;hpb=754351700b3d5fb6112e72dd4722a546abc219f1;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c index a52e877d..5df585af 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c @@ -21,6 +21,7 @@ #include #include #include +#include // For PATH_MAX #ifdef HAVE_SYS_PARAM_H #include #endif @@ -416,7 +417,7 @@ translate_win32_path (GtkDirSelection *filesel) { int updated = 0; const gchar *path; - gchar newPath[MAX_PATH]; + gchar newPath[PATH_MAX]; /* * Retrieve the current path @@ -451,6 +452,7 @@ gtk_dir_selection_get_type (void) sizeof (GtkDirSelection), 0, /* n_preallocs */ (GInstanceInitFunc) gtk_dir_selection_init, + NULL /* GValue */ }; file_selection_type = @@ -1916,7 +1918,7 @@ get_real_filename (gchar *filename, /* Check to see if the selection was a drive selector */ if (isalpha (filename[0]) && (filename[1] == ':')) { - gchar temp_filename[MAX_PATH]; + gchar temp_filename[PATH_MAX]; int len; cygwin_conv_to_posix_path (filename, temp_filename); @@ -2304,7 +2306,8 @@ gtk_dir_selection_file_changed (GtkTreeSelection *selection, index = new_names->len - 1; else { - gint i = 0, j = 0, cmp; + guint i = 0, j = 0; + gint cmp; /* do a quick diff, stopping at the first file not in the * old list @@ -2424,7 +2427,8 @@ gtk_dir_selection_dir_changed (GtkTreeSelection *selection, index = new_names->len - 1; else { - gint i = 0, j = 0, cmp; + guint i = 0, j = 0; + gint cmp; /* do a quick diff, stopping at the first file not in the * old list @@ -2482,7 +2486,7 @@ gtk_dir_selection_dir_changed (GtkTreeSelection *selection, gchar str[256]; err = gtk_label_get_text (GTK_LABEL (fs->selection_text)); err += 11; //pass over "Selection: " - sprintf(str,"%s\0",err); + sprintf(str,"%s",err); if (fs->last_selected != NULL) @@ -2534,7 +2538,7 @@ gtk_dir_selection_get_selections (GtkDirSelection *filesel) gchar **selections; gchar *filename, *dirname; gchar *current, *buf; - gint i, count; + guint i, count; gboolean unselected_entry; g_return_val_if_fail (GTK_IS_DIR_SELECTION (filesel), NULL); @@ -2842,7 +2846,6 @@ cmpl_completion_matches (gchar *text_to_complete, gchar **remaining_text, CompletionState *cmpl_state) { - gchar* first_slash; PossibleCompletion *poss; prune_memory_usage (cmpl_state); @@ -3162,18 +3165,16 @@ open_new_dir (gchar *dir_name, for (i = 0; i < entry_count; i += 1) { - GError *error = NULL; - if (i == 0) - dirent = "."; + dirent = "."; else if (i == 1) - dirent = ".."; + dirent = ".."; else - { - dirent = g_dir_read_name (directory); - if (!dirent) /* Directory changed */ - break; - } + { + dirent = g_dir_read_name (directory); + if (!dirent) /* Directory changed */ + break; + } sent->entries[n_entries].entry_name = g_filename_to_utf8 (dirent, -1, NULL, NULL, &error); if (sent->entries[n_entries].entry_name == NULL @@ -3729,7 +3730,7 @@ find_completion_dir (gchar *text_to_complete, for (i = 0; i < dir->sent->entry_count; i += 1) { if (dir->sent->entries[i].is_dir && - _gtk_fnmatch (pat_buf, dir->sent->entries[i].entry_name)) + _gtk_fnmatch (pat_buf, dir->sent->entries[i].entry_name,1)) { if (found) { @@ -3879,7 +3880,8 @@ attempt_dir_completion (CompletionState *cmpl_state) { if (dir->sent->entries[dir->cmpl_index].is_dir) { - if (_gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name)) + if (_gtk_fnmatch (pat_buf, + dir->sent->entries[dir->cmpl_index].entry_name,1)) { CompletionDir* new_dir; @@ -3927,7 +3929,7 @@ attempt_dir_completion (CompletionState *cmpl_state) append_completion_text (dir->sent->entries[dir->cmpl_index].entry_name, cmpl_state); cmpl_state->the_completion.is_a_completion = - _gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name); + _gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name,1); cmpl_state->the_completion.is_directory = dir->sent->entries[dir->cmpl_index].is_dir; if (dir->sent->entries[dir->cmpl_index].is_dir) @@ -4037,8 +4039,8 @@ compare_cmpl_dir (const void *a, const void *b) { - return strcmp (((CompletionDirEntry*)a)->sort_key, - (((CompletionDirEntry*)b))->sort_key); + return strcmp (((const CompletionDirEntry*)a)->sort_key, + (((const CompletionDirEntry*)b))->sort_key); } static gint