2000-08-25 Elliot Lee <sopwith@redhat.com>
* glib.h, gunicode.h, gmodule/gmodule.h:
Mark the following functions G_GNUC_CONST (to allow
betteroptimization) because their results are a function of only their parameters:
g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
g_unichar_to*, g_unichar_*digit_value, g_unichar_type
13 files changed:
+2000-08-25 Elliot Lee <sopwith@redhat.com>
+ * glib.h, gunicode.h, gmodule/gmodule.h:
+ : Mark the following functions G_GNUC_CONST (to allow
+ optimization) because their results are a function of only their parameters:
+ g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
+ g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
+ g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
+ g_unichar_to*, g_unichar_*digit_value, g_unichar_type
+
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
+2000-08-25 Elliot Lee <sopwith@redhat.com>
+ * glib.h, gunicode.h, gmodule/gmodule.h:
+ : Mark the following functions G_GNUC_CONST (to allow
+ optimization) because their results are a function of only their parameters:
+ g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
+ g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
+ g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
+ g_unichar_to*, g_unichar_*digit_value, g_unichar_type
+
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
+2000-08-25 Elliot Lee <sopwith@redhat.com>
+ * glib.h, gunicode.h, gmodule/gmodule.h:
+ : Mark the following functions G_GNUC_CONST (to allow
+ optimization) because their results are a function of only their parameters:
+ g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
+ g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
+ g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
+ g_unichar_to*, g_unichar_*digit_value, g_unichar_type
+
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
+2000-08-25 Elliot Lee <sopwith@redhat.com>
+ * glib.h, gunicode.h, gmodule/gmodule.h:
+ : Mark the following functions G_GNUC_CONST (to allow
+ optimization) because their results are a function of only their parameters:
+ g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
+ g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
+ g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
+ g_unichar_to*, g_unichar_*digit_value, g_unichar_type
+
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
+2000-08-25 Elliot Lee <sopwith@redhat.com>
+ * glib.h, gunicode.h, gmodule/gmodule.h:
+ : Mark the following functions G_GNUC_CONST (to allow
+ optimization) because their results are a function of only their parameters:
+ g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
+ g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
+ g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
+ g_unichar_to*, g_unichar_*digit_value, g_unichar_type
+
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
+2000-08-25 Elliot Lee <sopwith@redhat.com>
+ * glib.h, gunicode.h, gmodule/gmodule.h:
+ : Mark the following functions G_GNUC_CONST (to allow
+ optimization) because their results are a function of only their parameters:
+ g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
+ g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
+ g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
+ g_unichar_to*, g_unichar_*digit_value, g_unichar_type
+
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
+2000-08-25 Elliot Lee <sopwith@redhat.com>
+ * glib.h, gunicode.h, gmodule/gmodule.h:
+ : Mark the following functions G_GNUC_CONST (to allow
+ optimization) because their results are a function of only their parameters:
+ g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
+ g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
+ g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
+ g_unichar_to*, g_unichar_*digit_value, g_unichar_type
+
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
+2000-08-25 Elliot Lee <sopwith@redhat.com>
+ * glib.h, gunicode.h, gmodule/gmodule.h:
+ : Mark the following functions G_GNUC_CONST (to allow
+ optimization) because their results are a function of only their parameters:
+ g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
+ g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
+ g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
+ g_unichar_to*, g_unichar_*digit_value, g_unichar_type
+
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
2000-08-21 Elliot Lee <sopwith@redhat.com>
* gobject/Makefile.am, gobject/gobject-query.c, gobject/gparamspecs.c: Fix inclusion of
config.h
guint g_str_hash (gconstpointer v);
gint g_int_equal (gconstpointer v,
guint g_str_hash (gconstpointer v);
gint g_int_equal (gconstpointer v,
- gconstpointer v2);
-guint g_int_hash (gconstpointer v);
+ gconstpointer v2) G_GNUC_CONST;
+guint g_int_hash (gconstpointer v) G_GNUC_CONST;
/* This "hash" function will just return the key's adress as an
* unsigned integer. Useful for hashing on plain adresses or
/* This "hash" function will just return the key's adress as an
* unsigned integer. Useful for hashing on plain adresses or
* passing NULL into g_hash_table_new() as GHashFunc has the
* same effect as passing g_direct_hash().
*/
* passing NULL into g_hash_table_new() as GHashFunc has the
* same effect as passing g_direct_hash().
*/
-guint g_direct_hash (gconstpointer v);
+guint g_direct_hash (gconstpointer v) G_GNUC_CONST;
gint g_direct_equal (gconstpointer v,
gint g_direct_equal (gconstpointer v,
+ gconstpointer v2) G_GNUC_CONST;
/* Quarks (string<->id association)
/* Quarks (string<->id association)
GQuark g_quark_try_string (const gchar *string);
GQuark g_quark_from_static_string (const gchar *string);
GQuark g_quark_from_string (const gchar *string);
GQuark g_quark_try_string (const gchar *string);
GQuark g_quark_from_static_string (const gchar *string);
GQuark g_quark_from_string (const gchar *string);
-gchar* g_quark_to_string (GQuark quark);
+gchar* g_quark_to_string (GQuark quark) G_GNUC_CONST;
guint n_years);
void g_date_subtract_years (GDate *date,
guint n_years);
guint n_years);
void g_date_subtract_years (GDate *date,
guint n_years);
-gboolean g_date_is_leap_year (GDateYear year);
+gboolean g_date_is_leap_year (GDateYear year) G_GNUC_CONST;
guint8 g_date_days_in_month (GDateMonth month,
guint8 g_date_days_in_month (GDateMonth month,
- GDateYear year);
-guint8 g_date_monday_weeks_in_year (GDateYear year);
-guint8 g_date_sunday_weeks_in_year (GDateYear year);
+ GDateYear year) G_GNUC_CONST;
+guint8 g_date_monday_weeks_in_year (GDateYear year) G_GNUC_CONST;
+guint8 g_date_sunday_weeks_in_year (GDateYear year) G_GNUC_CONST;
/* qsort-friendly (with a cast...) */
gint g_date_compare (GDate *lhs,
/* qsort-friendly (with a cast...) */
gint g_date_compare (GDate *lhs,
* next largest prime, or the highest it knows about which is about
* MAXINT/4.
*/
* next largest prime, or the highest it knows about which is about
* MAXINT/4.
*/
-guint g_spaced_primes_closest (guint num);
+guint g_spaced_primes_closest (guint num) G_GNUC_CONST;
guint g_str_hash (gconstpointer v);
gint g_int_equal (gconstpointer v,
guint g_str_hash (gconstpointer v);
gint g_int_equal (gconstpointer v,
- gconstpointer v2);
-guint g_int_hash (gconstpointer v);
+ gconstpointer v2) G_GNUC_CONST;
+guint g_int_hash (gconstpointer v) G_GNUC_CONST;
/* This "hash" function will just return the key's adress as an
* unsigned integer. Useful for hashing on plain adresses or
/* This "hash" function will just return the key's adress as an
* unsigned integer. Useful for hashing on plain adresses or
* passing NULL into g_hash_table_new() as GHashFunc has the
* same effect as passing g_direct_hash().
*/
* passing NULL into g_hash_table_new() as GHashFunc has the
* same effect as passing g_direct_hash().
*/
-guint g_direct_hash (gconstpointer v);
+guint g_direct_hash (gconstpointer v) G_GNUC_CONST;
gint g_direct_equal (gconstpointer v,
gint g_direct_equal (gconstpointer v,
+ gconstpointer v2) G_GNUC_CONST;
/* Quarks (string<->id association)
/* Quarks (string<->id association)
GQuark g_quark_try_string (const gchar *string);
GQuark g_quark_from_static_string (const gchar *string);
GQuark g_quark_from_string (const gchar *string);
GQuark g_quark_try_string (const gchar *string);
GQuark g_quark_from_static_string (const gchar *string);
GQuark g_quark_from_string (const gchar *string);
-gchar* g_quark_to_string (GQuark quark);
+gchar* g_quark_to_string (GQuark quark) G_GNUC_CONST;
guint n_years);
void g_date_subtract_years (GDate *date,
guint n_years);
guint n_years);
void g_date_subtract_years (GDate *date,
guint n_years);
-gboolean g_date_is_leap_year (GDateYear year);
+gboolean g_date_is_leap_year (GDateYear year) G_GNUC_CONST;
guint8 g_date_days_in_month (GDateMonth month,
guint8 g_date_days_in_month (GDateMonth month,
- GDateYear year);
-guint8 g_date_monday_weeks_in_year (GDateYear year);
-guint8 g_date_sunday_weeks_in_year (GDateYear year);
+ GDateYear year) G_GNUC_CONST;
+guint8 g_date_monday_weeks_in_year (GDateYear year) G_GNUC_CONST;
+guint8 g_date_sunday_weeks_in_year (GDateYear year) G_GNUC_CONST;
/* qsort-friendly (with a cast...) */
gint g_date_compare (GDate *lhs,
/* qsort-friendly (with a cast...) */
gint g_date_compare (GDate *lhs,
* next largest prime, or the highest it knows about which is about
* MAXINT/4.
*/
* next largest prime, or the highest it knows about which is about
* MAXINT/4.
*/
-guint g_spaced_primes_closest (guint num);
+guint g_spaced_primes_closest (guint num) G_GNUC_CONST;
/* These are all analogs of the <ctype.h> functions.
*/
/* These are all analogs of the <ctype.h> functions.
*/
-gboolean g_unichar_isalnum (gunichar c);
-gboolean g_unichar_isalpha (gunichar c);
-gboolean g_unichar_iscntrl (gunichar c);
-gboolean g_unichar_isdigit (gunichar c);
-gboolean g_unichar_isgraph (gunichar c);
-gboolean g_unichar_islower (gunichar c);
-gboolean g_unichar_isprint (gunichar c);
-gboolean g_unichar_ispunct (gunichar c);
-gboolean g_unichar_isspace (gunichar c);
-gboolean g_unichar_isupper (gunichar c);
-gboolean g_unichar_isxdigit (gunichar c);
-gboolean g_unichar_istitle (gunichar c);
-gboolean g_unichar_isdefined (gunichar c);
-gboolean g_unichar_iswide (gunichar c);
+gboolean g_unichar_isalnum (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isalpha (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_iscntrl (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isdigit (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isgraph (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_islower (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isprint (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_ispunct (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isspace (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isupper (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isxdigit (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_istitle (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isdefined (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_iswide (gunichar c) G_GNUC_CONST;
/* More <ctype.h> functions. These convert between the three cases.
* See the Unicode book to understand title case. */
/* More <ctype.h> functions. These convert between the three cases.
* See the Unicode book to understand title case. */
-gunichar g_unichar_toupper (gunichar c);
-gunichar g_unichar_tolower (gunichar c);
-gunichar g_unichar_totitle (gunichar c);
+gunichar g_unichar_toupper (gunichar c) G_GNUC_CONST;
+gunichar g_unichar_tolower (gunichar c) G_GNUC_CONST;
+gunichar g_unichar_totitle (gunichar c) G_GNUC_CONST;
/* If C is a digit (according to `g_unichar_isdigit'), then return its
numeric value. Otherwise return -1. */
/* If C is a digit (according to `g_unichar_isdigit'), then return its
numeric value. Otherwise return -1. */
-gint g_unichar_digit_value (gunichar c);
+gint g_unichar_digit_value (gunichar c) G_GNUC_CONST;
-gint g_unichar_xdigit_value (gunichar c);
+gint g_unichar_xdigit_value (gunichar c) G_GNUC_CONST;
/* Return the Unicode character type of a given character. */
/* Return the Unicode character type of a given character. */
-GUnicodeType g_unichar_type (gunichar c);
+GUnicodeType g_unichar_type (gunichar c) G_GNUC_CONST;
typedef void (*GModuleUnload) (GModule *module);
/* return TRUE if dynamic module loading is supported */
typedef void (*GModuleUnload) (GModule *module);
/* return TRUE if dynamic module loading is supported */
-gboolean g_module_supported (void);
+gboolean g_module_supported (void) G_GNUC_CONST;
/* open a module `file_name' and return handle, which is NULL on error */
GModule* g_module_open (const gchar *file_name,
/* open a module `file_name' and return handle, which is NULL on error */
GModule* g_module_open (const gchar *file_name,
/* These are all analogs of the <ctype.h> functions.
*/
/* These are all analogs of the <ctype.h> functions.
*/
-gboolean g_unichar_isalnum (gunichar c);
-gboolean g_unichar_isalpha (gunichar c);
-gboolean g_unichar_iscntrl (gunichar c);
-gboolean g_unichar_isdigit (gunichar c);
-gboolean g_unichar_isgraph (gunichar c);
-gboolean g_unichar_islower (gunichar c);
-gboolean g_unichar_isprint (gunichar c);
-gboolean g_unichar_ispunct (gunichar c);
-gboolean g_unichar_isspace (gunichar c);
-gboolean g_unichar_isupper (gunichar c);
-gboolean g_unichar_isxdigit (gunichar c);
-gboolean g_unichar_istitle (gunichar c);
-gboolean g_unichar_isdefined (gunichar c);
-gboolean g_unichar_iswide (gunichar c);
+gboolean g_unichar_isalnum (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isalpha (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_iscntrl (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isdigit (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isgraph (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_islower (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isprint (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_ispunct (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isspace (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isupper (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isxdigit (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_istitle (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_isdefined (gunichar c) G_GNUC_CONST;
+gboolean g_unichar_iswide (gunichar c) G_GNUC_CONST;
/* More <ctype.h> functions. These convert between the three cases.
* See the Unicode book to understand title case. */
/* More <ctype.h> functions. These convert between the three cases.
* See the Unicode book to understand title case. */
-gunichar g_unichar_toupper (gunichar c);
-gunichar g_unichar_tolower (gunichar c);
-gunichar g_unichar_totitle (gunichar c);
+gunichar g_unichar_toupper (gunichar c) G_GNUC_CONST;
+gunichar g_unichar_tolower (gunichar c) G_GNUC_CONST;
+gunichar g_unichar_totitle (gunichar c) G_GNUC_CONST;
/* If C is a digit (according to `g_unichar_isdigit'), then return its
numeric value. Otherwise return -1. */
/* If C is a digit (according to `g_unichar_isdigit'), then return its
numeric value. Otherwise return -1. */
-gint g_unichar_digit_value (gunichar c);
+gint g_unichar_digit_value (gunichar c) G_GNUC_CONST;
-gint g_unichar_xdigit_value (gunichar c);
+gint g_unichar_xdigit_value (gunichar c) G_GNUC_CONST;
/* Return the Unicode character type of a given character. */
/* Return the Unicode character type of a given character. */
-GUnicodeType g_unichar_type (gunichar c);
+GUnicodeType g_unichar_type (gunichar c) G_GNUC_CONST;