From b98069855b35ba9fba9c8f592d5b627bc1aca92d Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 16 Jan 2009 20:34:34 +0000 Subject: [PATCH] Prevent type-punned pointer warnings with gcc 4.1. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3473 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 6 ++++++ src/keyfile.c | 4 ++-- src/project.c | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index eda120c4..226b0214 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-16 Nick Treleaven + + * src/project.c, src/keyfile.c: + Prevent type-punned pointer warnings with gcc 4.1. + + 2009-01-15 Enrico Tröger * src/main.c, doc/geany.txt, doc/geany.html, doc/geany.1.in: diff --git a/src/keyfile.c b/src/keyfile.c index 14490efb..285f7775 100644 --- a/src/keyfile.c +++ b/src/keyfile.c @@ -138,9 +138,9 @@ static void init_pref_groups(void) "pref_editor_tab_width", 4, "spin_indent_width"); stash_group_add_spin_button_integer(group, &editor_prefs.indentation->hard_tab_width, "indent_hard_tab_width", 8, "spin_tab_width"); - stash_group_add_combo_box(group, (gint*)&editor_prefs.indentation->auto_indent_mode, + stash_group_add_combo_box(group, (gint*)(void*)&editor_prefs.indentation->auto_indent_mode, "indent_mode", GEANY_AUTOINDENT_CURRENTCHARS, "combo_auto_indent_mode"); - stash_group_add_radio_buttons(group, (gint*)&editor_prefs.indentation->type, + stash_group_add_radio_buttons(group, (gint*)(void*)&editor_prefs.indentation->type, "indent_type", GEANY_INDENT_TYPE_TABS, "radio_indent_spaces", GEANY_INDENT_TYPE_SPACES, "radio_indent_tabs", GEANY_INDENT_TYPE_TABS, diff --git a/src/project.c b/src/project.c index bbd7ca40..87acf0b0 100644 --- a/src/project.c +++ b/src/project.c @@ -1110,7 +1110,7 @@ void project_init(void) stash_group_add_spin_button_integer(group, &indentation.width, "indent_width", 4, "spin_indent_width"); - stash_group_add_radio_buttons(group, (gint*)&indentation.type, + stash_group_add_radio_buttons(group, (gint*)(gpointer)&indentation.type, "indent_type", GEANY_INDENT_TYPE_TABS, "radio_indent_spaces", GEANY_INDENT_TYPE_SPACES, "radio_indent_tabs", GEANY_INDENT_TYPE_TABS, @@ -1120,7 +1120,7 @@ void project_init(void) "indent_hard_tab_width", 8, "spin_tab_width"); stash_group_add_toggle_button(group, &indentation.detect_type, "detect_indent", FALSE, "check_detect_indent"); - stash_group_add_combo_box(group, (gint*)&indentation.auto_indent_mode, + stash_group_add_combo_box(group, (gint*)(gpointer)&indentation.auto_indent_mode, "indent_mode", GEANY_AUTOINDENT_CURRENTCHARS, "combo_auto_indent_mode"); }