Apply patch from Daniel Richard G. to fix to fix several compiler warnings, C89 violations and minor code problems (thanks).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2267 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2008-02-20 11:24:23 +00:00
parent e685ab8fa5
commit 85f73129c0
66 changed files with 274 additions and 256 deletions

View File

@ -1,3 +1,10 @@
2008-02-20 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* plugins/*, src/*, tagmanager/*:
Apply patch from Daniel Richard G. to fix to fix several
compiler warnings, C89 violations and minor code problems (thanks).
2008-02-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2008-02-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/vte.c: Apply patch from Jeff Pohlmeyer to mark the VTE also as * src/vte.c: Apply patch from Jeff Pohlmeyer to mark the VTE also as

View File

@ -79,7 +79,7 @@ gboolean auto_save(gpointer data)
} }
void set_timeout() void set_timeout(void)
{ {
if (src_id != G_MAXUINT) if (src_id != G_MAXUINT)
g_source_remove(src_id); g_source_remove(src_id);
@ -195,7 +195,7 @@ void configure(GtkWidget *parent)
} }
void cleanup() void cleanup(void)
{ {
g_source_remove(src_id); g_source_remove(src_id);
g_free(config_file); g_free(config_file);

View File

@ -803,7 +803,7 @@ void init(GeanyData *data)
} }
void cleanup() void cleanup(void)
{ {
gtk_widget_destroy(plugin_fields->menu_item); gtk_widget_destroy(plugin_fields->menu_item);
} }

View File

@ -70,7 +70,7 @@ item_activate(GtkMenuItem *menuitem, gpointer gdata)
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO, GTK_MESSAGE_INFO,
GTK_BUTTONS_OK, GTK_BUTTONS_OK,
welcome_text); "%s", welcome_text);
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
_("(From the %s plugin)"), info()->name); _("(From the %s plugin)"), info()->name);
@ -146,7 +146,7 @@ void configure(GtkWidget *parent)
/* Called by Geany before unloading the plugin. /* Called by Geany before unloading the plugin.
* Here any UI changes should be removed, memory freed and any other finalization done. * Here any UI changes should be removed, memory freed and any other finalization done.
* Be sure to leave Geany as it was before init(). */ * Be sure to leave Geany as it was before init(). */
void cleanup() void cleanup(void)
{ {
// remove the menu item added in init() // remove the menu item added in init()
gtk_widget_destroy(plugin_fields->menu_item); gtk_widget_destroy(plugin_fields->menu_item);

View File

@ -737,7 +737,7 @@ void init(GeanyData *data)
} }
void cleanup() void cleanup(void)
{ {
gtk_widget_destroy(plugin_fields->menu_item); gtk_widget_destroy(plugin_fields->menu_item);
} }

View File

@ -60,7 +60,7 @@ enum
{ {
FILEVIEW_COLUMN_ICON = 0, FILEVIEW_COLUMN_ICON = 0,
FILEVIEW_COLUMN_NAME, FILEVIEW_COLUMN_NAME,
FILEVIEW_N_COLUMNS, FILEVIEW_N_COLUMNS
}; };
static gboolean show_hidden_files = FALSE; static gboolean show_hidden_files = FALSE;
@ -163,7 +163,7 @@ static gboolean is_top_level_directory(const gchar *dir)
// adds ".." to the start of the file list // adds ".." to the start of the file list
static void add_top_level_entry() static void add_top_level_entry(void)
{ {
GtkTreeIter iter; GtkTreeIter iter;
@ -178,7 +178,7 @@ static void add_top_level_entry()
} }
static void clear() static void clear(void)
{ {
gtk_list_store_clear(file_store); gtk_list_store_clear(file_store);
@ -190,7 +190,7 @@ static void clear()
// recreate the tree model from current_dir. // recreate the tree model from current_dir.
static void refresh() static void refresh(void)
{ {
gchar *utf8_dir; gchar *utf8_dir;
GSList *list; GSList *list;
@ -217,14 +217,14 @@ static void refresh()
} }
static void on_go_home() static void on_go_home(void)
{ {
setptr(current_dir, g_strdup(g_get_home_dir())); setptr(current_dir, g_strdup(g_get_home_dir()));
refresh(); refresh();
} }
static gchar *get_default_dir() static gchar *get_default_dir(void)
{ {
const gchar *dir = NULL; const gchar *dir = NULL;
@ -237,7 +237,7 @@ static gchar *get_default_dir()
} }
static void on_current_path() static void on_current_path(void)
{ {
gchar *fname; gchar *fname;
gchar *dir; gchar *dir;
@ -260,7 +260,7 @@ static void on_current_path()
} }
static void on_go_up() static void on_go_up(void)
{ {
// remove the highest directory part (which becomes the basename of current_dir) // remove the highest directory part (which becomes the basename of current_dir)
setptr(current_dir, g_path_get_dirname(current_dir)); setptr(current_dir, g_path_get_dirname(current_dir));
@ -495,7 +495,7 @@ static void on_hidden_files_clicked(GtkCheckMenuItem *item)
} }
static GtkWidget *create_popup_menu() static GtkWidget *create_popup_menu(void)
{ {
GtkWidget *item, *menu, *image; GtkWidget *item, *menu, *image;
@ -629,7 +629,7 @@ static void on_path_entry_activate(GtkEntry *entry, gpointer user_data)
} }
static void prepare_file_view() static void prepare_file_view(void)
{ {
GtkCellRenderer *text_renderer, *icon_renderer; GtkCellRenderer *text_renderer, *icon_renderer;
GtkTreeViewColumn *column; GtkTreeViewColumn *column;
@ -671,7 +671,7 @@ static void prepare_file_view()
} }
static GtkWidget *make_toolbar() static GtkWidget *make_toolbar(void)
{ {
GtkWidget *wid, *toolbar; GtkWidget *wid, *toolbar;
GtkTooltips *tooltips = GTK_TOOLTIPS(p_support->lookup_widget( GtkTooltips *tooltips = GTK_TOOLTIPS(p_support->lookup_widget(
@ -756,7 +756,7 @@ static gboolean completion_match_selected(GtkEntryCompletion *widget, GtkTreeMod
} }
static void completion_create() static void completion_create(void)
{ {
entry_completion = gtk_entry_completion_new(); entry_completion = gtk_entry_completion_new();
@ -915,7 +915,7 @@ void configure(GtkWidget *parent)
} }
void cleanup() void cleanup(void)
{ {
g_free(config_file); g_free(config_file);
g_free(open_cmd); g_free(open_cmd);

View File

@ -61,7 +61,7 @@ static void sc_fill_store(GtkTreeStore *store);
static gboolean sc_insert(GtkTreeModel *model, GtkTreeIter *iter); static gboolean sc_insert(GtkTreeModel *model, GtkTreeIter *iter);
static void tools_show_dialog_insert_special_chars() static void tools_show_dialog_insert_special_chars(void)
{ {
if (sc_dialog == NULL) if (sc_dialog == NULL)
{ {
@ -79,7 +79,7 @@ static void tools_show_dialog_insert_special_chars()
gtk_widget_set_name(sc_dialog, "GeanyDialog"); gtk_widget_set_name(sc_dialog, "GeanyDialog");
height = GEANY_WINDOW_MINIMAL_HEIGHT; height = GEANY_WINDOW_MINIMAL_HEIGHT;
gtk_window_set_default_size(GTK_WINDOW(sc_dialog), height * 0.8, height); gtk_window_set_default_size(GTK_WINDOW(sc_dialog), height * 8 / 10, height);
gtk_dialog_set_default_response(GTK_DIALOG(sc_dialog), GTK_RESPONSE_CANCEL); gtk_dialog_set_default_response(GTK_DIALOG(sc_dialog), GTK_RESPONSE_CANCEL);
label = gtk_label_new(_("Choose a special character from the list below and double click on it or use the button to insert it at the current cursor position.")); label = gtk_label_new(_("Choose a special character from the list below and double click on it or use the button to insert it at the current cursor position."));
@ -521,7 +521,7 @@ void init(GeanyData *data)
/* Destroy widgets */ /* Destroy widgets */
void cleanup() void cleanup(void)
{ {
gtk_widget_destroy(plugin_fields->menu_item); gtk_widget_destroy(plugin_fields->menu_item);

View File

@ -271,11 +271,11 @@ static void show_output(const gchar *std_output, const gchar *name_prefix,
if (force_encoding) if (force_encoding)
{ {
text = p_encoding->convert_to_utf8_from_charset( text = p_encoding->convert_to_utf8_from_charset(
std_output, -1, force_encoding, TRUE); std_output, (gsize)-1, force_encoding, TRUE);
} }
else else
{ {
text = p_encoding->convert_to_utf8(std_output, -1, &detect_enc); text = p_encoding->convert_to_utf8(std_output, (gsize)-1, &detect_enc);
} }
if (text) if (text)
{ {
@ -454,7 +454,7 @@ static GtkWidget *menu_vcdiff_file = NULL;
static GtkWidget *menu_vcdiff_dir = NULL; static GtkWidget *menu_vcdiff_dir = NULL;
static GtkWidget *menu_vcdiff_project = NULL; static GtkWidget *menu_vcdiff_project = NULL;
static void update_menu_items() static void update_menu_items(void)
{ {
document *doc; document *doc;
gboolean have_file; gboolean have_file;
@ -525,7 +525,7 @@ void init(GeanyData *data)
/* Called by Geany before unloading the plugin. */ /* Called by Geany before unloading the plugin. */
void cleanup() void cleanup(void)
{ {
// remove the menu item added in init() // remove the menu item added in init()
gtk_widget_destroy(plugin_fields->menu_item); gtk_widget_destroy(plugin_fields->menu_item);

View File

@ -1384,7 +1384,7 @@ on_includes_arguments_tex_dialog_response (GtkDialog *dialog,
} }
static void show_includes_arguments_tex() static void show_includes_arguments_tex(void)
{ {
GtkWidget *dialog, *label, *entries[4], *vbox, *table; GtkWidget *dialog, *label, *entries[4], *vbox, *table;
gint idx = document_get_cur_idx(); gint idx = document_get_cur_idx();
@ -1551,7 +1551,7 @@ on_includes_arguments_dialog_response (GtkDialog *dialog,
} }
static void show_includes_arguments_gen() static void show_includes_arguments_gen(void)
{ {
GtkWidget *dialog, *label, *entries[3], *vbox; GtkWidget *dialog, *label, *entries[3], *vbox;
GtkWidget *ft_table = NULL; GtkWidget *ft_table = NULL;
@ -1943,7 +1943,7 @@ on_make_custom_input_response(const gchar *input)
static void static void
show_make_custom() show_make_custom(void)
{ {
static GtkWidget *dialog = NULL; // keep dialog for combo history static GtkWidget *dialog = NULL; // keep dialog for combo history

View File

@ -62,9 +62,9 @@ typedef struct BuildMenuItems
void build_init(); void build_init(void);
void build_finalize(); void build_finalize(void);
gboolean build_parse_make_dir(const gchar *string, gchar **prefix); gboolean build_parse_make_dir(const gchar *string, gchar **prefix);

View File

@ -93,7 +93,7 @@ static gboolean insert_callback_from_menu = FALSE;
CallbacksData callbacks_data = {-1}; CallbacksData callbacks_data = {-1};
static gboolean check_no_unsaved() static gboolean check_no_unsaved(void)
{ {
guint i; guint i;
@ -108,7 +108,7 @@ static gboolean check_no_unsaved()
} }
static gboolean account_for_unsaved() static gboolean account_for_unsaved(void)
{ {
gint p; gint p;
@ -139,7 +139,7 @@ static void verify_click_pos(gint idx)
// should only be called from on_exit_clicked // should only be called from on_exit_clicked
static void quit_app() static void quit_app(void)
{ {
guint i; guint i;

View File

@ -63,7 +63,7 @@ enum
}; };
#if ! GEANY_USE_WIN32_DIALOG #if ! GEANY_USE_WIN32_DIALOG
static GtkWidget *add_file_open_extra_widget(); static GtkWidget *add_file_open_extra_widget(void);
#endif #endif
@ -163,7 +163,7 @@ on_file_open_check_hidden_toggled (GtkToggleButton *togglebutton,
#if ! GEANY_USE_WIN32_DIALOG #if ! GEANY_USE_WIN32_DIALOG
static void create_open_file_dialog() static void create_open_file_dialog(void)
{ {
GtkWidget *filetype_combo, *encoding_combo; GtkWidget *filetype_combo, *encoding_combo;
GtkWidget *viewbtn; GtkWidget *viewbtn;
@ -471,7 +471,7 @@ on_file_save_dialog_response (GtkDialog *dialog,
#if ! GEANY_USE_WIN32_DIALOG #if ! GEANY_USE_WIN32_DIALOG
static void create_save_file_dialog() static void create_save_file_dialog(void)
{ {
GtkWidget *vbox, *check_open_new_tab, *rename_btn; GtkWidget *vbox, *check_open_new_tab, *rename_btn;
GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips")); GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips"));
@ -823,7 +823,7 @@ on_input_dialog_response(GtkDialog *dialog,
gint response, gint response,
GtkWidget *entry) GtkWidget *entry)
{ {
gboolean persistent = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dialog), "has_combo")); gboolean persistent = (gboolean) GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dialog), "has_combo"));
if (response == GTK_RESPONSE_ACCEPT) if (response == GTK_RESPONSE_ACCEPT)
{ {

View File

@ -33,22 +33,22 @@
typedef void (*InputCallback)(const gchar *); typedef void (*InputCallback)(const gchar *);
void dialogs_show_open_file(); void dialogs_show_open_file(void);
gboolean dialogs_show_save_as(); gboolean dialogs_show_save_as(void);
gboolean dialogs_show_unsaved_file(gint idx); gboolean dialogs_show_unsaved_file(gint idx);
void dialogs_show_open_font(); void dialogs_show_open_font(void);
void dialogs_show_word_count(); void dialogs_show_word_count(void);
void dialogs_show_color(gchar *colour); void dialogs_show_color(gchar *colour);
GtkWidget *dialogs_show_input(const gchar *title, const gchar *label_text, GtkWidget *dialogs_show_input(const gchar *title, const gchar *label_text,
const gchar *default_text, gboolean persistent, InputCallback input_cb); const gchar *default_text, gboolean persistent, InputCallback input_cb);
void dialogs_show_goto_line(); void dialogs_show_goto_line(void);
void dialogs_show_file_properties(gint idx); void dialogs_show_file_properties(gint idx);

View File

@ -354,7 +354,7 @@ static void init_doc_struct(document *new_doc)
/* returns the next free place(i.e. index) in the document list, /* returns the next free place(i.e. index) in the document list,
* or -1 if the current doc_array is full */ * or -1 if the current doc_array is full */
static gint document_get_new_idx() static gint document_get_new_idx(void)
{ {
guint i; guint i;
@ -1294,9 +1294,9 @@ gboolean document_save_file(gint idx, gboolean force)
// encoding, it will be converted to doc_list[idx].encoding below and this conversion // encoding, it will be converted to doc_list[idx].encoding below and this conversion
// also changes the BOM // also changes the BOM
data = (gchar*) g_malloc(len + 3); // 3 chars for BOM data = (gchar*) g_malloc(len + 3); // 3 chars for BOM
data[0] = 0xef; data[0] = (gchar) 0xef;
data[1] = 0xbb; data[1] = (gchar) 0xbb;
data[2] = 0xbf; data[2] = (gchar) 0xbf;
sci_get_text(doc_list[idx].sci, len, data + 3); sci_get_text(doc_list[idx].sci, len, data + 3);
len += 3; len += 3;
} }

View File

@ -131,22 +131,19 @@ extern GArray *doc_array;
gint document_find_by_filename(const gchar *filename, gboolean is_tm_filename); gint document_find_by_filename(const gchar *filename, gboolean is_tm_filename);
gint document_find_by_sci(ScintillaObject *sci); gint document_find_by_sci(ScintillaObject *sci);
gint document_get_notebook_page(gint doc_idx); gint document_get_notebook_page(gint doc_idx);
gint document_get_n_idx(guint page_num); gint document_get_n_idx(guint page_num);
gint document_get_cur_idx(); gint document_get_cur_idx(void);
document *document_get_current(); document *document_get_current(void);
void document_init_doclist(void);
void document_init_doclist(); void document_finalize(void);
void document_finalize();
void document_set_text_changed(gint idx); void document_set_text_changed(gint idx);
@ -154,10 +151,8 @@ void document_set_text_changed(gint idx);
void document_apply_update_prefs(gint idx); void document_apply_update_prefs(gint idx);
gboolean document_remove(guint page_num); gboolean document_remove(guint page_num);
gint document_new_file(const gchar *filename, filetype *ft, const gchar *text); gint document_new_file(const gchar *filename, filetype *ft, const gchar *text);
gint document_clone(gint old_idx, const gchar *utf8_filename); gint document_clone(gint old_idx, const gchar *utf8_filename);
@ -174,13 +169,10 @@ void document_open_file_list(const gchar *data, gssize length);
void document_open_files(const GSList *filenames, gboolean readonly, filetype *ft, void document_open_files(const GSList *filenames, gboolean readonly, filetype *ft,
const gchar *forced_enc); const gchar *forced_enc);
gboolean document_reload_file(gint idx, const gchar *forced_enc); gboolean document_reload_file(gint idx, const gchar *forced_enc);
gboolean document_save_file(gint idx, gboolean force); gboolean document_save_file(gint idx, gboolean force);
gboolean document_search_bar_find(gint idx, const gchar *text, gint flags, gboolean inc); gboolean document_search_bar_find(gint idx, const gchar *text, gint flags, gboolean inc);
gint document_find_text(gint idx, const gchar *text, gint flags, gboolean search_backwards, gint document_find_text(gint idx, const gchar *text, gint flags, gboolean search_backwards,
@ -254,13 +246,11 @@ void document_redo(gint idx);
void document_undo_add(gint idx, guint type, gpointer data); void document_undo_add(gint idx, guint type, gpointer data);
GdkColor *document_get_status(gint idx); GdkColor *document_get_status(gint idx);
void document_delay_colourise(void);
void document_delay_colourise(); void document_colourise_new(void);
void document_colourise_new();
void document_insert_colour(gint idx, const gchar *colour); void document_insert_colour(gint idx, const gchar *colour);

View File

@ -77,7 +77,7 @@ on_editor_button_press_event (GtkWidget *widget,
gpointer user_data) gpointer user_data)
{ {
gint idx = GPOINTER_TO_INT(user_data); gint idx = GPOINTER_TO_INT(user_data);
editor_info.click_pos = sci_get_position_from_xy(doc_list[idx].sci, event->x, event->y, FALSE); editor_info.click_pos = sci_get_position_from_xy(doc_list[idx].sci, (gint)event->x, (gint)event->y, FALSE);
if (event->button == 1) if (event->button == 1)
{ {
@ -1997,7 +1997,7 @@ void editor_highlight_braces(ScintillaObject *sci, gint cur_pos)
brace_pos++; brace_pos++;
if (! utils_isbrace(sci_get_char_at(sci, brace_pos), editor_prefs.brace_match_ltgt)) if (! utils_isbrace(sci_get_char_at(sci, brace_pos), editor_prefs.brace_match_ltgt))
{ {
SSM(sci, SCI_BRACEBADLIGHT, -1, 0); SSM(sci, SCI_BRACEBADLIGHT, (uptr_t)-1, 0);
return; return;
} }
} }

View File

@ -133,7 +133,7 @@ void editor_indentation_by_one_space(gint idx, gint pos, gboolean decrease);
void editor_scroll_to_line(ScintillaObject *sci, gint line, gfloat percent_of_view); void editor_scroll_to_line(ScintillaObject *sci, gint line, gfloat percent_of_view);
void editor_finalize(); void editor_finalize(void);
/* General editing functions */ /* General editing functions */

View File

@ -53,6 +53,9 @@ static regex_t pregs[2];
#endif #endif
GeanyEncoding encodings[GEANY_ENCODINGS_MAX];
#define fill(Order, Group, Idx, Charset, Name) \ #define fill(Order, Group, Idx, Charset, Name) \
encodings[Idx].idx = Idx; \ encodings[Idx].idx = Idx; \
encodings[Idx].order = Order; \ encodings[Idx].order = Order; \
@ -479,7 +482,7 @@ gchar *encodings_convert_to_utf8(const gchar *buffer, gsize size, gchar **used_e
gchar *utf8_content; gchar *utf8_content;
gboolean check_regex = FALSE; gboolean check_regex = FALSE;
gboolean check_locale = FALSE; gboolean check_locale = FALSE;
guint i; gint i;
if ((gint)size == -1) if ((gint)size == -1)
{ {
@ -488,7 +491,7 @@ gchar *encodings_convert_to_utf8(const gchar *buffer, gsize size, gchar **used_e
#ifdef HAVE_REGCOMP #ifdef HAVE_REGCOMP
// first try to read the encoding from the file content // first try to read the encoding from the file content
for (i = 0; i < G_N_ELEMENTS(pregs) && ! check_regex; i++) for (i = 0; i < (gint) G_N_ELEMENTS(pregs) && ! check_regex; i++)
{ {
if ((regex_charset = regex_match(&pregs[i], buffer, size)) != NULL) if ((regex_charset = regex_match(&pregs[i], buffer, size)) != NULL)
check_regex = TRUE; check_regex = TRUE;
@ -500,7 +503,7 @@ gchar *encodings_convert_to_utf8(const gchar *buffer, gsize size, gchar **used_e
for (i = 0; i < GEANY_ENCODINGS_MAX; i++) for (i = 0; i < GEANY_ENCODINGS_MAX; i++)
{ {
if (i == (guint) encodings[GEANY_ENCODING_NONE].idx || i == (guint) -1) if (i == encodings[GEANY_ENCODING_NONE].idx || i == -1)
continue; continue;
if (check_regex) if (check_regex)
@ -522,7 +525,7 @@ gchar *encodings_convert_to_utf8(const gchar *buffer, gsize size, gchar **used_e
if (charset == NULL) if (charset == NULL)
continue; continue;
geany_debug("Trying to convert %d bytes of data from %s into UTF-8.", (gint) size, charset); geany_debug("Trying to convert %" G_GSIZE_FORMAT " bytes of data from %s into UTF-8.", size, charset);
utf8_content = encodings_convert_to_utf8_from_charset(buffer, size, charset, FALSE); utf8_content = encodings_convert_to_utf8_from_charset(buffer, size, charset, FALSE);
if (utf8_content != NULL) if (utf8_content != NULL)

View File

@ -179,7 +179,7 @@ typedef enum
} GeanyEncodingIndex; } GeanyEncodingIndex;
GeanyEncoding encodings[GEANY_ENCODINGS_MAX]; extern GeanyEncoding encodings[GEANY_ENCODINGS_MAX];
GeanyEncodingIndex encodings_scan_unicode_bom(const gchar *string, gsize len, guint *bom_len); GeanyEncodingIndex encodings_scan_unicode_bom(const gchar *string, gsize len, guint *bom_len);

View File

@ -88,9 +88,9 @@ typedef enum
struct build_actions struct build_actions
{ {
gboolean can_compile:1; gboolean can_compile;
gboolean can_link:1; gboolean can_link;
gboolean can_exec:1; gboolean can_exec;
}; };
struct build_programs struct build_programs
@ -128,10 +128,10 @@ extern filetype *filetypes[GEANY_MAX_FILE_TYPES];
filetype *filetypes_get_from_uid(gint uid); filetype *filetypes_get_from_uid(gint uid);
/* Calls filetypes_init_types() and creates the filetype menu. */ /* Calls filetypes_init_types() and creates the filetype menu. */
void filetypes_init(); void filetypes_init(void);
/* Create the filetype array and fill it with the known filetypes. */ /* Create the filetype array and fill it with the known filetypes. */
void filetypes_init_types(); void filetypes_init_types(void);
/* Detect the filetype for document idx, checking for a shebang, then filename extension. */ /* Detect the filetype for document idx, checking for a shebang, then filename extension. */
filetype *filetypes_detect_from_file(gint idx); filetype *filetypes_detect_from_file(gint idx);
@ -141,17 +141,17 @@ filetype *filetypes_detect_from_file(gint idx);
filetype *filetypes_detect_from_filename(const gchar *utf8_filename); filetype *filetypes_detect_from_filename(const gchar *utf8_filename);
/* frees the array and all related pointers */ /* frees the array and all related pointers */
void filetypes_free_types(); void filetypes_free_types(void);
void filetypes_load_config(gint ft_id); void filetypes_load_config(gint ft_id);
void filetypes_save_commands(); void filetypes_save_commands(void);
void filetypes_select_radio_item(const filetype *ft); void filetypes_select_radio_item(const filetype *ft);
GtkFileFilter *filetypes_create_file_filter(filetype *ft); GtkFileFilter *filetypes_create_file_filter(filetype *ft);
GtkFileFilter *filetypes_create_file_filter_all_source(); GtkFileFilter *filetypes_create_file_filter_all_source(void);
gchar *filetypes_get_conf_extension(gint filetype_idx); gchar *filetypes_get_conf_extension(gint filetype_idx);

View File

@ -76,7 +76,7 @@ struct _GeanyObjectClass
void (*document_activate)(gint idx); void (*document_activate)(gint idx);
void (*project_open)(GKeyFile *keyfile); void (*project_open)(GKeyFile *keyfile);
void (*project_save)(GKeyFile *keyfile); void (*project_save)(GKeyFile *keyfile);
void (*project_close)(); void (*project_close)(void);
}; };
GType geany_object_get_type (void); GType geany_object_get_type (void);

View File

@ -73,9 +73,9 @@ enum // Geany common styling
typedef struct typedef struct
{ {
// can take values 1 or 2 (or 3) // can take values 1 or 2 (or 3)
guchar marker:2; guint marker:2;
guchar lines:2; guint lines:2;
guchar draw_line:3; guint draw_line:3;
} FoldingStyle; } FoldingStyle;
static struct static struct
@ -582,10 +582,10 @@ HighlightingStyle gsd_string_eol = {0x000000, 0xe0c0e0, FALSE, FALSE};
static void static void
styleset_c_like_init(GKeyFile *config, GKeyFile *config_home, gint filetype_idx) styleset_c_like_init(GKeyFile *config, GKeyFile *config_home, gint filetype_idx)
{ {
HighlightingStyle uuid = {0x404080, 0xffffff, FALSE, FALSE}; static HighlightingStyle uuid = {0x404080, 0xffffff, FALSE, FALSE};
HighlightingStyle operator = {0x301010, 0xffffff, FALSE, FALSE}; static HighlightingStyle operator = {0x301010, 0xffffff, FALSE, FALSE};
HighlightingStyle verbatim = {0x301010, 0xffffff, FALSE, FALSE}; static HighlightingStyle verbatim = {0x301010, 0xffffff, FALSE, FALSE};
HighlightingStyle regex = {0x105090, 0xffffff, FALSE, FALSE}; static HighlightingStyle regex = {0x105090, 0xffffff, FALSE, FALSE};
StyleEntry entries[] = StyleEntry entries[] =
{ {

View File

@ -33,8 +33,8 @@ typedef struct HighlightingStyle
{ {
gint foreground; gint foreground;
gint background; gint background;
gboolean bold:1; gboolean bold;
gboolean italic:1; gboolean italic;
} HighlightingStyle; } HighlightingStyle;

View File

@ -46,6 +46,8 @@
#include "vte.h" #include "vte.h"
KeyBinding *keys[GEANY_MAX_KEYS];
static const gboolean swap_alt_tab_order = FALSE; static const gboolean swap_alt_tab_order = FALSE;
@ -103,10 +105,10 @@ static void cb_func_edit_global(guint key_id);
// common function for keybindings using current word // common function for keybindings using current word
static void cb_func_current_word(guint key_id); static void cb_func_current_word(guint key_id);
static void add_menu_accels(); static void add_menu_accels(void);
static void init_default_kb() static void init_default_kb(void)
{ {
// init all fields of keys with default values // init all fields of keys with default values
keys[GEANY_KEYS_MENU_NEW] = fill(cb_func_file_action, keys[GEANY_KEYS_MENU_NEW] = fill(cb_func_file_action,
@ -331,7 +333,7 @@ static void init_default_kb()
} }
static void load_user_kb() static void load_user_kb(void)
{ {
gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "keybindings.conf", NULL); gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "keybindings.conf", NULL);
gchar *val; gchar *val;
@ -570,7 +572,7 @@ void keybindings_show_shortcuts()
gtk_widget_set_name(dialog, "GeanyDialog"); gtk_widget_set_name(dialog, "GeanyDialog");
height = GEANY_WINDOW_MINIMAL_HEIGHT; height = GEANY_WINDOW_MINIMAL_HEIGHT;
gtk_window_set_default_size(GTK_WINDOW(dialog), height * 0.8, height); gtk_window_set_default_size(GTK_WINDOW(dialog), height * 8 / 10, height);
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
label3 = gtk_label_new(_("The following keyboard shortcuts are configurable:")); label3 = gtk_label_new(_("The following keyboard shortcuts are configurable:"));

View File

@ -185,7 +185,7 @@ typedef enum
} }
GeanyKeyCommand; GeanyKeyCommand;
KeyBinding *keys[GEANY_MAX_KEYS]; extern KeyBinding *keys[GEANY_MAX_KEYS];
void keybindings_init(void); void keybindings_init(void);
@ -197,7 +197,7 @@ void keybindings_cmd(GeanyKeyCommand cmd_id);
/* just write the content of the keys array to the config file */ /* just write the content of the keys array to the config file */
void keybindings_write_to_file(void); void keybindings_write_to_file(void);
void keybindings_show_shortcuts(); void keybindings_show_shortcuts(void);
/* central keypress event handler, almost all keypress events go to this function */ /* central keypress event handler, almost all keypress events go to this function */
gboolean keybindings_got_event(GtkWidget *widget, GdkEventKey *event, gpointer user_data); gboolean keybindings_got_event(GtkWidget *widget, GdkEventKey *event, gpointer user_data);

View File

@ -160,8 +160,11 @@ static void save_plugin_prefs(GKeyFile *config)
g_key_file_set_string_list(config, "plugins", "active_plugins", g_key_file_set_string_list(config, "plugins", "active_plugins",
(const gchar**)app->active_plugins, g_strv_length(app->active_plugins)); (const gchar**)app->active_plugins, g_strv_length(app->active_plugins));
else else
{
// use an empty dummy array to override maybe exisiting value // use an empty dummy array to override maybe exisiting value
g_key_file_set_string_list(config, "plugins", "active_plugins", (const gchar*[1]){ "" }, 1); const gchar *dummy[] = { "" };
g_key_file_set_string_list(config, "plugins", "active_plugins", dummy, 1);
}
} }
#endif #endif
@ -375,7 +378,7 @@ static void save_hidden_prefs(GKeyFile *config)
} }
void configuration_save() void configuration_save(void)
{ {
GKeyFile *config = g_key_file_new(); GKeyFile *config = g_key_file_new();
gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL); gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
@ -744,7 +747,7 @@ static void load_ui_prefs(GKeyFile *config)
/* /*
* Save current session in default configuration file * Save current session in default configuration file
*/ */
void configuration_save_default_session() void configuration_save_default_session(void)
{ {
gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL); gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
gchar *data; gchar *data;
@ -768,7 +771,7 @@ void configuration_save_default_session()
/* /*
* Only reload the session part of the default configuration * Only reload the session part of the default configuration
*/ */
void configuration_reload_default_session() void configuration_reload_default_session(void)
{ {
gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL); gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
GKeyFile *config = g_key_file_new(); GKeyFile *config = g_key_file_new();
@ -782,7 +785,7 @@ void configuration_reload_default_session()
} }
gboolean configuration_load() gboolean configuration_load(void)
{ {
gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL); gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
GKeyFile *config = g_key_file_new(); GKeyFile *config = g_key_file_new();
@ -813,7 +816,7 @@ gboolean configuration_load()
/* Open session files /* Open session files
* Note: notebook page switch handler and adding to recent files list is always disabled * Note: notebook page switch handler and adding to recent files list is always disabled
* for all files opened within this function */ * for all files opened within this function */
gboolean configuration_open_files() gboolean configuration_open_files(void)
{ {
gint i; gint i;
guint pos; guint pos;
@ -901,7 +904,7 @@ gboolean configuration_open_files()
/* set some settings which are already read from the config file, but need other things, like the /* set some settings which are already read from the config file, but need other things, like the
* realisation of the main window */ * realisation of the main window */
void configuration_apply_settings() void configuration_apply_settings(void)
{ {
if (scribble_text) if (scribble_text)
{ // update the scribble widget, because now it's realized { // update the scribble widget, because now it's realized
@ -936,7 +939,7 @@ static void generate_filetype_extensions(const gchar *output_dir);
/* Generate the config files in "data/" from defaults */ /* Generate the config files in "data/" from defaults */
void configuration_generate_data_files() void configuration_generate_data_files(void)
{ {
gchar *cur_dir, *gen_dir; gchar *cur_dir, *gen_dir;
@ -997,7 +1000,7 @@ static void generate_filetype_extensions(const gchar *output_dir)
#endif #endif
void configuration_read_filetype_extensions() void configuration_read_filetype_extensions(void)
{ {
guint i; guint i;
gsize len = 0; gsize len = 0;
@ -1034,7 +1037,7 @@ void configuration_read_filetype_extensions()
} }
void configuration_read_snippets() void configuration_read_snippets(void)
{ {
gsize i, j, len = 0, len_keys = 0; gsize i, j, len = 0, len_keys = 0;
gchar *sysconfigfile, *userconfigfile; gchar *sysconfigfile, *userconfigfile;

View File

@ -26,31 +26,31 @@
#define GEANY_KEYFILE_H 1 #define GEANY_KEYFILE_H 1
void configuration_save(); void configuration_save(void);
gboolean configuration_load(); gboolean configuration_load(void);
gboolean configuration_open_files(); gboolean configuration_open_files(void);
void configuration_reload_default_session(); void configuration_reload_default_session(void);
void configuration_save_default_session(); void configuration_save_default_session(void);
void configuration_load_session_files(GKeyFile *config); void configuration_load_session_files(GKeyFile *config);
void configuration_save_session_files(GKeyFile *config); void configuration_save_session_files(GKeyFile *config);
void configuration_read_filetype_extensions(); void configuration_read_filetype_extensions(void);
void configuration_read_snippets(); void configuration_read_snippets(void);
/* set some settings which are already read from the config file, but need other things, like the /* set some settings which are already read from the config file, but need other things, like the
* realisation of the main window */ * realisation of the main window */
void configuration_apply_settings(); void configuration_apply_settings(void);
#ifdef GEANY_DEBUG #ifdef GEANY_DEBUG
/* Generate the config files in "data/" from defaults */ /* Generate the config files in "data/" from defaults */
void configuration_generate_data_files(); void configuration_generate_data_files(void);
#endif #endif
#endif #endif

View File

@ -419,7 +419,7 @@ static void get_line_and_column_from_filename(gchar *filename, gint *line, gint
} }
static void setup_paths() static void setup_paths(void)
{ {
gchar *data_dir; gchar *data_dir;
gchar *doc_dir; gchar *doc_dir;
@ -448,7 +448,7 @@ static void setup_paths()
} }
static void locale_init() static void locale_init(void)
{ {
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
gchar *locale_dir = NULL; gchar *locale_dir = NULL;
@ -615,7 +615,7 @@ static void parse_command_line_options(gint *argc, gchar ***argv)
// Returns 0 if config dir is OK. // Returns 0 if config dir is OK.
static gint setup_config_dir() static gint setup_config_dir(void)
{ {
gint mkdir_result = 0; gint mkdir_result = 0;
gchar *tmp = app->configdir; gchar *tmp = app->configdir;
@ -705,7 +705,7 @@ static gboolean open_cl_files(gint argc, gchar **argv)
} }
static void load_project_file() static void load_project_file(void)
{ {
gchar *locale_filename; gchar *locale_filename;
@ -721,7 +721,7 @@ static void load_project_file()
} }
static void load_settings() static void load_settings(void)
{ {
configuration_load(); configuration_load();
// let cmdline options overwrite configuration settings // let cmdline options overwrite configuration settings

View File

@ -49,6 +49,6 @@ extern GeanyStatus main_status;
gchar *get_argv_filename(const gchar *filename); gchar *get_argv_filename(const gchar *filename);
void main_quit(); void main_quit(void);
#endif #endif

View File

@ -595,7 +595,10 @@ static void parse_file_line(ParseData *data, gchar **filename, gint *line)
* *filename must be freed unless it is NULL. */ * *filename must be freed unless it is NULL. */
void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir, gchar **filename, gint *line) void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir, gchar **filename, gint *line)
{ {
ParseData data = {string, build_info.dir, NULL, 0, 0, 0}; ParseData data = {NULL, NULL, NULL, 0, 0, 0};
data.string = string;
data.dir = build_info.dir;
*filename = NULL; *filename = NULL;
*line = -1; *line = -1;

View File

@ -40,7 +40,7 @@ typedef enum
MSG_COMPILER, MSG_COMPILER,
MSG_MESSAGE, MSG_MESSAGE,
MSG_SCRATCH, MSG_SCRATCH,
MSG_VTE, MSG_VTE
} MessageWindowTabNum; } MessageWindowTabNum;
@ -63,9 +63,9 @@ typedef struct
extern MessageWindow msgwindow; extern MessageWindow msgwindow;
void msgwin_init(); void msgwin_init(void);
void msgwin_finalize(); void msgwin_finalize(void);
void msgwin_show_hide(gboolean show); void msgwin_show_hide(gboolean show);
@ -87,11 +87,11 @@ void msgwin_status_add(const gchar *format, ...) G_GNUC_PRINTF (1, 2);
void msgwin_menu_add_common_items(GtkMenu *menu); void msgwin_menu_add_common_items(GtkMenu *menu);
gboolean msgwin_goto_compiler_file_line(); gboolean msgwin_goto_compiler_file_line(void);
void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir, void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir,
gchar **filename, gint *line); gchar **filename, gint *line);
gboolean msgwin_goto_messages_file_line(); gboolean msgwin_goto_messages_file_line(void);
#endif #endif

View File

@ -71,7 +71,7 @@ void navqueue_free()
} }
static void adjust_buttons() static void adjust_buttons(void)
{ {
if (g_queue_get_length(navigation_queue) < 2) if (g_queue_get_length(navigation_queue) < 2)
{ {

View File

@ -27,16 +27,16 @@
#define GEANY_NAVQUEUE_H 1 #define GEANY_NAVQUEUE_H 1
void navqueue_init(); void navqueue_init(void);
void navqueue_free(); void navqueue_free(void);
gboolean navqueue_goto_line(gint old_idx, gint new_idx, gint line); gboolean navqueue_goto_line(gint old_idx, gint new_idx, gint line);
void navqueue_go_back(); void navqueue_go_back(void);
void navqueue_go_forward(); void navqueue_go_forward(void);
#endif #endif

View File

@ -74,7 +74,7 @@ notebook_find_tab_num_at_pos(GtkNotebook *notebook, gint x, gint y);
static void static void
notebook_tab_close_clicked_cb(GtkButton *button, gpointer user_data); notebook_tab_close_clicked_cb(GtkButton *button, gpointer user_data);
static void setup_tab_dnd(); static void setup_tab_dnd(void);
static void focus_sci(GtkWidget *widget, gpointer user_data) static void focus_sci(GtkWidget *widget, gpointer user_data)
@ -280,7 +280,7 @@ notebook_find_tab_num_at_pos(GtkNotebook *notebook, gint x, gint y)
// call this after the number of tabs in app->notebook changes. // call this after the number of tabs in app->notebook changes.
static void tab_count_changed() static void tab_count_changed(void)
{ {
switch (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook))) switch (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)))
{ {

View File

@ -24,7 +24,7 @@
#ifndef GEANY_NOTEBOOK_H #ifndef GEANY_NOTEBOOK_H
#define GEANY_NOTEBOOK_H 1 #define GEANY_NOTEBOOK_H 1
void notebook_init(); void notebook_init(void);
/* Returns page number of notebook page, or -1 on error */ /* Returns page number of notebook page, or -1 on error */
gint notebook_new_tab(gint doc_idx); gint notebook_new_tab(gint doc_idx);

View File

@ -72,7 +72,7 @@ PluginInfo;
/* Sets the plugin name and a brief description of what it is. */ /* Sets the plugin name and a brief description of what it is. */
#define PLUGIN_INFO(p_name, p_description, p_version, p_author) \ #define PLUGIN_INFO(p_name, p_description, p_version, p_author) \
PluginInfo *info() \ PluginInfo *info(void) \
{ \ { \
static PluginInfo p_info; \ static PluginInfo p_info; \
\ \
@ -160,10 +160,10 @@ typedef GeanyData PluginData; // for compatibility with API < 7
typedef struct DocumentFuncs typedef struct DocumentFuncs
{ {
gint (*new_file) (const gchar *filename, struct filetype *ft, const gchar *text); gint (*new_file) (const gchar *filename, struct filetype *ft, const gchar *text);
gint (*get_cur_idx) (); gint (*get_cur_idx) (void);
gint (*get_n_idx) (guint i); gint (*get_n_idx) (guint i);
gint (*find_by_filename) (const gchar *filename, gboolean is_tm_filename); gint (*find_by_filename) (const gchar *filename, gboolean is_tm_filename);
struct document* (*get_current) (); struct document* (*get_current) (void);
gboolean (*save_file)(gint idx, gboolean force); gboolean (*save_file)(gint idx, gboolean force);
gint (*open_file)(const gchar *locale_filename, gboolean readonly, gint (*open_file)(const gchar *locale_filename, gboolean readonly,
struct filetype *ft, const gchar *forced_enc); struct filetype *ft, const gchar *forced_enc);
@ -262,7 +262,7 @@ typedef struct DialogFuncs
{ {
gboolean (*show_question) (const gchar *text, ...); gboolean (*show_question) (const gchar *text, ...);
void (*show_msgbox) (gint type, const gchar *text, ...); void (*show_msgbox) (gint type, const gchar *text, ...);
gboolean (*show_save_as) (); gboolean (*show_save_as) (void);
} }
DialogFuncs; DialogFuncs;

View File

@ -73,10 +73,10 @@ typedef struct Plugin
gulong *signal_ids; // signal IDs to disconnect when unloading gulong *signal_ids; // signal IDs to disconnect when unloading
gsize signal_ids_len; gsize signal_ids_len;
PluginInfo* (*info) (); /* Returns plugin name, description */ PluginInfo* (*info) (void); /* Returns plugin name, description */
void (*init) (GeanyData *data); /* Called when the plugin is enabled */ void (*init) (GeanyData *data); /* Called when the plugin is enabled */
void (*configure) (GtkWidget *parent); /* plugin configure dialog, optionally */ void (*configure) (GtkWidget *parent); /* plugin configure dialog, optionally */
void (*cleanup) (); /* Called when the plugin is disabled or when Geany exits */ void (*cleanup) (void); /* Called when the plugin is disabled or when Geany exits */
} }
Plugin; Plugin;
@ -240,7 +240,7 @@ static GeanyData geany_data = {
static void static void
geany_data_init() geany_data_init(void)
{ {
geany_data.app = app; geany_data.app = app;
geany_data.tools_menu = lookup_widget(app->window, "tools1_menu"); geany_data.tools_menu = lookup_widget(app->window, "tools1_menu");
@ -387,7 +387,7 @@ plugin_new(const gchar *fname)
{ {
Plugin *plugin; Plugin *plugin;
GModule *module; GModule *module;
PluginInfo* (*info)(); PluginInfo* (*info)(void);
PluginFields **plugin_fields; PluginFields **plugin_fields;
GeanyData **p_geany_data; GeanyData **p_geany_data;
@ -554,7 +554,7 @@ static gchar *get_plugin_path()
#endif #endif
static void load_plugin_paths() static void load_plugin_paths(void)
{ {
gchar *path; gchar *path;
@ -650,7 +650,7 @@ void plugins_update_document_sensitive(gboolean enabled)
static gint static gint
plugin_has_menu(Plugin *a, Plugin *b) plugin_has_menu(Plugin *a, Plugin *b)
{ {
if (((PluginFields)a->fields).menu_item != NULL) if (a->fields.menu_item != NULL)
return 0; return 0;
return 1; return 1;

View File

@ -28,13 +28,13 @@
#ifdef HAVE_PLUGINS #ifdef HAVE_PLUGINS
void plugins_init(); void plugins_init(void);
void plugins_free(); void plugins_free(void);
void plugins_create_active_list(); void plugins_create_active_list(void);
void plugins_update_tools_menu(); void plugins_update_tools_menu(void);
void plugins_update_document_sensitive(gboolean enabled); void plugins_update_document_sensitive(gboolean enabled);

View File

@ -287,4 +287,8 @@ br_prepend_prefix (void *symbol, char *path)
return newpath; return newpath;
} }
#else /* ENABLE_BINRELOC */
typedef int iso_c_forbids_an_empty_source_file;
#endif /* ENABLE_BINRELOC */ #endif /* ENABLE_BINRELOC */

View File

@ -87,10 +87,10 @@ enum
{ {
KB_TREE_ACTION, KB_TREE_ACTION,
KB_TREE_SHORTCUT, KB_TREE_SHORTCUT,
KB_TREE_INDEX, KB_TREE_INDEX
}; };
static void init_kb_tree() static void init_kb_tree(void)
{ {
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
GtkTreeViewColumn *column; GtkTreeViewColumn *column;
@ -124,7 +124,7 @@ static void init_kb_tree()
} }
static void init_keybindings() static void init_keybindings(void)
{ {
GtkTreeIter parent, iter; GtkTreeIter parent, iter;
gint i; gint i;

View File

@ -75,7 +75,7 @@ typedef struct _PropertyDialogElements
static gboolean update_config(const PropertyDialogElements *e); static gboolean update_config(const PropertyDialogElements *e);
static void on_file_save_button_clicked(GtkButton *button, PropertyDialogElements *e); static void on_file_save_button_clicked(GtkButton *button, PropertyDialogElements *e);
static void on_file_open_button_clicked(GtkButton *button, PropertyDialogElements *e); static void on_file_open_button_clicked(GtkButton *button, PropertyDialogElements *e);
static gboolean close_open_project(); static gboolean close_open_project(void);
static gboolean load_config(const gchar *filename); static gboolean load_config(const gchar *filename);
static gboolean write_config(gboolean emit_signal); static gboolean write_config(gboolean emit_signal);
static void on_name_entry_changed(GtkEditable *editable, PropertyDialogElements *e); static void on_name_entry_changed(GtkEditable *editable, PropertyDialogElements *e);
@ -299,7 +299,7 @@ void project_open()
// Called when opening, closing and updating projects. // Called when opening, closing and updating projects.
static void update_ui() static void update_ui(void)
{ {
ui_set_window_title(-1); ui_set_window_title(-1);
build_menu_update(-1); build_menu_update(-1);

View File

@ -54,28 +54,28 @@ typedef struct
extern ProjectPrefs project_prefs; extern ProjectPrefs project_prefs;
void project_new(); void project_new(void);
void project_open(); void project_open(void);
void project_close(gboolean open_default); void project_close(gboolean open_default);
void project_properties(); void project_properties(void);
gboolean project_load_file(const gchar *locale_file_name); gboolean project_load_file(const gchar *locale_file_name);
gchar *project_get_base_path(); gchar *project_get_base_path(void);
gchar *project_get_make_dir(); gchar *project_get_make_dir(void);
void project_save_prefs(GKeyFile *config); void project_save_prefs(GKeyFile *config);
void project_load_prefs(GKeyFile *config); void project_load_prefs(GKeyFile *config);
void project_setup_prefs(); void project_setup_prefs(void);
void project_apply_prefs(); void project_apply_prefs(void);
#endif #endif

View File

@ -807,7 +807,7 @@ void sci_target_end(ScintillaObject *sci, gint end)
gint sci_target_replace(ScintillaObject *sci, const gchar *text, gboolean regex) gint sci_target_replace(ScintillaObject *sci, const gchar *text, gboolean regex)
{ {
return SSM(sci, (regex) ? SCI_REPLACETARGETRE : SCI_REPLACETARGET, -1, (sptr_t) text); return SSM(sci, (regex) ? SCI_REPLACETARGETRE : SCI_REPLACETARGET, (uptr_t) -1, (sptr_t) text);
} }

View File

@ -108,7 +108,7 @@ static gboolean
search_find_in_files(const gchar *search_text, const gchar *dir, const gchar *opts); search_find_in_files(const gchar *search_text, const gchar *dir, const gchar *opts);
void search_init() void search_init(void)
{ {
widgets.find_dialog = NULL; widgets.find_dialog = NULL;
widgets.replace_dialog = NULL; widgets.replace_dialog = NULL;
@ -120,7 +120,7 @@ void search_init()
#define FREE_WIDGET(wid) \ #define FREE_WIDGET(wid) \
if (wid && GTK_IS_WIDGET(wid)) gtk_widget_destroy(wid); if (wid && GTK_IS_WIDGET(wid)) gtk_widget_destroy(wid);
void search_finalize() void search_finalize(void)
{ {
FREE_WIDGET(widgets.find_dialog); FREE_WIDGET(widgets.find_dialog);
FREE_WIDGET(widgets.replace_dialog); FREE_WIDGET(widgets.replace_dialog);
@ -257,7 +257,7 @@ void search_find_selection(gint idx, gboolean search_backwards)
} }
void search_show_find_dialog() void search_show_find_dialog(void)
{ {
gint idx = document_get_cur_idx(); gint idx = document_get_cur_idx();
gchar *sel = NULL; gchar *sel = NULL;
@ -376,7 +376,7 @@ static void send_replace_dialog_response(GtkButton *button, gpointer user_data)
} }
void search_show_replace_dialog() void search_show_replace_dialog(void)
{ {
gint idx = document_get_cur_idx(); gint idx = document_get_cur_idx();
gchar *sel = NULL; gchar *sel = NULL;
@ -1012,7 +1012,7 @@ on_widget_key_pressed_set_focus(GtkWidget *widget, GdkEventKey *event, gpointer
} }
static GString *get_grep_options() static GString *get_grep_options(void)
{ {
gboolean fgrep = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON( gboolean fgrep = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
lookup_widget(widgets.find_in_files_dialog, "radio_fgrep"))); lookup_widget(widgets.find_in_files_dialog, "radio_fgrep")));

View File

@ -47,13 +47,13 @@ typedef struct
extern SearchPrefs search_prefs; extern SearchPrefs search_prefs;
void search_init(); void search_init(void);
void search_finalize(); void search_finalize(void);
void search_show_find_dialog(); void search_show_find_dialog(void);
void search_show_replace_dialog(); void search_show_replace_dialog(void);
void search_show_find_in_files_dialog(const gchar *dir); void search_show_find_in_files_dialog(const gchar *dir);

View File

@ -91,10 +91,13 @@
#endif #endif
struct socket_info_struct socket_info;
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
static gint socket_fd_connect_inet (gushort port); static gint socket_fd_connect_inet (gushort port);
static gint socket_fd_open_inet (gushort port); static gint socket_fd_open_inet (gushort port);
static void socket_init_win32(); static void socket_init_win32 (void);
#else #else
static gint socket_fd_connect_unix (const gchar *path); static gint socket_fd_connect_unix (const gchar *path);
static gint socket_fd_open_unix (const gchar *path); static gint socket_fd_open_unix (const gchar *path);
@ -160,7 +163,7 @@ void send_open_command(gint sock, gint argc, gchar **argv)
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
static void remove_socket_link_full() static void remove_socket_link_full(void)
{ {
gchar real_path[512]; gchar real_path[512];
gsize len; gsize len;
@ -457,7 +460,7 @@ static gint socket_fd_connect_inet(gushort port)
} }
static void socket_init_win32() static void socket_init_win32(void)
{ {
WSADATA wsadata; WSADATA wsadata;

View File

@ -26,20 +26,22 @@
#define GEANY_SOCKET_H 1 #define GEANY_SOCKET_H 1
struct struct socket_info_struct
{ {
gboolean ignore_socket; gboolean ignore_socket;
gchar *file_name; gchar *file_name;
GIOChannel *read_ioc; GIOChannel *read_ioc;
gint lock_socket; gint lock_socket;
gint lock_socket_tag; gint lock_socket_tag;
} socket_info; };
extern struct socket_info_struct socket_info;
gint socket_init(gint argc, gchar **argv); gint socket_init(gint argc, gchar **argv);
gboolean socket_lock_input_cb(GIOChannel *source, GIOCondition condition, gpointer data); gboolean socket_lock_input_cb(GIOChannel *source, GIOCondition condition, gpointer data);
gint socket_finalize(); gint socket_finalize(void);
#endif #endif

View File

@ -83,7 +83,7 @@ static TagFileInfo tag_file_info[GTF_MAX] =
static gchar *user_tags_dir; static gchar *user_tags_dir;
static void html_tags_loaded(); static void html_tags_loaded(void);
static void load_user_tags(filetype_id ft_id); static void load_user_tags(filetype_id ft_id);
/* tags_ignore is a NULL-terminated array of strings, read from ~/.geany/ignore.tags. /* tags_ignore is a NULL-terminated array of strings, read from ~/.geany/ignore.tags.
@ -91,7 +91,7 @@ static void load_user_tags(filetype_id ft_id);
* by the C/C++ parser, see -I command line option of ctags for details. */ * by the C/C++ parser, see -I command line option of ctags for details. */
gchar **c_tags_ignore = NULL; gchar **c_tags_ignore = NULL;
static void load_c_ignore_tags() static void load_c_ignore_tags(void)
{ {
gchar *path = g_strconcat(app->configdir, G_DIR_SEPARATOR_S "ignore.tags", NULL); gchar *path = g_strconcat(app->configdir, G_DIR_SEPARATOR_S "ignore.tags", NULL);
gchar *content; gchar *content;
@ -158,7 +158,7 @@ void symbols_global_tags_loaded(gint file_type_idx)
// HTML tagfile is just a list of entities for autocompletion (e.g. '&amp;') // HTML tagfile is just a list of entities for autocompletion (e.g. '&amp;')
static void html_tags_loaded() static void html_tags_loaded(void)
{ {
TagFileInfo *tfi; TagFileInfo *tfi;
@ -244,7 +244,7 @@ const gchar *symbols_get_context_separator(gint ft_id)
} }
GString *symbols_get_macro_list() GString *symbols_get_macro_list(void)
{ {
guint j, i; guint j, i;
const GPtrArray *tags; const GPtrArray *tags;
@ -319,7 +319,7 @@ static TMTag *find_workspace_tag(const gchar *tag_name, gint type)
} }
const gchar **symbols_get_html_entities() const gchar **symbols_get_html_entities(void)
{ {
if (html_entities == NULL) if (html_entities == NULL)
html_tags_loaded(); // if not yet created, force creation of the array but shouldn't occur html_tags_loaded(); // if not yet created, force creation of the array but shouldn't occur
@ -328,7 +328,7 @@ const gchar **symbols_get_html_entities()
} }
void symbols_finalize() void symbols_finalize(void)
{ {
g_strfreev(html_entities); g_strfreev(html_entities);
g_strfreev(c_tags_ignore); g_strfreev(c_tags_ignore);
@ -411,7 +411,7 @@ static const GList *get_tag_list(gint idx, guint tag_types, gboolean sort_by_nam
if (tag->type & tag_types) if (tag->type & tag_types)
{ {
if (! doc_is_utf8) utf8_name = encodings_convert_to_utf8_from_charset(tag->name, if (! doc_is_utf8) utf8_name = encodings_convert_to_utf8_from_charset(tag->name,
-1, doc_list[idx].encoding, TRUE); (gsize)-1, doc_list[idx].encoding, TRUE);
else utf8_name = tag->name; else utf8_name = tag->name;
if (utf8_name == NULL) if (utf8_name == NULL)
@ -462,7 +462,7 @@ struct TreeviewSymbols
} tv_iters; } tv_iters;
static void init_tag_iters() static void init_tag_iters(void)
{ {
// init all GtkTreeIters with -1 to make them invalid to avoid crashes when switching between // init all GtkTreeIters with -1 to make them invalid to avoid crashes when switching between
// filetypes(e.g. config file to Python crashes Geany without this) // filetypes(e.g. config file to Python crashes Geany without this)
@ -965,7 +965,7 @@ int symbols_generate_global_tags(int argc, char **argv, gboolean want_preprocess
} }
void symbols_show_load_tags_dialog() void symbols_show_load_tags_dialog(void)
{ {
GtkWidget *dialog; GtkWidget *dialog;
GtkFileFilter *filter; GtkFileFilter *filter;
@ -1037,7 +1037,7 @@ static GHashTable *get_tagfile_hash(const GSList *file_list)
} }
static GHashTable *init_user_tags() static GHashTable *init_user_tags(void)
{ {
GSList *file_list; GSList *file_list;
GHashTable *lang_hash; GHashTable *lang_hash;

View File

@ -37,17 +37,17 @@ const gchar *symbols_get_context_separator(gint ft_id);
const GList *symbols_get_tag_list(gint idx, guint tag_types); const GList *symbols_get_tag_list(gint idx, guint tag_types);
GString *symbols_get_macro_list(); GString *symbols_get_macro_list(void);
const gchar **symbols_get_html_entities(); const gchar **symbols_get_html_entities(void);
void symbols_finalize(); void symbols_finalize(void);
gboolean symbols_recreate_tag_list(gint idx, gboolean sort_by_name); gboolean symbols_recreate_tag_list(gint idx, gboolean sort_by_name);
gint symbols_generate_global_tags(gint argc, gchar **argv, gboolean want_preprocess); gint symbols_generate_global_tags(gint argc, gchar **argv, gboolean want_preprocess);
void symbols_show_load_tags_dialog(); void symbols_show_load_tags_dialog(void);
gboolean symbols_goto_tag(const gchar *name, gboolean definition); gboolean symbols_goto_tag(const gchar *name, gboolean definition);

View File

@ -333,7 +333,7 @@ on_new_with_template (GtkMenuItem *menuitem,
// template items for the new file menu // template items for the new file menu
static void create_new_menu_items() static void create_new_menu_items(void)
{ {
GtkWidget *template_menu = lookup_widget(app->window, "menu_new_with_template1_menu"); GtkWidget *template_menu = lookup_widget(app->window, "menu_new_with_template1_menu");
filetype_id ft_id; filetype_id ft_id;

View File

@ -209,7 +209,7 @@ void tools_execute_custom_command(gint idx, const gchar *command)
} }
static void cc_show_dialog_custom_commands() static void cc_show_dialog_custom_commands(void)
{ {
GtkWidget *dialog, *label, *vbox, *button; GtkWidget *dialog, *label, *vbox, *button;
guint i; guint i;
@ -389,7 +389,7 @@ static void cc_insert_custom_command_items(GtkMenu *me, GtkMenu *mp, gchar *labe
} }
void tools_create_insert_custom_command_menu_items() void tools_create_insert_custom_command_menu_items(void)
{ {
GtkMenu *menu_edit = GTK_MENU(lookup_widget(app->window, "send_selection_to2_menu")); GtkMenu *menu_edit = GTK_MENU(lookup_widget(app->window, "send_selection_to2_menu"));
GtkMenu *menu_popup = GTK_MENU(lookup_widget(app->popup_menu, "send_selection_to1_menu")); GtkMenu *menu_popup = GTK_MENU(lookup_widget(app->popup_menu, "send_selection_to1_menu"));
@ -509,7 +509,7 @@ word_count(gchar *text, guint *chars, guint *lines, guint *words)
} }
void tools_word_count() void tools_word_count(void)
{ {
GtkWidget *dialog, *label, *vbox, *table; GtkWidget *dialog, *label, *vbox, *table;
gint idx; gint idx;

View File

@ -25,12 +25,12 @@
#ifndef GEANY_TOOLS_H #ifndef GEANY_TOOLS_H
#define GEANY_TOOLS_H 1 #define GEANY_TOOLS_H 1
void tools_create_insert_custom_command_menu_items(); void tools_create_insert_custom_command_menu_items(void);
void tools_execute_custom_command(gint idx, const gchar *command); void tools_execute_custom_command(gint idx, const gchar *command);
void tools_word_count(); void tools_word_count(void);
void tools_color_chooser(gchar *color); void tools_color_chooser(gchar *color);

View File

@ -232,7 +232,7 @@ gboolean on_treeviews_tooltip_queried(GtkWidget *widget, gint x, gint y, gboolea
/* does some preparing things to the open files list widget */ /* does some preparing things to the open files list widget */
static void prepare_openfiles() static void prepare_openfiles(void)
{ {
GtkCellRenderer *renderer; GtkCellRenderer *renderer;
GtkTreeViewColumn *column; GtkTreeViewColumn *column;
@ -356,7 +356,7 @@ void treeviews_remove_document(gint idx)
} }
static void create_taglist_popup_menu() static void create_taglist_popup_menu(void)
{ {
GtkWidget *item; GtkWidget *item;
@ -423,7 +423,7 @@ static void on_list_symbol_activate(GtkCheckMenuItem *item, gpointer user_data)
} }
static void create_openfiles_popup_menu() static void create_openfiles_popup_menu(void)
{ {
GtkWidget *item; GtkWidget *item;

View File

@ -42,10 +42,10 @@ enum
SYMBOLS_COLUMN_ICON, SYMBOLS_COLUMN_ICON,
SYMBOLS_COLUMN_NAME, SYMBOLS_COLUMN_NAME,
SYMBOLS_COLUMN_LINE, SYMBOLS_COLUMN_LINE,
SYMBOLS_N_COLUMNS, SYMBOLS_N_COLUMNS
}; };
void treeviews_init(); void treeviews_init(void);
void treeviews_update_tag_list(gint idx, gboolean update); void treeviews_update_tag_list(gint idx, gboolean update);
@ -53,7 +53,7 @@ void treeviews_openfiles_add(gint idx);
void treeviews_openfiles_update(gint idx); void treeviews_openfiles_update(gint idx);
void treeviews_openfiles_update_all(); void treeviews_openfiles_update_all(void);
void treeviews_select_openfiles_item(gint idx); void treeviews_select_openfiles_item(gint idx);

View File

@ -59,7 +59,7 @@ widgets;
static gchar *menu_item_get_text(GtkMenuItem *menu_item); static gchar *menu_item_get_text(GtkMenuItem *menu_item);
static void update_recent_menu(); static void update_recent_menu(void);
static void recent_file_loaded(const gchar *utf8_filename); static void recent_file_loaded(const gchar *utf8_filename);
static void static void
recent_file_activate_cb (GtkMenuItem *menuitem, recent_file_activate_cb (GtkMenuItem *menuitem,
@ -262,7 +262,7 @@ void ui_set_editor_font(const gchar *font_name)
} }
void ui_set_fullscreen() void ui_set_fullscreen(void)
{ {
if (ui_prefs.fullscreen) if (ui_prefs.fullscreen)
{ {
@ -361,7 +361,7 @@ void ui_update_insert_include_item(gint idx, gint item)
} }
void ui_update_fold_items() void ui_update_fold_items(void)
{ {
ui_widget_show_hide(lookup_widget(app->window, "menu_fold_all1"), editor_prefs.folding); ui_widget_show_hide(lookup_widget(app->window, "menu_fold_all1"), editor_prefs.folding);
ui_widget_show_hide(lookup_widget(app->window, "menu_unfold_all1"), editor_prefs.folding); ui_widget_show_hide(lookup_widget(app->window, "menu_unfold_all1"), editor_prefs.folding);
@ -403,7 +403,7 @@ static void insert_include_items(GtkMenu *me, GtkMenu *mp, gchar **includes, gch
} }
void ui_create_insert_menu_items() void ui_create_insert_menu_items(void)
{ {
GtkMenu *menu_edit = GTK_MENU(lookup_widget(app->window, "insert_include2_menu")); GtkMenu *menu_edit = GTK_MENU(lookup_widget(app->window, "insert_include2_menu"));
GtkMenu *menu_popup = GTK_MENU(lookup_widget(app->popup_menu, "insert_include1_menu")); GtkMenu *menu_popup = GTK_MENU(lookup_widget(app->popup_menu, "insert_include1_menu"));
@ -470,7 +470,7 @@ static void insert_date_items(GtkMenu *me, GtkMenu *mp, gchar *label)
} }
void ui_create_insert_date_menu_items() void ui_create_insert_date_menu_items(void)
{ {
GtkMenu *menu_edit = GTK_MENU(lookup_widget(app->window, "insert_date1_menu")); GtkMenu *menu_edit = GTK_MENU(lookup_widget(app->window, "insert_date1_menu"));
GtkMenu *menu_popup = GTK_MENU(lookup_widget(app->popup_menu, "insert_date2_menu")); GtkMenu *menu_popup = GTK_MENU(lookup_widget(app->popup_menu, "insert_date2_menu"));
@ -542,7 +542,7 @@ void ui_save_buttons_toggle(gboolean enable)
} }
static void init_document_widgets() static void init_document_widgets(void)
{ {
/* Cache the document-sensitive widgets so we don't have to keep looking them up /* Cache the document-sensitive widgets so we don't have to keep looking them up
* when using ui_document_buttons_update(). */ * when using ui_document_buttons_update(). */
@ -594,7 +594,7 @@ static void init_document_widgets()
} }
void ui_document_buttons_update() void ui_document_buttons_update(void)
{ {
guint i; guint i;
gboolean enable = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) ? TRUE : FALSE; gboolean enable = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) ? TRUE : FALSE;
@ -621,7 +621,7 @@ void ui_widget_show_hide(GtkWidget *widget, gboolean show)
} }
void ui_sidebar_show_hide() void ui_sidebar_show_hide(void)
{ {
GtkWidget *widget; GtkWidget *widget;
@ -720,7 +720,7 @@ void ui_update_toolbar_icons(GtkIconSize size)
} }
void ui_update_toolbar_items() void ui_update_toolbar_items(void)
{ {
// show toolbar // show toolbar
GtkWidget *widget = lookup_widget(app->window, "menu_show_toolbar1"); GtkWidget *widget = lookup_widget(app->window, "menu_show_toolbar1");
@ -833,7 +833,7 @@ GtkWidget *ui_new_image_from_inline(gint img, gboolean small_img)
} }
void ui_create_recent_menu() void ui_create_recent_menu(void)
{ {
GtkWidget *tmp; GtkWidget *tmp;
guint i; guint i;
@ -973,7 +973,7 @@ static void recent_file_loaded(const gchar *utf8_filename)
} }
static void update_recent_menu() static void update_recent_menu(void)
{ {
GtkWidget *tmp; GtkWidget *tmp;
static GtkMenuToolButton *menu = NULL; static GtkMenuToolButton *menu = NULL;
@ -1028,7 +1028,7 @@ static void update_recent_menu()
} }
void ui_show_markers_margin() void ui_show_markers_margin(void)
{ {
gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook));
@ -1040,7 +1040,7 @@ void ui_show_markers_margin()
} }
void ui_show_linenumber_margin() void ui_show_linenumber_margin(void)
{ {
gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook));
@ -1397,7 +1397,7 @@ void ui_table_add_row(GtkTable *table, gint row, ...)
} }
void ui_init() void ui_init(void)
{ {
init_document_widgets(); init_document_widgets();
} }

View File

@ -100,7 +100,7 @@ void ui_table_add_row(GtkTable *table, gint row, ...) G_GNUC_NULL_TERMINATED;
/* End of 'generic' functions */ /* End of 'generic' functions */
void ui_init(); void ui_init(void);
void ui_set_statusbar(gboolean log, const gchar *format, ...) G_GNUC_PRINTF (2, 3); void ui_set_statusbar(gboolean log, const gchar *format, ...) G_GNUC_PRINTF (2, 3);
@ -113,7 +113,7 @@ void ui_set_window_title(gint index);
void ui_set_editor_font(const gchar *font_name); void ui_set_editor_font(const gchar *font_name);
void ui_set_fullscreen(); void ui_set_fullscreen(void);
void ui_update_popup_reundo_items(gint idx); void ui_update_popup_reundo_items(gint idx);
@ -127,27 +127,27 @@ void ui_update_menu_copy_items(gint idx);
void ui_update_insert_include_item(gint idx, gint item); void ui_update_insert_include_item(gint idx, gint item);
void ui_update_fold_items(); void ui_update_fold_items(void);
void ui_create_insert_menu_items(); void ui_create_insert_menu_items(void);
void ui_create_insert_date_menu_items(); void ui_create_insert_date_menu_items(void);
void ui_save_buttons_toggle(gboolean enable); void ui_save_buttons_toggle(gboolean enable);
void ui_document_buttons_update(); void ui_document_buttons_update(void);
void ui_sidebar_show_hide(); void ui_sidebar_show_hide(void);
void ui_document_show_hide(gint idx); void ui_document_show_hide(gint idx);
void ui_update_toolbar_icons(GtkIconSize size); void ui_update_toolbar_icons(GtkIconSize size);
void ui_update_toolbar_items(); void ui_update_toolbar_items(void);
GdkPixbuf *ui_new_pixbuf_from_inline(gint img, gboolean small_img); GdkPixbuf *ui_new_pixbuf_from_inline(gint img, gboolean small_img);
@ -155,20 +155,20 @@ GdkPixbuf *ui_new_pixbuf_from_inline(gint img, gboolean small_img);
GtkWidget *ui_new_image_from_inline(gint img, gboolean small_img); GtkWidget *ui_new_image_from_inline(gint img, gboolean small_img);
void ui_create_recent_menu(); void ui_create_recent_menu(void);
void ui_add_recent_file(const gchar *utf8_filename); void ui_add_recent_file(const gchar *utf8_filename);
void ui_show_markers_margin(); void ui_show_markers_margin(void);
void ui_show_linenumber_margin(); void ui_show_linenumber_margin(void);
void ui_update_tab_status(gint idx); void ui_update_tab_status(gint idx);
typedef gboolean TVMatchCallback(); typedef gboolean TVMatchCallback(void);
gboolean ui_tree_view_find_next(GtkTreeView *treeview, TVMatchCallback cb); gboolean ui_tree_view_find_next(GtkTreeView *treeview, TVMatchCallback cb);

View File

@ -719,7 +719,7 @@ gchar utils_brace_opposite(gchar ch)
} }
gchar *utils_get_hostname() gchar *utils_get_hostname(void)
{ {
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
return win32_get_hostname(); return win32_get_hostname();
@ -769,7 +769,7 @@ gint utils_is_file_writeable(const gchar *locale_filename)
# define DIR_SEP "" # define DIR_SEP ""
#endif #endif
gint utils_make_settings_dir() gint utils_make_settings_dir(void)
{ {
gint saved_errno = 0; gint saved_errno = 0;
gchar *conf_file = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL); gchar *conf_file = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
@ -1118,7 +1118,7 @@ gchar *utils_get_hex_from_color(GdkColor *color)
/* Get directory from current file in the notebook. /* Get directory from current file in the notebook.
* Returns dir string that should be freed or NULL, depending on whether current file is valid. * Returns dir string that should be freed or NULL, depending on whether current file is valid.
* Returned string is in UTF-8 encoding */ * Returned string is in UTF-8 encoding */
gchar *utils_get_current_file_dir_utf8() gchar *utils_get_current_file_dir_utf8(void)
{ {
gint cur_idx = document_get_cur_idx(); gint cur_idx = document_get_cur_idx();
@ -1139,7 +1139,7 @@ gchar *utils_get_current_file_dir_utf8()
/* very simple convenience function */ /* very simple convenience function */
void utils_beep() void utils_beep(void)
{ {
if (prefs.beep_on_errors) gdk_beep(); if (prefs.beep_on_errors) gdk_beep();
} }
@ -1240,7 +1240,7 @@ gint utils_strtod(const gchar *source, gchar **end, gboolean with_route)
// Returns: newly allocated string with the current time formatted HH:MM:SS. // Returns: newly allocated string with the current time formatted HH:MM:SS.
gchar *utils_get_current_time_string() gchar *utils_get_current_time_string(void)
{ {
const time_t tp = time(NULL); const time_t tp = time(NULL);
const struct tm *tmval = localtime(&tp); const struct tm *tmval = localtime(&tp);
@ -1778,7 +1778,7 @@ gboolean utils_string_replace_all(GString *haystack, const gchar *needle, const
/* Get project or default startup directory (if set), or NULL. */ /* Get project or default startup directory (if set), or NULL. */
const gchar *utils_get_default_dir_utf8() const gchar *utils_get_default_dir_utf8(void)
{ {
if (app->project && NZV(app->project->base_path)) if (app->project && NZV(app->project->base_path))
{ {

View File

@ -82,9 +82,9 @@ gchar *utils_remove_ext_from_filename(const gchar *filename);
gchar utils_brace_opposite(gchar ch); gchar utils_brace_opposite(gchar ch);
gchar *utils_get_hostname(); gchar *utils_get_hostname(void);
gint utils_make_settings_dir(); gint utils_make_settings_dir(void);
gboolean utils_string_replace_all(GString *str, const gchar *needle, const gchar *replace); gboolean utils_string_replace_all(GString *str, const gchar *needle, const gchar *replace);
@ -108,18 +108,18 @@ void utils_replace_filename(gint idx);
gchar *utils_get_hex_from_color(GdkColor *color); gchar *utils_get_hex_from_color(GdkColor *color);
const gchar *utils_get_default_dir_utf8(); const gchar *utils_get_default_dir_utf8(void);
gchar *utils_get_current_file_dir_utf8(); gchar *utils_get_current_file_dir_utf8(void);
void utils_beep(); void utils_beep(void);
gchar *utils_make_human_readable_str(unsigned long long size, gulong block_size, gchar *utils_make_human_readable_str(unsigned long long size, gulong block_size,
gulong display_unit); gulong display_unit);
gint utils_strtod(const gchar *source, gchar **end, gboolean with_route); gint utils_strtod(const gchar *source, gchar **end, gboolean with_route);
gchar *utils_get_current_time_string(); gchar *utils_get_current_time_string(void);
GIOChannel *utils_set_up_io_channel(gint fd, GIOCondition cond, gboolean nblock, GIOChannel *utils_set_up_io_channel(gint fd, GIOCondition cond, gboolean nblock,
GIOFunc func, gpointer data); GIOFunc func, gpointer data);

View File

@ -46,6 +46,7 @@
VteInfo vte_info; VteInfo vte_info;
VteConfig *vc;
extern gchar **environ; extern gchar **environ;
static pid_t pid; static pid_t pid;
@ -63,7 +64,7 @@ static const gchar VTE_WORDCHARS[] = "-A-Za-z0-9,./?%&#:_";
#define VTE_TERMINAL(obj) (GTK_CHECK_CAST((obj), VTE_TYPE_TERMINAL, VteTerminal)) #define VTE_TERMINAL(obj) (GTK_CHECK_CAST((obj), VTE_TYPE_TERMINAL, VteTerminal))
#define VTE_TYPE_TERMINAL (vf->vte_terminal_get_type()) #define VTE_TYPE_TERMINAL (vf->vte_terminal_get_type())
static void create_vte(); static void create_vte(void);
static void vte_start(GtkWidget *widget); static void vte_start(GtkWidget *widget);
static gboolean vte_button_pressed(GtkWidget *widget, GdkEventButton *event, gpointer user_data); static gboolean vte_button_pressed(GtkWidget *widget, GdkEventButton *event, gpointer user_data);
static gboolean vte_keyrelease(GtkWidget *widget, GdkEventKey *event, gpointer data); static gboolean vte_keyrelease(GtkWidget *widget, GdkEventKey *event, gpointer data);
@ -87,7 +88,7 @@ enum
TARGET_TEXT, TARGET_TEXT,
TARGET_COMPOUND_TEXT, TARGET_COMPOUND_TEXT,
TARGET_STRING, TARGET_STRING,
TARGET_TEXT_PLAIN, TARGET_TEXT_PLAIN
}; };
static const GtkTargetEntry dnd_targets[] = static const GtkTargetEntry dnd_targets[] =
@ -140,7 +141,7 @@ static gchar **vte_get_child_environment(void)
} }
static void override_menu_key() static void override_menu_key(void)
{ {
if (gtk_menu_key_accel == NULL) // for restoring the default value if (gtk_menu_key_accel == NULL) // for restoring the default value
g_object_get(G_OBJECT(gtk_settings_get_default()), "gtk-menu-bar-accel", g_object_get(G_OBJECT(gtk_settings_get_default()), "gtk-menu-bar-accel",
@ -206,7 +207,7 @@ void vte_init(void)
} }
static void create_vte() static void create_vte(void)
{ {
GtkWidget *vte, *scrollbar, *hbox, *frame; GtkWidget *vte, *scrollbar, *hbox, *frame;
@ -532,7 +533,7 @@ gboolean vte_send_cmd(const gchar *cmd)
/* Taken from Terminal by os-cillation: terminal_screen_get_working_directory, thanks. /* Taken from Terminal by os-cillation: terminal_screen_get_working_directory, thanks.
* Determines the working directory using various OS-specific mechanisms. */ * Determines the working directory using various OS-specific mechanisms. */
const gchar* vte_get_working_directory() const gchar* vte_get_working_directory(void)
{ {
gchar buffer[4096 + 1]; gchar buffer[4096 + 1];
gchar *file; gchar *file;
@ -631,7 +632,7 @@ static void check_run_in_vte_toggled(GtkToggleButton *togglebutton, GtkWidget *u
} }
void vte_append_preferences_tab() void vte_append_preferences_tab(void)
{ {
if (vte_info.have_vte) if (vte_info.have_vte)
{ {

View File

@ -63,7 +63,7 @@ typedef struct
GdkColor *colour_fore; GdkColor *colour_fore;
GdkColor *colour_back; GdkColor *colour_back;
} VteConfig; } VteConfig;
VteConfig *vc; extern VteConfig *vc;
void vte_init(void); void vte_init(void);
@ -78,7 +78,7 @@ const gchar* vte_get_working_directory(void);
void vte_cwd(const gchar *filename, gboolean force); void vte_cwd(const gchar *filename, gboolean force);
void vte_append_preferences_tab(); void vte_append_preferences_tab(void);
/* /*
void vte_drag_data_received(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, void vte_drag_data_received(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y,

View File

@ -434,7 +434,7 @@ static const char *getVarType (const statementInfo *const st);
*/ */
/* Debugging functions added by Biswa */ /* Debugging functions added by Biswa */
#if DEBUG_C #if defined(DEBUG_C) && DEBUG_C
static char *tokenTypeName[] = { static char *tokenTypeName[] = {
"none", "args", "'}'", "'{'", "','", "'::'", "keyword", "name", "none", "args", "'}'", "'{'", "','", "'::'", "keyword", "name",
"package", "paren-name", "';'", "spec", "*", "[]", "count" "package", "paren-name", "';'", "spec", "*", "[]", "count"

View File

@ -32,7 +32,7 @@ typedef enum {
K_SECT1, K_SECT1,
K_SECT2, K_SECT2,
K_SECT3, K_SECT3,
K_APPENDIX, K_APPENDIX
} docbookKind; } docbookKind;
static kindOption DocBookKinds [] = { static kindOption DocBookKinds [] = {

View File

@ -51,7 +51,7 @@ typedef const unsigned char *custr;
*/ */
static void skip_rest_of_line() static void skip_rest_of_line(void)
{ {
int c; int c;
do { do {
@ -71,7 +71,7 @@ static int get_line(char *buf)
return i; return i;
} }
static int get_next_char() static int get_next_char(void)
{ {
int c, nxt; int c, nxt;
c = fileGetc(); c = fileGetc();

View File

@ -56,7 +56,7 @@ typedef struct _TMWorkspace
a workspace is created. Subsequent calls to the function will return the a workspace is created. Subsequent calls to the function will return the
created workspace. created workspace.
*/ */
const TMWorkspace *tm_get_workspace(); const TMWorkspace *tm_get_workspace(void);
/*! Adds a work object (source file or project) to the workspace. /*! Adds a work object (source file or project) to the workspace.
\param work_object The work object to add to the project. \param work_object The work object to add to the project.

View File

@ -111,7 +111,7 @@ static void failedSort (FILE *const fp, const char* msg)
if (fp != NULL) if (fp != NULL)
fclose (fp); fclose (fp);
if (msg == NULL) if (msg == NULL)
error (FATAL | PERROR, cannotSort); error (FATAL | PERROR, "%s", cannotSort);
else else
error (FATAL, "%s: %s", msg, cannotSort); error (FATAL, "%s: %s", msg, cannotSort);
} }

View File

@ -29,7 +29,7 @@
static TMWorkspace *theWorkspace = NULL; static TMWorkspace *theWorkspace = NULL;
guint workspace_class_id = 0; guint workspace_class_id = 0;
static gboolean tm_create_workspace() static gboolean tm_create_workspace(void)
{ {
workspace_class_id = tm_work_object_register(tm_workspace_free, tm_workspace_update workspace_class_id = tm_work_object_register(tm_workspace_free, tm_workspace_update
, tm_workspace_find_object); , tm_workspace_find_object);
@ -709,7 +709,7 @@ tm_get_current_function (GPtrArray * file_tags, const gulong line)
return function_tag; return function_tag;
} }
return NULL; return NULL;
}; }
const GPtrArray *tm_workspace_get_parents(const gchar *name) const GPtrArray *tm_workspace_get_parents(const gchar *name)