r15203 - gnucash/trunk/src - Rename variables to avoid potential conflicts with C/C++ keywords.

Christian Stimming cstim at cvs.gnucash.org
Mon Dec 11 12:48:46 EST 2006


Author: cstim
Date: 2006-12-11 12:48:44 -0500 (Mon, 11 Dec 2006)
New Revision: 15203
Trac: http://svn.gnucash.org/trac/changeset/15203

Modified:
   gnucash/trunk/src/app-utils/gnc-component-manager.c
   gnucash/trunk/src/gnc-module/gnc-module.c
   gnucash/trunk/src/gnc-module/gnc-module.h
Log:
Rename variables to avoid potential conflicts with C/C++ keywords.

Modified: gnucash/trunk/src/app-utils/gnc-component-manager.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-component-manager.c	2006-12-11 01:17:50 UTC (rev 15202)
+++ gnucash/trunk/src/app-utils/gnc-component-manager.c	2006-12-11 17:48:44 UTC (rev 15203)
@@ -639,7 +639,7 @@
 changes_match (ComponentEventInfo *cei, ComponentEventInfo *changes)
 {
   ComponentEventInfo *big_cei;
-  GHashTable *small;
+  GHashTable *smalltable;
 
   if (cei == NULL)
     return FALSE;
@@ -653,18 +653,18 @@
   if (g_hash_table_size (cei->entity_events) <=
       g_hash_table_size (changes->entity_events))
   {
-    small = cei->entity_events;
+    smalltable = cei->entity_events;
     big_cei = changes;
   }
   else
   {
-    small = changes->entity_events;
+    smalltable = changes->entity_events;
     big_cei = cei;
   }
 
   big_cei->match = FALSE;
 
-  g_hash_table_foreach (small, match_helper, big_cei);
+  g_hash_table_foreach (smalltable, match_helper, big_cei);
 
   return big_cei->match;
 }

Modified: gnucash/trunk/src/gnc-module/gnc-module.c
===================================================================
--- gnucash/trunk/src/gnc-module/gnc-module.c	2006-12-11 01:17:50 UTC (rev 15202)
+++ gnucash/trunk/src/gnc-module/gnc-module.c	2006-12-11 17:48:44 UTC (rev 15203)
@@ -313,11 +313,11 @@
       lt_ptr initfunc    = lt_dlsym(handle, "gnc_module_init");
       lt_ptr pathfunc    = lt_dlsym(handle, "gnc_module_path");
       lt_ptr descripfunc = lt_dlsym(handle, "gnc_module_description");
-      lt_ptr interface   = lt_dlsym(handle, "gnc_module_current");
+      lt_ptr iface       = lt_dlsym(handle, "gnc_module_current");
       lt_ptr revision    = lt_dlsym(handle, "gnc_module_revision");
       lt_ptr age         = lt_dlsym(handle, "gnc_module_age");
       
-      if (!(initfunc && pathfunc && descripfunc && interface &&
+      if (!(initfunc && pathfunc && descripfunc && iface &&
             revision && age)) {
           g_warning ("module '%s' does not match module signature\n",
                      fullpath);
@@ -333,7 +333,7 @@
           info->module_path        = f_path();
           info->module_description = f_descrip();
           info->module_filepath    = g_strdup(fullpath);
-          info->module_interface   = *(int *)interface;
+          info->module_interface   = *(int *)iface;
           info->module_age         = *(int *)age;
           info->module_revision    = *(int *)revision;
           //printf("(init) closing %s\n", fullpath);
@@ -350,7 +350,7 @@
  *************************************************************/
 
 static GNCModuleInfo * 
-gnc_module_locate(const gchar * module_name, int interface) 
+gnc_module_locate(const gchar * module_name, int iface) 
 {
   GNCModuleInfo * best    = NULL;
   GNCModuleInfo * current = NULL;
@@ -365,8 +365,8 @@
   {
     current = lptr->data;
     if(!strcmp(module_name, current->module_path) &&
-       (interface >= (current->module_interface - current->module_age)) &&
-       (interface <= current->module_interface)) 
+       (iface >= (current->module_interface - current->module_age)) &&
+       (iface <= current->module_interface)) 
     {
       if(best) 
       {
@@ -397,9 +397,9 @@
 }
 
 static GNCLoadedModule * 
-gnc_module_check_loaded(const char * module_name, gint interface) 
+gnc_module_check_loaded(const char * module_name, gint iface) 
 {
-  GNCModuleInfo * modinfo = gnc_module_locate(module_name, interface);
+  GNCModuleInfo * modinfo = gnc_module_locate(module_name, iface);
   GList * modules = NULL;
   GList * p = NULL;
   GNCLoadedModule * rv = NULL;
@@ -438,7 +438,7 @@
  *************************************************************/
 
 static GNCModule 
-gnc_module_load_common(char * module_name, gint interface, gboolean optional)
+gnc_module_load_common(char * module_name, gint iface, gboolean optional)
 {
 
   GNCLoadedModule * info;
@@ -448,7 +448,7 @@
     gnc_module_system_init();
   }
   
-  info = gnc_module_check_loaded(module_name, interface);
+  info = gnc_module_check_loaded(module_name, iface);
   
   /* if the module's already loaded, just increment its use count.
    * otherwise, load it and check for the initializer
@@ -478,7 +478,7 @@
   }
   else 
   {
-    GNCModuleInfo * modinfo = gnc_module_locate(module_name, interface);
+    GNCModuleInfo * modinfo = gnc_module_locate(module_name, iface);
     lt_dlhandle   handle = NULL;
     
     //if(modinfo) 
@@ -526,7 +526,7 @@
       g_warning ("Failed to open module %s", module_name);
       if(modinfo) printf(": %s\n", lt_dlerror());
       else g_warning (": could not locate %s interface v.%d\n",
-                      module_name, interface);
+                      module_name, iface);
       return NULL;
     }
     return NULL;
@@ -535,15 +535,15 @@
 
 
 GNCModule 
-gnc_module_load(char * module_name, gint interface) 
+gnc_module_load(char * module_name, gint iface) 
 {
-  return gnc_module_load_common(module_name, interface, FALSE);
+  return gnc_module_load_common(module_name, iface, FALSE);
 }
 
 GNCModule 
-gnc_module_load_optional(char * module_name, gint interface) 
+gnc_module_load_optional(char * module_name, gint iface) 
 {
-  return gnc_module_load_common(module_name, interface, TRUE);
+  return gnc_module_load_common(module_name, iface, TRUE);
 }
 
 /*************************************************************

Modified: gnucash/trunk/src/gnc-module/gnc-module.h
===================================================================
--- gnucash/trunk/src/gnc-module/gnc-module.h	2006-12-11 01:17:50 UTC (rev 15202)
+++ gnucash/trunk/src/gnc-module/gnc-module.h	2006-12-11 17:48:44 UTC (rev 15203)
@@ -25,8 +25,8 @@
  * module_name is not a const gchar?! It certainly should be const
  * (because of passing string literals), and from a quick glance it is
  * also only used in a const way. */
-GNCModule       gnc_module_load(gchar * module_name, gint interface);
-GNCModule       gnc_module_load_optional(gchar * module_name, gint interface);
+GNCModule       gnc_module_load(gchar * module_name, gint iface);
+GNCModule       gnc_module_load_optional(gchar * module_name, gint iface);
 int             gnc_module_unload(GNCModule mod);
 
 #endif



More information about the gnucash-changes mailing list