aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorKjartan Maraas <kmaraas@gnome.org>2007-10-24 22:11:25 +0800
committerKjartan Maraas <kmaraas@src.gnome.org>2007-10-24 22:11:25 +0800
commitfaae84477af9ba732358930d7d6ba57f16c4a6df (patch)
tree236ae64f47381d5e713fcaf81a981944f1a5d150 /addressbook
parenta1fb36c15210deac4ca989703587060c549c6e51 (diff)
downloadgsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar
gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.gz
gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.bz2
gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.lz
gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.xz
gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.zst
gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.zip
Warning fixes: - mixing code and declarations - NULL vs 0 vs FALSE/TRUE -
2007-10-23 Kjartan Maraas <kmaraas@gnome.org> * gui/contact-editor/e-contact-editor-address.c: * gui/contact-editor/e-contact-editor-fullname.c: * gui/contact-editor/e-contact-editor-im.c: * gui/contact-editor/e-contact-editor.c: (save_contact), (app_delete_event_cb), (e_contact_editor_set_property), (e_contact_editor_create_date): * gui/contact-list-editor/e-contact-list-model.c: (e_contact_list_model_new): * gui/merging/eab-contact-merging.c: (mergeit), (response): * gui/widgets/e-minicard.c: (e_minicard_event), (add_field), (get_email_location), (add_email_field), (remodel), (e_minicard_reflow), (e_minicard_compare): * gui/widgets/eab-config.c: (eab_config_new): * gui/widgets/eab-gui-util.c: (eab_load_error_dialog), (file_exists), (save_it), (contact_added_cb), (eab_send_to_contact_and_email_num_list): * gui/widgets/eab-menu.c: (eab_menu_new): * gui/widgets/eab-popup.c: (eab_popup_new): * importers/evolution-csv-importer.c: (parseLine), (getNextCSVEntry): * printing/e-contact-print-style-editor.c: * printing/test-contact-print-style-editor.c: * printing/test-print.c: * util/eab-book-util.c: (eab_get_config_database): Warning fixes: - mixing code and declarations - NULL vs 0 vs FALSE/TRUE - mark code static - some coding style fixes - if vs ifdef - Remove some unused bits - ANSIfication of declarations svn path=/trunk/; revision=34421
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog36
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-address.c2
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.c2
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-im.c2
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c18
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.c2
-rw-r--r--addressbook/gui/merging/eab-contact-merging.c4
-rw-r--r--addressbook/gui/widgets/e-minicard.c23
-rw-r--r--addressbook/gui/widgets/eab-config.c6
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c2
-rw-r--r--addressbook/gui/widgets/eab-menu.c6
-rw-r--r--addressbook/gui/widgets/eab-popup.c12
-rw-r--r--addressbook/importers/evolution-csv-importer.c6
-rw-r--r--addressbook/printing/e-contact-print-style-editor.c2
-rw-r--r--addressbook/printing/test-contact-print-style-editor.c2
-rw-r--r--addressbook/printing/test-print.c3
-rw-r--r--addressbook/util/eab-book-util.c2
17 files changed, 83 insertions, 47 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 4872b843de..7cbc7d0c6c 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,39 @@
+2007-10-23 Kjartan Maraas <kmaraas@gnome.org>
+
+ * gui/contact-editor/e-contact-editor-address.c:
+ * gui/contact-editor/e-contact-editor-fullname.c:
+ * gui/contact-editor/e-contact-editor-im.c:
+ * gui/contact-editor/e-contact-editor.c: (save_contact),
+ (app_delete_event_cb), (e_contact_editor_set_property),
+ (e_contact_editor_create_date):
+ * gui/contact-list-editor/e-contact-list-model.c:
+ (e_contact_list_model_new):
+ * gui/merging/eab-contact-merging.c: (mergeit), (response):
+ * gui/widgets/e-minicard.c: (e_minicard_event), (add_field),
+ (get_email_location), (add_email_field), (remodel),
+ (e_minicard_reflow), (e_minicard_compare):
+ * gui/widgets/eab-config.c: (eab_config_new):
+ * gui/widgets/eab-gui-util.c: (eab_load_error_dialog),
+ (file_exists), (save_it), (contact_added_cb),
+ (eab_send_to_contact_and_email_num_list):
+ * gui/widgets/eab-menu.c: (eab_menu_new):
+ * gui/widgets/eab-popup.c: (eab_popup_new):
+ * importers/evolution-csv-importer.c: (parseLine),
+ (getNextCSVEntry):
+ * printing/e-contact-print-style-editor.c:
+ * printing/test-contact-print-style-editor.c:
+ * printing/test-print.c:
+ * util/eab-book-util.c: (eab_get_config_database):
+
+ Warning fixes:
+ - mixing code and declarations
+ - NULL vs 0 vs FALSE/TRUE
+ - mark code static
+ - some coding style fixes
+ - if vs ifdef
+ - Remove some unused bits
+ - ANSIfication of declarations
+
2007-10-23 Tobias Mueller <tobiasmue@svn.gnome.org>
Patch by Michael Monreal <michael.monreal@gmx.net>
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c
index b3cd0880e0..06e79d61d6 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-address.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-address.c
@@ -463,7 +463,7 @@ e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address)
}
}
-void
+static void
e_contact_editor_address_dispose (GObject *object)
{
EContactEditorAddress *e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS(object);
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
index 25aa8a6f14..daaffd01de 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
@@ -148,7 +148,7 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam
}
}
-void
+static void
e_contact_editor_fullname_dispose (GObject *object)
{
EContactEditorFullname *e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME(object);
diff --git a/addressbook/gui/contact-editor/e-contact-editor-im.c b/addressbook/gui/contact-editor/e-contact-editor-im.c
index c6bc9d951b..93e6da7cae 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-im.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-im.c
@@ -297,7 +297,7 @@ e_contact_editor_im_init (EContactEditorIm *e_contact_editor_im)
}
}
-void
+static void
e_contact_editor_im_dispose (GObject *object)
{
EContactEditorIm *e_contact_editor_im = E_CONTACT_EDITOR_IM(object);
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 20a48a511d..d5dc2bae53 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -2980,7 +2980,9 @@ static void
save_contact (EContactEditor *ce, gboolean should_close)
{
char *uid;
-
+ const char *name_entry_string, *file_as_entry_string, *company_name_string;
+ GtkWidget *entry_fullname, *entry_file_as, *company_name;
+
if (!ce->target_book)
return;
@@ -2990,12 +2992,12 @@ save_contact (EContactEditor *ce, gboolean should_close)
return;
}
- GtkWidget *entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" );
- GtkWidget *entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as");
- GtkWidget *company_name = glade_xml_get_widget (ce->gui, "entry-company");
- const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname));
- const char *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as));
- const char *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name));
+ entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" );
+ entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as");
+ company_name = glade_xml_get_widget (ce->gui, "entry-company");
+ name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname));
+ file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as));
+ company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name));
if (strcmp (company_name_string , "")) {
if (!strcmp (name_entry_string, ""))
@@ -3388,7 +3390,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
gtk_widget_show (e_contact_editor->app);
}
-void
+static void
e_contact_editor_dispose (GObject *object)
{
EContactEditor *e_contact_editor = E_CONTACT_EDITOR(object);
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c
index c75bbb95d7..d0597e9eea 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c
@@ -162,7 +162,7 @@ e_contact_list_model_construct (EContactListModel *model)
}
ETableModel *
-e_contact_list_model_new ()
+e_contact_list_model_new (void)
{
EContactListModel *model;
diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c
index 446868643c..a37f877fd8 100644
--- a/addressbook/gui/merging/eab-contact-merging.c
+++ b/addressbook/gui/merging/eab-contact-merging.c
@@ -185,7 +185,7 @@ mergeit (EContactMergingLookup *lookup)
int num_of_email;
GList *email_attr_list;
int row = -1;
- int value = 0;
+ int value = 0, result;
dialog = (GtkDialog *)(gtk_dialog_new_with_buttons (_("Merge Contact"), NULL, GTK_DIALOG_NO_SEPARATOR, NULL));
gtk_container_border_width (GTK_CONTAINER(dialog), 5);
@@ -332,7 +332,7 @@ mergeit (EContactMergingLookup *lookup)
gtk_widget_show (scrolled_window);
g_signal_connect (dialog, "map-event", G_CALLBACK (dialog_map), table);
gtk_widget_show_all ((GtkWidget *)table);
- gint result = gtk_dialog_run (dialog);
+ result = gtk_dialog_run (dialog);
switch (result)
{
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 216401a69f..7132389379 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -738,7 +738,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
if (GNOME_CANVAS_ITEM_CLASS( parent_class )->event)
return (* GNOME_CANVAS_ITEM_CLASS( parent_class )->event) (item, event);
else
- return 0;
+ return FALSE;
}
static void
@@ -1021,28 +1021,29 @@ remodel( EMinicard *e_minicard )
}
static void
-e_minicard_reflow( GnomeCanvasItem *item, int flags )
+e_minicard_reflow(GnomeCanvasItem *item, int flags)
{
EMinicard *e_minicard = E_MINICARD(item);
- if ( GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED ) {
+ if (GTK_OBJECT_FLAGS (e_minicard) & GNOME_CANVAS_ITEM_REALIZED) {
GList *list;
gdouble text_height;
gint old_height;
old_height = e_minicard->height;
- g_object_get( e_minicard->header_text,
+ g_object_get(e_minicard->header_text,
"text_height", &text_height,
- NULL );
+ NULL);
e_minicard->height = text_height + 10.0;
- gnome_canvas_item_set( e_minicard->header_rect,
+ gnome_canvas_item_set(e_minicard->header_rect,
"y2", text_height + 9.0,
- NULL );
+ NULL);
for(list = e_minicard->fields; list; list = g_list_next(list)) {
EMinicardField *field = E_MINICARD_FIELD(list->data);
+ /* Why not use the item that is passed in? */
GnomeCanvasItem *item = field->label;
g_object_get (item,
"height", &text_height,
@@ -1052,13 +1053,13 @@ e_minicard_reflow( GnomeCanvasItem *item, int flags )
}
e_minicard->height += 2;
- gnome_canvas_item_set( e_minicard->rect,
+ gnome_canvas_item_set(e_minicard->rect,
"x2", (double) e_minicard->width - 1.0,
"y2", (double) e_minicard->height - 1.0,
- NULL );
- gnome_canvas_item_set( e_minicard->header_rect,
+ NULL);
+ gnome_canvas_item_set(e_minicard->header_rect,
"x2", (double) e_minicard->width - 3.0,
- NULL );
+ NULL);
if (old_height != e_minicard->height)
e_canvas_item_request_parent_reflow(item);
diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c
index ee95ea3582..967ef370b7 100644
--- a/addressbook/gui/widgets/eab-config.c
+++ b/addressbook/gui/widgets/eab-config.c
@@ -127,7 +127,7 @@ eab_config_get_type (void)
EABConfig *
eab_config_new (int type, const char *menuid)
{
- EABConfig *ecp = g_object_new (eab_config_get_type(), 0);
+ EABConfig *ecp = g_object_new (eab_config_get_type(), NULL);
e_config_construct (&ecp->config, type, menuid);
return ecp;
}
@@ -144,12 +144,12 @@ eab_config_target_new_source (EABConfig *ecp, struct _ESource *source)
}
static const EConfigHookTargetMask ecph_no_masks[] = {
- { 0 }
+ { NULL }
};
static const EConfigHookTargetMap ecph_targets[] = {
{ "source", EAB_CONFIG_TARGET_SOURCE, ecph_no_masks },
- { 0 },
+ { NULL },
};
static void
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index dba4653f87..f7ed275698 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -108,7 +108,7 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
}
else if (!strncmp (uri, "ldap:", 5)) {
/* special case for ldap: contact folders so we can tell the user about openldap */
-#if HAVE_LDAP
+#ifdef HAVE_LDAP
label_string =
_("We were unable to open this addressbook. This either "
"means you have entered an incorrect URI, or the LDAP server "
diff --git a/addressbook/gui/widgets/eab-menu.c b/addressbook/gui/widgets/eab-menu.c
index 9b8e912642..c35cd6ba61 100644
--- a/addressbook/gui/widgets/eab-menu.c
+++ b/addressbook/gui/widgets/eab-menu.c
@@ -100,7 +100,7 @@ eab_menu_get_type(void)
EABMenu *eab_menu_new(const char *menuid)
{
- EABMenu *emp = g_object_new(eab_menu_get_type(), 0);
+ EABMenu *emp = g_object_new(eab_menu_get_type(), NULL);
e_menu_construct(&emp->menu, menuid);
@@ -208,12 +208,12 @@ static const EMenuHookTargetMask eabmph_select_masks[] = {
{ "any", EAB_MENU_SELECT_ANY },
{ "editable", EAB_MENU_SELECT_EDITABLE },
{ "email", EAB_MENU_SELECT_EMAIL },
- { 0 }
+ { NULL }
};
static const EMenuHookTargetMap eabmph_targets[] = {
{ "select", EAB_MENU_TARGET_SELECT, eabmph_select_masks },
- { 0 }
+ { NULL }
};
static void
diff --git a/addressbook/gui/widgets/eab-popup.c b/addressbook/gui/widgets/eab-popup.c
index 59a64cd549..d37c1b7b73 100644
--- a/addressbook/gui/widgets/eab-popup.c
+++ b/addressbook/gui/widgets/eab-popup.c
@@ -116,7 +116,7 @@ eab_popup_get_type(void)
EABPopup *eab_popup_new(const char *menuid)
{
- EABPopup *eabp = g_object_new(eab_popup_get_type(), 0);
+ EABPopup *eabp = g_object_new(eab_popup_get_type(), NULL);
e_popup_construct(&eabp->popup, menuid);
@@ -298,24 +298,24 @@ static const EPopupHookTargetMask eabph_select_masks[] = {
{ "any", EAB_POPUP_SELECT_ANY },
{ "editable", EAB_POPUP_SELECT_EDITABLE },
{ "email", EAB_POPUP_SELECT_EMAIL },
- { 0 }
+ { NULL }
};
static const EPopupHookTargetMask eabph_source_masks[] = {
{ "primary", EAB_POPUP_SOURCE_PRIMARY },
{ "system", EAB_POPUP_SOURCE_SYSTEM },
- { 0 }
+ { NULL }
};
static const EPopupHookTargetMask eabph_uri_masks[] = {
{ "http", EAB_POPUP_URI_HTTP },
{ "internal-mailto", EAB_POPUP_URI_MAILTO },
{ "notmailto", EAB_POPUP_URI_NOT_MAILTO },
- { 0 }
+ { NULL }
};
static const EPopupHookTargetMask eabph_select_names_masks[] = {
- { 0 }
+ { NULL }
};
static const EPopupHookTargetMap eabph_targets[] = {
@@ -323,7 +323,7 @@ static const EPopupHookTargetMap eabph_targets[] = {
{ "uri", EAB_POPUP_TARGET_URI, eabph_uri_masks },
{ "source", EAB_POPUP_TARGET_SOURCE, eabph_source_masks },
{ "select-names", EAB_POPUP_TARGET_SELECT_NAMES, eabph_select_names_masks },
- { 0 }
+ { NULL }
};
static void
diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c
index a9ca04e77f..ade0e670db 100644
--- a/addressbook/importers/evolution-csv-importer.c
+++ b/addressbook/importers/evolution-csv-importer.c
@@ -86,7 +86,7 @@ typedef struct {
int flags;
}import_fields;
-import_fields csv_fields_outlook[] = {
+static import_fields csv_fields_outlook[] = {
{"Title", NOMAP},
{"First Name", E_CONTACT_GIVEN_NAME},
{"Middle Name", NOMAP},
@@ -181,7 +181,7 @@ import_fields csv_fields_outlook[] = {
{"Web Page", E_CONTACT_HOMEPAGE_URL},
};
-import_fields csv_fields_mozilla[] = {
+static import_fields csv_fields_mozilla[] = {
{"First Name", E_CONTACT_GIVEN_NAME},
{"Last Name", E_CONTACT_FAMILY_NAME},
{"Display Name", NOMAP},
@@ -222,7 +222,7 @@ import_fields csv_fields_mozilla[] = {
};
-import_fields csv_fields_evolution[] = {
+static import_fields csv_fields_evolution[] = {
{"First Name", E_CONTACT_GIVEN_NAME},
{"Last Name", E_CONTACT_FAMILY_NAME},
{"id", NOMAP, FLAG_INVALID},
diff --git a/addressbook/printing/e-contact-print-style-editor.c b/addressbook/printing/e-contact-print-style-editor.c
index abcf6f5003..0e4c3246b0 100644
--- a/addressbook/printing/e-contact-print-style-editor.c
+++ b/addressbook/printing/e-contact-print-style-editor.c
@@ -112,7 +112,7 @@ e_contact_print_style_editor_init (EContactPrintStyleEditor *e_contact_print_sty
GTK_WIDGET(e_contact_print_style_editor));
}
-void
+static void
e_contact_print_style_editor_destroy (GtkObject *object)
{
EContactPrintStyleEditor *e_contact_print_style_editor = E_CONTACT_PRINT_STYLE_EDITOR(object);
diff --git a/addressbook/printing/test-contact-print-style-editor.c b/addressbook/printing/test-contact-print-style-editor.c
index eae7e332ba..f5d20eea77 100644
--- a/addressbook/printing/test-contact-print-style-editor.c
+++ b/addressbook/printing/test-contact-print-style-editor.c
@@ -29,7 +29,7 @@
#include "e-contact-print-style-editor.h"
/* This is a horrible thing to do, but it is just a test. */
-GtkWidget *editor;
+static GtkWidget *editor;
static void destroy_callback(GtkWidget *app, gpointer data)
{
diff --git a/addressbook/printing/test-print.c b/addressbook/printing/test-print.c
index 6ed909b900..d86c33baea 100644
--- a/addressbook/printing/test-print.c
+++ b/addressbook/printing/test-print.c
@@ -29,9 +29,6 @@
#include <bonobo/bonobo-main.h>
#include "e-contact-print.h"
-/* This is a horrible thing to do, but it is just a test. */
-GtkWidget *print;
-
#if 0
static void about_callback( GtkWidget *widget, gpointer data )
{
diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c
index c5e86f6ff2..af73fe074b 100644
--- a/addressbook/util/eab-book-util.c
+++ b/addressbook/util/eab-book-util.c
@@ -34,7 +34,7 @@
#include <e-util/e-config-listener.h>
EConfigListener *
-eab_get_config_database ()
+eab_get_config_database (void)
{
static EConfigListener *config_db;