Compare commits

...

2 Commits

Author SHA1 Message Date
86c141db7f Corrected various warnings 2017-03-24 20:49:10 +01:00
cd6e54735d Added -Wall to CFLAGS 2017-03-24 20:47:54 +01:00
6 changed files with 10 additions and 10 deletions

View File

@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8)
project(mdiary) project(mdiary)
#set(CMAKE_BUILD_TYPE Release) #set(CMAKE_BUILD_TYPE Release)
set(CMAKE_C_FLAGS "-Wall")
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB2 REQUIRED glib-2.0) pkg_check_modules(GLIB2 REQUIRED glib-2.0)

View File

@ -20,7 +20,6 @@ static void quit_cb(GSimpleAction *action, GVariant *parameter, gpointer user_da
static void settings_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data) static void settings_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data)
{ {
struct mainWindow *mainWindow = *((struct mainWindow **) user_data); struct mainWindow *mainWindow = *((struct mainWindow **) user_data);
struct mainWindow *a = user_data;
mainWindow_settings_show(mainWindow); mainWindow_settings_show(mainWindow);
} }
@ -91,4 +90,6 @@ int main(int argc, char *argv[])
status = g_application_run(G_APPLICATION(app), argc, argv); status = g_application_run(G_APPLICATION(app), argc, argv);
g_object_unref(app); g_object_unref(app);
return status;
} }

View File

@ -149,7 +149,6 @@ void mainWindow_add_recent_workspace(struct mainWindow *mainWindow, gchar *path,
GRegex *regex; GRegex *regex;
GMatchInfo *match_info; GMatchInfo *match_info;
gchar *temp; gchar *temp;
gboolean del_iter = FALSE;
regex = g_regex_new("(.*)\\/(.*)", G_REGEX_RAW, 0, NULL); regex = g_regex_new("(.*)\\/(.*)", G_REGEX_RAW, 0, NULL);
if (g_regex_match(regex, path, 0, &match_info) && if (g_regex_match(regex, path, 0, &match_info) &&
@ -201,7 +200,6 @@ void mainWindow_add_recent_workspace(struct mainWindow *mainWindow, gchar *path,
static void mainWindow_configure_workspaceTreeView(struct mainWindow *mainWindow) static void mainWindow_configure_workspaceTreeView(struct mainWindow *mainWindow)
{ {
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
GtkTreeViewColumn *col;
mainWindow->workspaceListStore = gtk_list_store_new(WSCOL_COUNT, mainWindow->workspaceListStore = gtk_list_store_new(WSCOL_COUNT,
G_TYPE_STRING, G_TYPE_STRING,
@ -288,11 +286,9 @@ static void mainWindow_configure_treeView(struct mainWindow *mainWindow)
static void mainWindow_configure_entry_completion(struct mainWindow *mainWindow) static void mainWindow_configure_entry_completion(struct mainWindow *mainWindow)
{ {
GtkCellRenderer *renderer;
GtkTreeSortable *sortable; GtkTreeSortable *sortable;
GtkTreeModelSort *sorted; GtkTreeModelSort *sorted;
GtkTreeModel *model; GtkTreeModel *model;
GtkTreeIter iter;
mainWindow->completionListStore = gtk_list_store_new(1, G_TYPE_STRING); mainWindow->completionListStore = gtk_list_store_new(1, G_TYPE_STRING);
sorted = GTK_TREE_MODEL_SORT(gtk_tree_model_sort_new_with_model( sorted = GTK_TREE_MODEL_SORT(gtk_tree_model_sort_new_with_model(
@ -303,8 +299,6 @@ static void mainWindow_configure_entry_completion(struct mainWindow *mainWindow)
sortable = GTK_TREE_SORTABLE(sorted); sortable = GTK_TREE_SORTABLE(sorted);
renderer = gtk_cell_renderer_text_new();
gtk_entry_completion_set_model(mainWindow->searchEntryCompletion, model); gtk_entry_completion_set_model(mainWindow->searchEntryCompletion, model);
gtk_entry_completion_set_text_column(mainWindow->searchEntryCompletion, 0); gtk_entry_completion_set_text_column(mainWindow->searchEntryCompletion, 0);

View File

@ -270,7 +270,7 @@ static void mdiary_add_file_to_store(struct mdiary_scanner *mdiary_scanner,
file = g_file_new_for_path(filename); file = g_file_new_for_path(filename);
stream = g_file_read(file, NULL, &err); stream = g_file_read(file, NULL, &err);
if (err != NULL) { if (err != NULL) {
g_print("PARSER: %s\n", filename, err->message); g_print("PARSER: %s: %s\n", filename, err->message);
g_error_free(err); g_error_free(err);
return; return;
} }
@ -460,7 +460,7 @@ struct mdiary_scanner *mdiary_scanner_new(gboolean gpg_enabled)
return mdiary_scanner; return mdiary_scanner;
} }
void *mdiary_scanner_free(struct mdiary_scanner *mdiary_scanner) void mdiary_scanner_free(struct mdiary_scanner *mdiary_scanner)
{ {
free(mdiary_scanner); free(mdiary_scanner);
} }

View File

@ -27,7 +27,7 @@ struct mdiary_scanner {
}; };
struct mdiary_scanner *mdiary_scanner_new(gboolean gpg_enabled); struct mdiary_scanner *mdiary_scanner_new(gboolean gpg_enabled);
void *mdiary_scanner_free(struct mdiary_scanner *mdiary_scanner); void mdiary_scanner_free(struct mdiary_scanner *mdiary_scanner);
gint mdiary_scan_to_store(struct mdiary_scanner *mdiary_scanner, gint mdiary_scan_to_store(struct mdiary_scanner *mdiary_scanner,
gchar *base_dir, gchar *base_dir,
GtkListStore *entryListStore, GtkListStore *autoCompletion); GtkListStore *entryListStore, GtkListStore *autoCompletion);

View File

@ -56,6 +56,8 @@ gboolean mdiary_load_settings(gchar *filename, struct mdiary_settings *settings)
mainWindow_switch_workspace(settings->mainWindow, temp, FALSE); mainWindow_switch_workspace(settings->mainWindow, temp, FALSE);
g_free(temp); g_free(temp);
} }
return TRUE;
} }
gboolean mdiary_save_settings(gchar *filename, struct mdiary_settings *settings) gboolean mdiary_save_settings(gchar *filename, struct mdiary_settings *settings)
@ -96,6 +98,8 @@ gboolean mdiary_save_settings(gchar *filename, struct mdiary_settings *settings)
g_output_stream_close(G_OUTPUT_STREAM(stream), NULL, NULL); g_output_stream_close(G_OUTPUT_STREAM(stream), NULL, NULL);
g_object_unref(stream); g_object_unref(stream);
g_object_unref(file); g_object_unref(file);
return TRUE;
} }
struct mdiary_settings *mdiary_settings_new(struct mainWindow *mainWindow) struct mdiary_settings *mdiary_settings_new(struct mainWindow *mainWindow)