subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1160336 - /subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c
Date Mon, 22 Aug 2011 17:08:49 GMT
Author: hwright
Date: Mon Aug 22 17:08:49 2011
New Revision: 1160336

URL: http://svn.apache.org/viewvc?rev=1160336&view=rev
Log:
On the fs-py branch:
Add a few casts to satisfy the Python APIs, as well as our compiler.

* subversion/libsvn_fs_py/py_util.c
  (create_py_stack): Cast away const and an int.
  (convert_svn_string_t): Cast a conversion function.

Modified:
    subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c

Modified: subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c?rev=1160336&r1=1160335&r2=1160336&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_py/py_util.c Mon Aug 22 17:08:49 2011
@@ -64,8 +64,9 @@ create_py_stack(PyObject *p_exception,
       p_traceback_mod = PyImport_Import(p_module_name);
       Py_DECREF(p_module_name);
 
-      p_stack = PyObject_CallMethod(p_traceback_mod, "extract_tb",
-                                    "(O)", p_traceback);
+      /* ### Cast away const for the Python API. */
+      p_stack = PyObject_CallMethod(p_traceback_mod, (char *) "extract_tb",
+                                    (char *) "(O)", p_traceback);
       Py_DECREF(p_traceback_mod);
 
       i = PySequence_Length(p_stack);
@@ -108,7 +109,7 @@ create_py_stack(PyObject *p_exception,
       PyObject *p_code = PyObject_GetAttrString(p_exception, "code");
 
       if (PyInt_Check(p_code))
-        err->apr_err = PyInt_AS_LONG(p_code);
+        err->apr_err = (int) PyInt_AS_LONG(p_code);
 
       Py_DECREF(p_code);
     }
@@ -486,7 +487,8 @@ convert_svn_string_t(void *value)
 PyObject *
 svn_fs_py__convert_cstring_hash(void *object)
 {
-  return convert_hash(object, PyString_FromString);
+  /* Cast PyString_FromString to silence a compiler warning. */
+  return convert_hash(object, (PyObject *(*)(void *value)) PyString_FromString);
 }
 
 PyObject *



Mime
View raw message