summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-09-17 17:57:44 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-09-17 17:57:44 +0000
commit2643967c17a6e653785f18035b661f14ea4a596b (patch)
treef34cbfa506a4bfd8e9995d1b2fa5f57065bd7888
parent79e713df85551688389b8d7ab49575439ca2503a (diff)
warnings--, python-efl now compiles cleanly!
huge effort of easy tasks, but worth the pain! Even spotted the bug in Elementary.h.in with "const void *data" due this work. Cython by default does not handle "const", we have to create a new type that expands with "const " in C, making our gcc quiet. In this process I also fixed some errors, like the ecore apis still using the old "int-return", these were all fixed. SVN revision: 52381
-rw-r--r--ethumb/ethumb.client.pyx12
-rw-r--r--include/ethumb/client.pxd5
2 files changed, 10 insertions, 7 deletions
diff --git a/ethumb/ethumb.client.pyx b/ethumb/ethumb.client.pyx
index 60803fa..63f05d0 100644
--- a/ethumb/ethumb.client.pyx
+++ b/ethumb/ethumb.client.pyx
@@ -15,7 +15,7 @@
15# You should have received a copy of the GNU Lesser General Public License 15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>. 16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17 17
18from python_ref cimport PyObject, Py_INCREF, Py_DECREF 18from cpython cimport PyObject, Py_INCREF, Py_DECREF
19import traceback 19import traceback
20 20
21__extra_epydoc_fields__ = ( 21__extra_epydoc_fields__ = (
@@ -58,7 +58,7 @@ cdef void _on_server_die_cb(void *data, Ethumb_Client *client) with gil:
58 self._on_server_die_callback = None 58 self._on_server_die_callback = None
59 59
60 60
61cdef void _generated_cb(void *data, Ethumb_Client *client, int id, char *file, char *key, char *thumb_path, char *thumb_key, Eina_Bool success) with gil: 61cdef void _generated_cb(void *data, Ethumb_Client *client, int id, const_char_ptr file, const_char_ptr key, const_char_ptr thumb_path, const_char_ptr thumb_key, Eina_Bool success) with gil:
62 obj = <object>data 62 obj = <object>data
63 (self, func, args, kargs) = obj 63 (self, func, args, kargs) = obj
64 f = str_from_c(file) 64 f = str_from_c(file)
@@ -83,7 +83,7 @@ cdef char *str_to_c(object s):
83 mystr = s 83 mystr = s
84 return mystr 84 return mystr
85 85
86cdef object str_from_c(char *mystr): 86cdef object str_from_c(const_char_ptr mystr):
87 if mystr != NULL: 87 if mystr != NULL:
88 return mystr 88 return mystr
89 89
@@ -468,7 +468,7 @@ cdef class Client:
468 468
469 @rtype: tuple of str 469 @rtype: tuple of str
470 """ 470 """
471 cdef char *p, *k 471 cdef const_char_ptr p, k
472 ethumb_client_file_get(self.obj, &p, &k) 472 ethumb_client_file_get(self.obj, &p, &k)
473 return (str_from_c(p), str_from_c(k)) 473 return (str_from_c(p), str_from_c(k))
474 474
@@ -500,7 +500,7 @@ cdef class Client:
500 @parm: B{key} path to key inside B{path}, this is used to 500 @parm: B{key} path to key inside B{path}, this is used to
501 generate thumbnail inside EET files. 501 generate thumbnail inside EET files.
502 """ 502 """
503 cdef char *p, *k 503 cdef const_char_ptr p, k
504 p = str_to_c(path) 504 p = str_to_c(path)
505 k = str_to_c(key) 505 k = str_to_c(key)
506 ethumb_client_thumb_path_set(self.obj, p, k) 506 ethumb_client_thumb_path_set(self.obj, p, k)
@@ -514,7 +514,7 @@ cdef class Client:
514 514
515 @rtype: tuple of str 515 @rtype: tuple of str
516 """ 516 """
517 cdef char *p, *k 517 cdef const_char_ptr p, k
518 ethumb_client_thumb_path_get(self.obj, &p, &k) 518 ethumb_client_thumb_path_get(self.obj, &p, &k)
519 return (str_from_c(p), str_from_c(k)) 519 return (str_from_c(p), str_from_c(k))
520 520
diff --git a/include/ethumb/client.pxd b/include/ethumb/client.pxd
index d145875..02d4dfc 100644
--- a/include/ethumb/client.pxd
+++ b/include/ethumb/client.pxd
@@ -15,6 +15,9 @@
15# You should have received a copy of the GNU Lesser General Public License 15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>. 16# along with this Python-Ethumb. If not, see <http://www.gnu.org/licenses/>.
17 17
18cdef extern from *:
19 ctypedef char* const_char_ptr "const char *"
20
18cdef extern from "Eina.h": 21cdef extern from "Eina.h":
19 ctypedef int Eina_Bool 22 ctypedef int Eina_Bool
20 23
@@ -27,7 +30,7 @@ cdef extern from "Ethumb_Client.h":
27 ctypedef void (*Eina_Free_Cb)(void *data) 30 ctypedef void (*Eina_Free_Cb)(void *data)
28 31
29 int ethumb_client_init() 32 int ethumb_client_init()
30 ethumb_client_shutdown() 33 int ethumb_client_shutdown()
31 34
32 Ethumb_Client *ethumb_client_connect(Ethumb_Client_Connect_Cb cb, void *data, Eina_Free_Cb free_data) 35 Ethumb_Client *ethumb_client_connect(Ethumb_Client_Connect_Cb cb, void *data, Eina_Free_Cb free_data)
33 void ethumb_client_disconnect(Ethumb_Client *client) 36 void ethumb_client_disconnect(Ethumb_Client *client)