From 9cde2ffe5f64d07d10bbce479d5911af1b65758c Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Mon, 17 Aug 1998 14:47:49 +0000 Subject: [PATCH] made private functions static. Mon Aug 17 15:21:42 1998 Tim Janik * grel.c: made private functions static. --- ChangeLog | 4 ++++ ChangeLog.pre-2-0 | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-12 | 4 ++++ ChangeLog.pre-2-2 | 4 ++++ ChangeLog.pre-2-4 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ glib.h | 8 ++++---- glib/glib.h | 8 ++++---- glib/grel.c | 23 ++++++++++++++--------- glib/gstring.c | 16 +++++++++------- grel.c | 23 ++++++++++++++--------- gstring.c | 16 +++++++++------- 14 files changed, 86 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7b816f..e0f3a64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Aug 17 15:21:42 1998 Tim Janik + + * grel.c: made private functions static. + Sun Aug 16 23:23:46 CDT 1998 Shawn T. Amundson * gmodule/Makefile.am: added gmodule-dl.c and gmodule-dld.c to diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index b7b816f..e0f3a64 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,7 @@ +Mon Aug 17 15:21:42 1998 Tim Janik + + * grel.c: made private functions static. + Sun Aug 16 23:23:46 CDT 1998 Shawn T. Amundson * gmodule/Makefile.am: added gmodule-dl.c and gmodule-dld.c to diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b7b816f..e0f3a64 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +Mon Aug 17 15:21:42 1998 Tim Janik + + * grel.c: made private functions static. + Sun Aug 16 23:23:46 CDT 1998 Shawn T. Amundson * gmodule/Makefile.am: added gmodule-dl.c and gmodule-dld.c to diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index b7b816f..e0f3a64 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,7 @@ +Mon Aug 17 15:21:42 1998 Tim Janik + + * grel.c: made private functions static. + Sun Aug 16 23:23:46 CDT 1998 Shawn T. Amundson * gmodule/Makefile.am: added gmodule-dl.c and gmodule-dld.c to diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b7b816f..e0f3a64 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,7 @@ +Mon Aug 17 15:21:42 1998 Tim Janik + + * grel.c: made private functions static. + Sun Aug 16 23:23:46 CDT 1998 Shawn T. Amundson * gmodule/Makefile.am: added gmodule-dl.c and gmodule-dld.c to diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b7b816f..e0f3a64 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +Mon Aug 17 15:21:42 1998 Tim Janik + + * grel.c: made private functions static. + Sun Aug 16 23:23:46 CDT 1998 Shawn T. Amundson * gmodule/Makefile.am: added gmodule-dl.c and gmodule-dld.c to diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b7b816f..e0f3a64 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +Mon Aug 17 15:21:42 1998 Tim Janik + + * grel.c: made private functions static. + Sun Aug 16 23:23:46 CDT 1998 Shawn T. Amundson * gmodule/Makefile.am: added gmodule-dl.c and gmodule-dld.c to diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b7b816f..e0f3a64 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +Mon Aug 17 15:21:42 1998 Tim Janik + + * grel.c: made private functions static. + Sun Aug 16 23:23:46 CDT 1998 Shawn T. Amundson * gmodule/Makefile.am: added gmodule-dl.c and gmodule-dld.c to diff --git a/glib.h b/glib.h index a00194f..ab4dc84 100644 --- a/glib.h +++ b/glib.h @@ -672,7 +672,7 @@ GList* g_list_concat (GList *list1, GList* g_list_remove (GList *list, gpointer data); GList* g_list_remove_link (GList *list, - GList *link); + GList *llink); GList* g_list_reverse (GList *list); GList* g_list_nth (GList *list, guint n); @@ -682,7 +682,7 @@ GList* g_list_find_custom (GList *list, gpointer data, GCompareFunc func); gint g_list_position (GList *list, - GList *link); + GList *llink); gint g_list_index (GList *list, gpointer data); GList* g_list_last (GList *list); @@ -717,7 +717,7 @@ GSList* g_slist_concat (GSList *list1, GSList* g_slist_remove (GSList *list, gpointer data); GSList* g_slist_remove_link (GSList *list, - GSList *link); + GSList *llink); GSList* g_slist_reverse (GSList *list); GSList* g_slist_nth (GSList *list, guint n); @@ -727,7 +727,7 @@ GSList* g_slist_find_custom (GSList *list, gpointer data, GCompareFunc func); gint g_slist_position (GSList *list, - GSList *link); + GSList *llink); gint g_slist_index (GSList *list, gpointer data); GSList* g_slist_last (GSList *list); diff --git a/glib/glib.h b/glib/glib.h index a00194f..ab4dc84 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -672,7 +672,7 @@ GList* g_list_concat (GList *list1, GList* g_list_remove (GList *list, gpointer data); GList* g_list_remove_link (GList *list, - GList *link); + GList *llink); GList* g_list_reverse (GList *list); GList* g_list_nth (GList *list, guint n); @@ -682,7 +682,7 @@ GList* g_list_find_custom (GList *list, gpointer data, GCompareFunc func); gint g_list_position (GList *list, - GList *link); + GList *llink); gint g_list_index (GList *list, gpointer data); GList* g_list_last (GList *list); @@ -717,7 +717,7 @@ GSList* g_slist_concat (GSList *list1, GSList* g_slist_remove (GSList *list, gpointer data); GSList* g_slist_remove_link (GSList *list, - GSList *link); + GSList *llink); GSList* g_slist_reverse (GSList *list); GSList* g_slist_nth (GSList *list, guint n); @@ -727,7 +727,7 @@ GSList* g_slist_find_custom (GSList *list, gpointer data, GCompareFunc func); gint g_slist_position (GSList *list, - GSList *link); + GSList *llink); gint g_slist_index (GSList *list, gpointer data); GSList* g_slist_last (GSList *list); diff --git a/glib/grel.c b/glib/grel.c index e4c1f6e..979a7d1 100644 --- a/glib/grel.c +++ b/glib/grel.c @@ -41,8 +41,9 @@ struct _GRealTuples gpointer *data; }; -gboolean -tuple_equal_2 (gconstpointer v_a, gconstpointer v_b) +static gboolean +tuple_equal_2 (gconstpointer v_a, + gconstpointer v_b) { gpointer* a = (gpointer*) v_a; gpointer* b = (gpointer*) v_b; @@ -50,7 +51,7 @@ tuple_equal_2 (gconstpointer v_a, gconstpointer v_b) return a[0] == b[0] && a[1] == b[1]; } -guint +static guint tuple_hash_2 (gconstpointer v_a) { gpointer* a = (gpointer*) v_a; @@ -58,7 +59,7 @@ tuple_hash_2 (gconstpointer v_a) return (gulong)a[0] ^ (gulong)a[1]; } -GHashFunc +static GHashFunc tuple_hash (gint fields) { switch (fields) @@ -72,7 +73,7 @@ tuple_hash (gint fields) return NULL; } -GCompareFunc +static GCompareFunc tuple_equal (gint fields) { switch (fields) @@ -369,8 +370,10 @@ g_tuples_index (GTuples *tuples0, /* Print */ -void -g_relation_print_one (gpointer tuple_key, gpointer tuple_value, gpointer user_data) +static void +g_relation_print_one (gpointer tuple_key, + gpointer tuple_value, + gpointer user_data) { gint i; GRealRelation* rel = (GRealRelation*) user_data; @@ -389,8 +392,10 @@ g_relation_print_one (gpointer tuple_key, gpointer tuple_value, gpointer user_da g_print ("]\n"); } -void -g_relation_print_index (gpointer tuple_key, gpointer tuple_value, gpointer user_data) +static void +g_relation_print_index (gpointer tuple_key, + gpointer tuple_value, + gpointer user_data) { GRealRelation* rel = (GRealRelation*) user_data; GHashTable* table = (GHashTable*) tuple_value; diff --git a/glib/gstring.c b/glib/gstring.c index eee63ba..3454e8f 100644 --- a/glib/gstring.c +++ b/glib/gstring.c @@ -578,24 +578,26 @@ get_length_upper_bound (const gchar* fmt, va_list *args) return len; } -char* +extern gchar* g_vsprintf (const gchar *fmt, va_list *args, va_list *args2); +gchar* g_vsprintf (const gchar *fmt, - va_list *args, - va_list *args2) + va_list *args, + va_list *args2) { static gchar *buf = NULL; - static gint alloc = 0; + static guint alloc = 0; + guint len; - gint len = get_length_upper_bound (fmt, args); + len = get_length_upper_bound (fmt, args); if (len >= alloc) { if (buf) g_free (buf); - alloc = nearest_pow (MAX(len + 1, 1024 + 1)); + alloc = nearest_pow (MAX (len + 1, 1024 + 1)); - buf = g_new (char, alloc); + buf = g_new (gchar, alloc); } vsprintf (buf, fmt, *args2); diff --git a/grel.c b/grel.c index e4c1f6e..979a7d1 100644 --- a/grel.c +++ b/grel.c @@ -41,8 +41,9 @@ struct _GRealTuples gpointer *data; }; -gboolean -tuple_equal_2 (gconstpointer v_a, gconstpointer v_b) +static gboolean +tuple_equal_2 (gconstpointer v_a, + gconstpointer v_b) { gpointer* a = (gpointer*) v_a; gpointer* b = (gpointer*) v_b; @@ -50,7 +51,7 @@ tuple_equal_2 (gconstpointer v_a, gconstpointer v_b) return a[0] == b[0] && a[1] == b[1]; } -guint +static guint tuple_hash_2 (gconstpointer v_a) { gpointer* a = (gpointer*) v_a; @@ -58,7 +59,7 @@ tuple_hash_2 (gconstpointer v_a) return (gulong)a[0] ^ (gulong)a[1]; } -GHashFunc +static GHashFunc tuple_hash (gint fields) { switch (fields) @@ -72,7 +73,7 @@ tuple_hash (gint fields) return NULL; } -GCompareFunc +static GCompareFunc tuple_equal (gint fields) { switch (fields) @@ -369,8 +370,10 @@ g_tuples_index (GTuples *tuples0, /* Print */ -void -g_relation_print_one (gpointer tuple_key, gpointer tuple_value, gpointer user_data) +static void +g_relation_print_one (gpointer tuple_key, + gpointer tuple_value, + gpointer user_data) { gint i; GRealRelation* rel = (GRealRelation*) user_data; @@ -389,8 +392,10 @@ g_relation_print_one (gpointer tuple_key, gpointer tuple_value, gpointer user_da g_print ("]\n"); } -void -g_relation_print_index (gpointer tuple_key, gpointer tuple_value, gpointer user_data) +static void +g_relation_print_index (gpointer tuple_key, + gpointer tuple_value, + gpointer user_data) { GRealRelation* rel = (GRealRelation*) user_data; GHashTable* table = (GHashTable*) tuple_value; diff --git a/gstring.c b/gstring.c index eee63ba..3454e8f 100644 --- a/gstring.c +++ b/gstring.c @@ -578,24 +578,26 @@ get_length_upper_bound (const gchar* fmt, va_list *args) return len; } -char* +extern gchar* g_vsprintf (const gchar *fmt, va_list *args, va_list *args2); +gchar* g_vsprintf (const gchar *fmt, - va_list *args, - va_list *args2) + va_list *args, + va_list *args2) { static gchar *buf = NULL; - static gint alloc = 0; + static guint alloc = 0; + guint len; - gint len = get_length_upper_bound (fmt, args); + len = get_length_upper_bound (fmt, args); if (len >= alloc) { if (buf) g_free (buf); - alloc = nearest_pow (MAX(len + 1, 1024 + 1)); + alloc = nearest_pow (MAX (len + 1, 1024 + 1)); - buf = g_new (char, alloc); + buf = g_new (gchar, alloc); } vsprintf (buf, fmt, *args2); -- 2.7.4