Revision: 4791 http://geany.svn.sourceforge.net/geany/?rev=4791&view=rev Author: ntrel Date: 2010-03-30 17:19:59 +0000 (Tue, 30 Mar 2010)
Log Message: ----------- Don't generate FOO_GET_PRIVATE() macro because caching the result in Foo::priv can be much more efficient.
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/classbuilder.c trunk/src/geanyobject.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-03-30 16:29:38 UTC (rev 4790) +++ trunk/ChangeLog 2010-03-30 17:19:59 UTC (rev 4791) @@ -8,6 +8,9 @@ plugins/geanyfunctions.h, plugins/geanyplugin.h: Add Stash setting functions to API. Remove unnecessary argument to stash_group_load_from_file(). + * src/geanyobject.c, plugins/classbuilder.c: + Don't generate FOO_GET_PRIVATE() macro because caching the result + in Foo::priv can be much more efficient.
2010-03-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/plugins/classbuilder.c =================================================================== --- trunk/plugins/classbuilder.c 2010-03-30 16:29:38 UTC (rev 4790) +++ trunk/plugins/classbuilder.c 2010-03-30 17:19:59 UTC (rev 4791) @@ -129,10 +129,14 @@ typedef struct _{class_name} {class_name};\n\ typedef struct _{class_name}Class {class_name}Class;\n\ \n\ +struct _{class_name}Private;\n\ +\n\ struct _{class_name}\n\ {\n\ {base_name} parent;\n\ /* add your public declarations here */\n\ + \n\ + struct _{class_name}Private *priv;\n\ };\n\ \n\ struct _{class_name}Class\n\ @@ -153,9 +157,6 @@ \n\ typedef struct _{class_name}Private {class_name}Private;\n\ \n\ -#define {class_name_up}_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),\\n\ - {class_name_up}_TYPE, {class_name}Private))\n\ -\n\ struct _{class_name}Private\n\ {\n\ /* add your private declarations here */\n\ @@ -175,6 +176,8 @@ \n\ static void {class_name_low}_init({class_name} *self)\n\ {\n\ + self->priv = G_TYPE_INSTANCE_GET_PRIVATE(self,\n\ + {class_name_up}_TYPE, {class_name}Private);\n\ \n\ }\n\ \n\
Modified: trunk/src/geanyobject.c =================================================================== --- trunk/src/geanyobject.c 2010-03-30 16:29:38 UTC (rev 4790) +++ trunk/src/geanyobject.c 2010-03-30 17:19:59 UTC (rev 4791) @@ -46,9 +46,6 @@
typedef struct _GeanyObjectPrivate GeanyObjectPrivate;
-#define GEANY_OBJECT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj),\ - GEANY_OBJECT_TYPE, GeanyObjectPrivate)) - struct _GeanyObjectPrivate { /* to avoid warnings (g_type_class_add_private: assertion `private_size > 0' failed) */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.