[bijiben] src: Mark various internal functions as static
- From: Jonathan Kang <jonathankang src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben] src: Mark various internal functions as static
- Date: Wed, 19 Apr 2017 09:36:14 +0000 (UTC)
commit 2ec0b0c4d8c3b273d37f2708e1c2bc7da418c07c
Author: Philip Withnall <philip withnall collabora co uk>
Date: Wed Apr 19 17:33:31 2017 +0800
src: Mark various internal functions as static
This will provide slight optimisations when linking, but mostly just
shuts up compiler warnings about functions being defined before they’re
declared.
https://bugzilla.gnome.org/show_bug.cgi?id=762648
src/bijiben-shell-search-provider.c | 8 +++---
src/bjb-main-toolbar.c | 8 +++---
src/bjb-main-view.c | 18 ++++++------
src/bjb-settings-dialog.c | 6 ++--
src/libbiji/biji-note-obj.c | 8 +++---
src/libbiji/deserializer/biji-lazy-deserializer.c | 28 ++++++++++----------
src/libbiji/provider/biji-import-provider.c | 2 +-
src/libbiji/provider/biji-local-note.c | 8 +++---
src/libbiji/provider/biji-local-provider.c | 2 +-
src/libbiji/provider/biji-memo-note.c | 2 +-
src/libbiji/provider/biji-memo-provider.c | 8 +++---
src/libbiji/provider/biji-own-cloud-note.c | 4 +-
src/libbiji/provider/biji-own-cloud-provider.c | 4 +-
src/libbiji/serializer/biji-lazy-serializer.c | 20 +++++++-------
14 files changed, 63 insertions(+), 63 deletions(-)
---
diff --git a/src/bijiben-shell-search-provider.c b/src/bijiben-shell-search-provider.c
index 0ea055e..0df1732 100644
--- a/src/bijiben-shell-search-provider.c
+++ b/src/bijiben-shell-search-provider.c
@@ -21,8 +21,8 @@
/*
* Adapted from Nautilus shell-search-provider
- *
- * Authors:
+ *
+ * Authors:
* Original code : Cosimo Cecchi <cosimoc gnome org>
* Bijiben : Pierre-Yves Luyten <py luyten fr>
*
@@ -83,7 +83,7 @@ bjb_perform_query (BijibenShellSearchProviderApp *self, gchar * query )
return result ;
}
-GList *
+static GList *
biji_get_notes_with_strings (BijibenShellSearchProviderApp *self, gchar **needles)
{
gint parser;
@@ -283,7 +283,7 @@ add_single_note_meta (BijibenShellSearchProviderApp *self,
g_variant_builder_close (results);
}
-
+
g_object_unref (cursor);
}
diff --git a/src/bjb-main-toolbar.c b/src/bjb-main-toolbar.c
index e0a1190..49e7f4c 100644
--- a/src/bjb-main-toolbar.c
+++ b/src/bjb-main-toolbar.c
@@ -5,12 +5,12 @@
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* bijiben is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -151,7 +151,7 @@ update_selection_label (BjbMainToolbar *self)
return TRUE;
}
-void
+static void
on_view_selection_changed_cb (BjbMainToolbar *self)
{
GtkStyleContext *context;
@@ -736,7 +736,7 @@ on_detached_clicked_cb (BjbMainToolbar *self)
}
-GtkWidget *
+static GtkWidget *
bjb_note_menu_new (BjbMainToolbar *self)
{
BjbMainToolbarPrivate *priv = self->priv;
diff --git a/src/bjb-main-view.c b/src/bjb-main-view.c
index 8c1acc4..b04d92e 100644
--- a/src/bjb-main-view.c
+++ b/src/bjb-main-view.c
@@ -1,16 +1,16 @@
/* bjb-main-view.c
* Copyright (C) Pierre-Yves LUYTEN 2012 <py luyten fr>
- *
+ *
* bijiben is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* bijiben is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -86,7 +86,7 @@ static void bjb_main_view_view_changed (BjbMainView *self);
static void
bjb_main_view_init (BjbMainView *object)
{
- object->priv =
+ object->priv =
G_TYPE_INSTANCE_GET_PRIVATE(object,BJB_TYPE_MAIN_VIEW,BjbMainViewPriv);
object->priv->key = 0;
@@ -258,7 +258,7 @@ switch_to_item (BjbMainView *view, BijiItem *to_open)
static GList *
get_selected_paths(BjbMainView *self)
{
- return gd_main_view_get_selection ( self->priv->view ) ;
+ return gd_main_view_get_selection ( self->priv->view ) ;
}
static gchar *
@@ -268,7 +268,7 @@ get_note_url_from_tree_path(GtkTreePath *path, BjbMainView *self)
gchar *note_path ;
GtkTreeModel *model ;
- model = bjb_controller_get_model(self->priv->controller);
+ model = bjb_controller_get_model(self->priv->controller);
gtk_tree_model_get_iter (model,&iter, path);
gtk_tree_model_get (model, &iter,GD_MAIN_COLUMN_URI, ¬e_path,-1);
@@ -378,7 +378,7 @@ on_item_activated (GdMainView * gd,
g_return_val_if_fail (item_path != NULL, FALSE); // #709197
/* Switch to that item */
- manager = bjb_window_base_get_manager (view->priv->window);
+ manager = bjb_window_base_get_manager (view->priv->window);
to_open = biji_manager_get_item_at_path (manager, item_path);
g_free (item_path);
@@ -458,14 +458,14 @@ bjb_main_view_connect_signals (BjbMainView *self)
G_CALLBACK (on_drag_data_received), self);
}
-void
+static void
__destroy_n_notify__ (gpointer data)
{
}
-BijiItem *
+static BijiItem *
_get_item_for_tree_path (GtkTreeModel *tree_model,
GtkTreeIter *iter,
BjbMainView *self)
diff --git a/src/bjb-settings-dialog.c b/src/bjb-settings-dialog.c
index 96604f7..8f7e95d 100644
--- a/src/bjb-settings-dialog.c
+++ b/src/bjb-settings-dialog.c
@@ -1,6 +1,6 @@
/*
* bjb_settings_dialog.c
- *
+ *
* Copyright © 2013 Pierre-Yves LUYTEN <py luyten fr>
*
* bijiben is free software: you can redistribute it and/or modify it
@@ -335,7 +335,7 @@ add_child (gpointer provider_info, gpointer user_data)
}
-GtkWidget *
+static GtkWidget *
create_page_primary (BjbSettingsDialog *self)
{
BjbSettingsDialogPrivate *priv;
@@ -372,7 +372,7 @@ create_page_primary (BjbSettingsDialog *self)
/* Edition page (font, color) */
-GtkWidget *
+static GtkWidget *
create_page_edition (BjbSettingsDialog *self)
{
BjbSettingsDialogPrivate *priv;
diff --git a/src/libbiji/biji-note-obj.c b/src/libbiji/biji-note-obj.c
index 5f0f28f..6f86dca 100644
--- a/src/libbiji/biji-note-obj.c
+++ b/src/libbiji/biji-note-obj.c
@@ -234,7 +234,7 @@ biji_note_obj_are_same (BijiNoteObj *a, BijiNoteObj* b)
/* First cancel timeout
* this func is most probably stupid it might exists (move file) */
-gboolean
+static gboolean
biji_note_obj_trash (BijiItem *item)
{
BijiNoteObj *note_to_kill;
@@ -478,7 +478,7 @@ biji_note_obj_get_notebooks (BijiNoteObj *n)
return g_hash_table_get_values (n->priv->labels);
}
-gboolean
+static gboolean
biji_note_obj_has_notebook (BijiItem *item, gchar *label)
{
BijiNoteObj *note = BIJI_NOTE_OBJ (item);
@@ -501,7 +501,7 @@ _biji_notebook_refresh (gboolean query_result,
}
-/*static */ gboolean
+static gboolean
biji_note_obj_add_notebook (BijiItem *item,
BijiItem *notebook,
gchar *title)
@@ -533,7 +533,7 @@ biji_note_obj_add_notebook (BijiItem *item,
}
-gboolean
+static gboolean
biji_note_obj_remove_notebook (BijiItem *item, BijiItem *notebook)
{
g_return_val_if_fail (BIJI_IS_NOTE_OBJ (item), FALSE);
diff --git a/src/libbiji/deserializer/biji-lazy-deserializer.c
b/src/libbiji/deserializer/biji-lazy-deserializer.c
index e3c3603..2559524 100644
--- a/src/libbiji/deserializer/biji-lazy-deserializer.c
+++ b/src/libbiji/deserializer/biji-lazy-deserializer.c
@@ -6,12 +6,12 @@
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* WebkitWebView is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -39,7 +39,7 @@ enum
#define TOMBOY_NS "http://beatniksoftware.com/tomboy"
-typedef enum
+typedef enum
{
NO_TYPE,
BIJIBEN_1,
@@ -97,7 +97,7 @@ biji_lazy_deserializer_set_property (GObject *object,
BijiLazyDeserializer *self = BIJI_LAZY_DESERIALIZER (object);
switch (property_id)
- {
+ {
case PROP_NOTE:
self->priv->note = g_value_get_object (value);
break;
@@ -211,7 +211,7 @@ process_tomboy_end_elem (BijiLazyDeserializer *self)
{
BijiLazyDeserializerPrivate *priv = self->priv;
const gchar *element_name;
-
+
element_name = (const gchar *) xmlTextReaderConstName (priv->inner);
if (g_strcmp0 (element_name, "note-content")==0)
@@ -257,7 +257,7 @@ process_tomboy_node (BijiLazyDeserializer *self)
type = xmlTextReaderNodeType (priv->inner);
name = xmlTextReaderConstName (priv->inner);
-
+
if (name == NULL)
name = BAD_CAST "(NULL)";
@@ -452,7 +452,7 @@ process_bijiben_html_content (BijiLazyDeserializer *self,
/* Common XML format for both Bijiben / Tomboy */
static void
-processNode (BijiLazyDeserializer *self)
+processNode (BijiLazyDeserializer *self)
{
xmlTextReaderPtr r = self->priv->r;
BijiNoteObj * n = self->priv->note;
@@ -503,7 +503,7 @@ processNode (BijiLazyDeserializer *self)
free (result);
}
- if (g_strcmp0 ((gchar*) name, "color") == 0 )
+ if (g_strcmp0 ((gchar*) name, "color") == 0 )
{
color_str = (gchar*) xmlTextReaderReadString (r);
@@ -516,7 +516,7 @@ processNode (BijiLazyDeserializer *self)
free (color_str);
}
- if ( g_strcmp0((gchar*)name,"tag") == 0 )
+ if ( g_strcmp0((gchar*)name,"tag") == 0 )
{
tag = (gchar*) xmlTextReaderReadString(r);
@@ -551,19 +551,19 @@ biji_parse_file (BijiLazyDeserializer *self)
}
}
-gboolean
+static gboolean
biji_lazy_deserialize_internal (BijiLazyDeserializer *self)
{
BijiNoteObj* n = self->priv->note;
const gchar *path;
xmlDocPtr doc;
xmlNodePtr cur;
- xmlChar *version;
+ xmlChar *version;
path = biji_item_get_uuid (BIJI_ITEM (n));
doc = xmlParseFile (path);
- if (doc == NULL )
+ if (doc == NULL )
{
g_warning ("File not parsed successfully");
return FALSE;
@@ -571,14 +571,14 @@ biji_lazy_deserialize_internal (BijiLazyDeserializer *self)
cur = xmlDocGetRootElement (doc);
- if (cur == NULL)
+ if (cur == NULL)
{
g_warning ("File empty");
xmlFreeDoc(doc);
return FALSE;
}
- if (xmlStrcmp(cur->name, (const xmlChar *) "note"))
+ if (xmlStrcmp(cur->name, (const xmlChar *) "note"))
{
g_message ("document of the wrong type, root node != note");
xmlFreeDoc(doc);
diff --git a/src/libbiji/provider/biji-import-provider.c b/src/libbiji/provider/biji-import-provider.c
index 81f04b1..7da19a3 100644
--- a/src/libbiji/provider/biji-import-provider.c
+++ b/src/libbiji/provider/biji-import-provider.c
@@ -250,7 +250,7 @@ biji_import_provider_constructed (GObject *object)
}
-const BijiProviderInfo *
+static const BijiProviderInfo *
biji_import_provider_get_info (BijiProvider *self)
{
return & (BIJI_IMPORT_PROVIDER (self)->priv->info);
diff --git a/src/libbiji/provider/biji-local-note.c b/src/libbiji/provider/biji-local-note.c
index 0afb6c6..c0841a2 100644
--- a/src/libbiji/provider/biji-local-note.c
+++ b/src/libbiji/provider/biji-local-note.c
@@ -36,7 +36,7 @@ G_DEFINE_TYPE (BijiLocalNote, biji_local_note, BIJI_TYPE_NOTE_OBJ)
/* Iface */
-const gchar *
+static const gchar *
local_note_get_place (BijiItem *local)
{
BijiLocalNote *self;
@@ -51,7 +51,7 @@ local_note_get_place (BijiItem *local)
}
-gchar *
+static gchar *
local_note_get_html (BijiNoteObj *note)
{
if (BIJI_IS_LOCAL_NOTE (note))
@@ -62,7 +62,7 @@ local_note_get_html (BijiNoteObj *note)
}
-void
+static void
local_note_set_html (BijiNoteObj *note,
const gchar *html)
{
@@ -74,7 +74,7 @@ local_note_set_html (BijiNoteObj *note,
}
-void
+static void
local_note_save (BijiNoteObj *note)
{
const BijiProviderInfo *prov_info;
diff --git a/src/libbiji/provider/biji-local-provider.c b/src/libbiji/provider/biji-local-provider.c
index 733bbfc..eb25196 100644
--- a/src/libbiji/provider/biji-local-provider.c
+++ b/src/libbiji/provider/biji-local-provider.c
@@ -539,7 +539,7 @@ biji_local_provider_get_property (GObject *object,
}
-const BijiProviderInfo *
+static const BijiProviderInfo *
local_provider_get_info (BijiProvider *provider)
{
BijiLocalProvider *self;
diff --git a/src/libbiji/provider/biji-memo-note.c b/src/libbiji/provider/biji-memo-note.c
index c9154ab..640f7cd 100644
--- a/src/libbiji/provider/biji-memo-note.c
+++ b/src/libbiji/provider/biji-memo-note.c
@@ -48,7 +48,7 @@ static GParamSpec *properties[MEMO_NOTE_PROP] = { NULL, };
/* Function from evo calendar gui comp-util.c (LGPL)
* to be removed if we depen on evo,
* the func is borrowed as is (=3.13.1) */
-gboolean
+static gboolean
cal_comp_is_on_server (ECalComponent *comp,
ECalClient *client)
{
diff --git a/src/libbiji/provider/biji-memo-provider.c b/src/libbiji/provider/biji-memo-provider.c
index 711a68c..14f89d9 100644
--- a/src/libbiji/provider/biji-memo-provider.c
+++ b/src/libbiji/provider/biji-memo-provider.c
@@ -323,7 +323,7 @@ on_object_list_got (GObject *obj,
-static gchar *
+static const gchar *
i_want_all_memos (void)
{
return "occur-in-time-range? (make-time \"19820421T204153Z\") (make-time \"20820423T232416Z\")";
@@ -376,7 +376,7 @@ on_notes_mined (GObject *source_object,
/* From gnome-calendar -> ported to GdkRGBA */
-GdkPixbuf*
+static GdkPixbuf*
get_pixbuf_from_color (GdkRGBA *color, gint size)
{
cairo_surface_t *surface;
@@ -533,7 +533,7 @@ on_object_created (GObject *client,
-BijiNoteObj *
+static BijiNoteObj *
memo_create_note (BijiProvider *provider,
const gchar *str)
{
@@ -717,7 +717,7 @@ biji_memo_provider_get_property (GObject *object,
-const BijiProviderInfo *
+static const BijiProviderInfo *
memo_provider_get_info (BijiProvider *provider)
{
return &(BIJI_MEMO_PROVIDER (provider)->priv->info);
diff --git a/src/libbiji/provider/biji-own-cloud-note.c b/src/libbiji/provider/biji-own-cloud-note.c
index 74c591b..5e15f51 100644
--- a/src/libbiji/provider/biji-own-cloud-note.c
+++ b/src/libbiji/provider/biji-own-cloud-note.c
@@ -54,7 +54,7 @@ G_DEFINE_TYPE (BijiOwnCloudNote, biji_own_cloud_note, BIJI_TYPE_NOTE_OBJ)
-const gchar *
+static const gchar *
ocloud_note_get_place (BijiItem *local)
{
BijiOwnCloudNote *self;
@@ -154,7 +154,7 @@ ocloud_note_ensure_ressource (BijiNoteObj *note)
/* TODO: propagate error if any
* through generic provider -> manager */
-void
+static void
on_content_replaced (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
diff --git a/src/libbiji/provider/biji-own-cloud-provider.c b/src/libbiji/provider/biji-own-cloud-provider.c
index 5256c0d..3b2e3c9 100644
--- a/src/libbiji/provider/biji-own-cloud-provider.c
+++ b/src/libbiji/provider/biji-own-cloud-provider.c
@@ -901,7 +901,7 @@ own_cloud_get_info (BijiProvider *provider)
* things will go right.
* Promise. */
-BijiNoteObj *
+static BijiNoteObj *
own_cloud_create_note (BijiProvider *provider,
const gchar *str)
{
@@ -927,7 +927,7 @@ own_cloud_create_note (BijiProvider *provider,
/* This is a dummy func. we can create a note with extra args
* but can't use path, nor color, nor html. */
-BijiNoteObj *
+static BijiNoteObj *
own_cloud_create_full (BijiProvider *provider,
const gchar *suggested_path,
BijiInfoSet *info,
diff --git a/src/libbiji/serializer/biji-lazy-serializer.c b/src/libbiji/serializer/biji-lazy-serializer.c
index 15ba46b..eef19f2 100644
--- a/src/libbiji/serializer/biji-lazy-serializer.c
+++ b/src/libbiji/serializer/biji-lazy-serializer.c
@@ -6,12 +6,12 @@
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* WebkitWebView is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -162,7 +162,7 @@ serialize_html (BijiLazySerializer *self)
xmlTextWriterWriteRaw(priv->writer, BAD_CAST html);
}
-gboolean
+static gboolean
biji_lazy_serialize_internal (BijiLazySerializer *self)
{
BijiLazySerializerPrivate *priv = self->priv;
@@ -179,15 +179,15 @@ biji_lazy_serialize_internal (BijiLazySerializer *self)
xmlTextWriterStartDocument (priv->writer,"1.0","utf-8",NULL);
xmlTextWriterStartElement (priv->writer, BAD_CAST "note");
- xmlTextWriterWriteAttributeNS (priv->writer, NULL,
- BAD_CAST "version",NULL,
+ xmlTextWriterWriteAttributeNS (priv->writer, NULL,
+ BAD_CAST "version",NULL,
BAD_CAST "1");
xmlTextWriterWriteAttributeNS (priv->writer, BAD_CAST "xmlns",
- BAD_CAST "link", NULL,
+ BAD_CAST "link", NULL,
BAD_CAST "http://projects.gnome.org/bijiben/link");
xmlTextWriterWriteAttributeNS (priv->writer, BAD_CAST "xmlns", BAD_CAST "size", NULL,
BAD_CAST "http://projects.gnome.org/bijiben/size");
- xmlTextWriterWriteAttributeNS (priv->writer, NULL, BAD_CAST "xmlns", NULL,
+ xmlTextWriterWriteAttributeNS (priv->writer, NULL, BAD_CAST "xmlns", NULL,
BAD_CAST "http://projects.gnome.org/bijiben");
// <Title>
@@ -195,14 +195,14 @@ biji_lazy_serialize_internal (BijiLazySerializer *self)
"title",
(gchar*) biji_item_get_title (BIJI_ITEM (priv->note)));
- // <text>
+ // <text>
xmlTextWriterWriteRaw(priv->writer, BAD_CAST "\n ");
xmlTextWriterStartElement(priv->writer, BAD_CAST "text");
xmlTextWriterWriteAttributeNS(priv->writer, BAD_CAST "xml",
- BAD_CAST "space", NULL,
+ BAD_CAST "space", NULL,
BAD_CAST "preserve");
serialize_html (self);
- // </text>
+ // </text>
xmlTextWriterEndElement(priv->writer);
// <last-change-date>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]