[glom] Rename some functions to avoid fear of linking to the wrong one.



commit 89e3581cd1cb1c2aef576b36ab4dccf0c27a44ba
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Dec 4 16:09:24 2009 +0100

    Rename some functions to avoid fear of linking to the wrong one.
    
    * glom/libglom/python_embed/pygdavalue_conversions.[h|cc]:
    pygda_value_from_pyobject(), pygda_value_as_pyobject(): Add a glom_
    prefix so we know we are not using the copy in pygda.
    * glom/python_embed/glom_python.cc:
    * glom/libglom/python_embed/py_glom_record.cc:
    * glom/libglom/python_embed/py_glom_relatedrecord.cc: Adapted.

 ChangeLog                                          |   11 +++++++++++
 glom/libglom/python_embed/py_glom_record.cc        |    2 +-
 glom/libglom/python_embed/py_glom_relatedrecord.cc |    6 +++---
 glom/libglom/python_embed/pygdavalue_conversions.c |    4 ++--
 glom/libglom/python_embed/pygdavalue_conversions.h |   10 +++++-----
 glom/python_embed/glom_python.cc                   |    2 +-
 6 files changed, 23 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 61810af..8c331fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-04  Murray Cumming  <murrayc murrayc-desktop>
+
+	Rename some functions to avoid fear of linking to the wrong one.
+
+	* glom/libglom/python_embed/pygdavalue_conversions.[h|cc]: 
+	pygda_value_from_pyobject(), pygda_value_as_pyobject(): Add a glom_ 
+	prefix so we know we are not using the copy in pygda.
+	* glom/python_embed/glom_python.cc:
+	* glom/libglom/python_embed/py_glom_record.cc:
+	* glom/libglom/python_embed/py_glom_relatedrecord.cc: Adapted.
+
 2009-12-04  Murray Cumming  <murrayc murrayc com>
 
 	Field Definitions: Default value: Fix crash when selecting a date.
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index 5293365..112d524 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -211,7 +211,7 @@ Record_tp_as_mapping_getitem(PyObject *self, PyObject *item)
         PyGlomRecord::type_map_field_values::const_iterator iterFind = self_record->m_pMap_field_values->find(key);
         if(iterFind != self_record->m_pMap_field_values->end())
         {
-          return pygda_value_as_pyobject(iterFind->second.gobj(), true /* copy */);
+          return glom_pygda_value_as_pyobject(iterFind->second.gobj(), true /* copy */);
         }
         else
         {
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index 44daa3a..827cd05 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -178,7 +178,7 @@ RelatedRecord_tp_as_mapping_getitem(PyObject *self, PyObject *item)
       if(iterFind != self_derived->m_pMap_field_values->end())
       {
         //If the value has already been stored, then just return it again:
-        return pygda_value_as_pyobject(iterFind->second.gobj(), true /* copy */);
+        return glom_pygda_value_as_pyobject(iterFind->second.gobj(), true /* copy */);
       }
       else
       {
@@ -247,7 +247,7 @@ RelatedRecord_tp_as_mapping_getitem(PyObject *self, PyObject *item)
 
               //Cache it, in case it's asked-for again.
               (*(self_derived->m_pMap_field_values))[field_name] = value;
-              return pygda_value_as_pyobject(value.gobj(), true /* copy */);
+              return glom_pygda_value_as_pyobject(value.gobj(), true /* copy */);
             }
             else if(!datamodel)
             {
@@ -355,7 +355,7 @@ RelatedRecord_generic_aggregate(PyGlomRelatedRecord* self, PyObject *args, PyObj
 
           //Cache it, in case it's asked-for again.
           (*(self->m_pMap_field_values))[field_name] = value;
-          return pygda_value_as_pyobject(value.gobj(), true /* copy */);
+          return glom_pygda_value_as_pyobject(value.gobj(), true /* copy */);
         }
         else if(!datamodel)
         {
diff --git a/glom/libglom/python_embed/pygdavalue_conversions.c b/glom/libglom/python_embed/pygdavalue_conversions.c
index a651f95..31d6609 100644
--- a/glom/libglom/python_embed/pygdavalue_conversions.c
+++ b/glom/libglom/python_embed/pygdavalue_conversions.c
@@ -17,7 +17,7 @@
  * Returns: 0 on success, -1 on error.
  */
 int
-pygda_value_from_pyobject(GValue *boxed, PyObject *input)
+glom_pygda_value_from_pyobject(GValue *boxed, PyObject *input)
 {
     /* Use an appropriate gda_value_set_*() function.
        We can not know what GValue type is actually wanted, so
@@ -88,7 +88,7 @@ pygda_value_from_pyobject(GValue *boxed, PyObject *input)
  * Returns: a PyObject representing the value.
  */
 PyObject *
-pygda_value_as_pyobject(const GValue *boxed, gboolean copy_boxed)
+glom_pygda_value_as_pyobject(const GValue *boxed, gboolean copy_boxed)
 {
     copy_boxed = FALSE; //Just to avoid the "unused paramter" and "parameter name omitted" warnings.
 
diff --git a/glom/libglom/python_embed/pygdavalue_conversions.h b/glom/libglom/python_embed/pygdavalue_conversions.h
index 63647d6..8ce78bb 100644
--- a/glom/libglom/python_embed/pygdavalue_conversions.h
+++ b/glom/libglom/python_embed/pygdavalue_conversions.h
@@ -1,17 +1,17 @@
 #include <pygobject.h>
 #include <libgda/libgda.h>
 
-#ifndef PYGDA_VALUE_CONVERSIONS_H
-#define PYGDA_VALUE_CONVERSIONS_H
+#ifndef GLOM_PYGDA_VALUE_CONVERSIONS_H
+#define GLOM_PYGDA_VALUE_CONVERSIONS_H
 
 G_BEGIN_DECLS
 
 int
-pygda_value_from_pyobject(GValue *boxed, PyObject *input);
+glom_pygda_value_from_pyobject(GValue *boxed, PyObject *input);
 
 PyObject *
-pygda_value_as_pyobject(const GValue *value, gboolean copy_boxed);
+glom_pygda_value_as_pyobject(const GValue *value, gboolean copy_boxed);
 
 G_END_DECLS
 
-#endif //PYGDA_VALUE_CONVERSIONS_H
+#endif //GLOM_PYGDA_VALUE_CONVERSIONS_H
diff --git a/glom/python_embed/glom_python.cc b/glom/python_embed/glom_python.cc
index 88c9e14..c5317fb 100644
--- a/glom/python_embed/glom_python.cc
+++ b/glom/python_embed/glom_python.cc
@@ -326,7 +326,7 @@ Gnome::Gda::Value glom_evaluate_python_function_implementation(Field::glom_field
         bool object_is_gda_value = false;
 
         GValue value = {0, {{0}}};
-        const int test = pygda_value_from_pyobject(&value, pyResult);
+        const int test = glom_pygda_value_from_pyobject(&value, pyResult);
 
         if(test == 0) //-1 means error.
           object_is_gda_value = true;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]