From 617b1db064a4470e963892cde2957d2f5fbf9325 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Sat, 28 Feb 2015 17:26:27 +0100 Subject: [PATCH] cpml: drop CPML_GNUC_CONST macro Actually the main function to get the primitive class from the type number relies on a hash table, so further optimization are bogus. Dropped the macro equivalent to G_GNUC_CONST because it is no more needed (and because I suspect that macro was useless anyway). Avoid relying on th --- docs/cpml/Makefile.am | 3 +-- src/cpml/cpml-primitive-private.h | 8 ++++---- src/cpml/cpml-utils.c | 13 ------------- src/cpml/cpml-utils.h | 6 ------ 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/docs/cpml/Makefile.am b/docs/cpml/Makefile.am index 1c26f32d..6808c9e6 100644 --- a/docs/cpml/Makefile.am +++ b/docs/cpml/Makefile.am @@ -4,8 +4,7 @@ DOC_MODULE= cpml DOC_MAIN_SGML_FILE= $(DOC_MODULE)-docs.xml DOC_SOURCE_DIR= $(abs_top_srcdir)/src/cpml SCANGOBJ_OPTIONS= -SCAN_OPTIONS= --ignore-decorators="CPML_GNUC_CONST" \ - --rebuild-sections +SCAN_OPTIONS= --rebuild-sections MKDB_OPTIONS= --name-space=cpml \ --sgml-mode \ --output-format=xml \ diff --git a/src/cpml/cpml-primitive-private.h b/src/cpml/cpml-primitive-private.h index c74d8728..bfb59250 100644 --- a/src/cpml/cpml-primitive-private.h +++ b/src/cpml/cpml-primitive-private.h @@ -80,10 +80,10 @@ struct __CpmlPrimitiveClass { }; -const _CpmlPrimitiveClass * _cpml_line_get_class (void) CPML_GNUC_CONST; -const _CpmlPrimitiveClass * _cpml_arc_get_class (void) CPML_GNUC_CONST; -const _CpmlPrimitiveClass * _cpml_curve_get_class (void) CPML_GNUC_CONST; -const _CpmlPrimitiveClass * _cpml_close_get_class (void) CPML_GNUC_CONST; +const _CpmlPrimitiveClass * _cpml_line_get_class (void); +const _CpmlPrimitiveClass * _cpml_arc_get_class (void); +const _CpmlPrimitiveClass * _cpml_curve_get_class (void); +const _CpmlPrimitiveClass * _cpml_close_get_class (void); CAIRO_END_DECLS diff --git a/src/cpml/cpml-utils.c b/src/cpml/cpml-utils.c index 2e188b47..80e657f2 100644 --- a/src/cpml/cpml-utils.c +++ b/src/cpml/cpml-utils.c @@ -35,19 +35,6 @@ /** - * CPML_GNUC_CONST: - * - * To be appended at the end of a function to notice the compiler (gcc) - * that the return value is constant. - * - * The coded is an adaptation of the #G_GNUC_CONST macro defined by - * glib-2.18.3 in glib/gmacros.h. - * - * Since: 1.0 - **/ - - -/** * cpml_angle: * @angle: an angle in radians * diff --git a/src/cpml/cpml-utils.h b/src/cpml/cpml-utils.h index 9b717539..6ebe8a9d 100644 --- a/src/cpml/cpml-utils.h +++ b/src/cpml/cpml-utils.h @@ -30,12 +30,6 @@ #include #include -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) -#define CPML_GNUC_CONST __attribute__((__const__)) -#else -#define CPML_GNUC_CONST -#endif - CAIRO_BEGIN_DECLS -- 2.11.4.GIT