summaryrefslogtreecommitdiff
path: root/c/lib_obj.c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2017-09-27 09:38:15 +0200
committerArmin Rigo <arigo@tunes.org>2017-09-27 09:38:15 +0200
commitfd5d394a95feb8bedbbe7323a6045f5a9f00e0ec (patch)
treed8c7f9933a4d50395080aec0b765212b113401dc /c/lib_obj.c
parentf172af3bf3252a62853ca64c1f08d92127f1989e (diff)
downloadcffi-fd5d394a95feb8bedbbe7323a6045f5a9f00e0ec.tar.gz
"char *" => "const char *" until Python 3.7 is happy
Diffstat (limited to 'c/lib_obj.c')
-rw-r--r--c/lib_obj.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/c/lib_obj.c b/c/lib_obj.c
index b34f0a1..e66f788 100644
--- a/c/lib_obj.c
+++ b/c/lib_obj.c
@@ -85,7 +85,8 @@ static PyObject *_cpyextfunc_type_index(PyObject *x)
}
static void cdlopen_close_ignore_errors(void *libhandle); /* forward */
-static void *cdlopen_fetch(PyObject *libname, void *libhandle, char *symbol);
+static void *cdlopen_fetch(PyObject *libname, void *libhandle,
+ const char *symbol);
static void lib_dealloc(LibObject *lib)
{
@@ -127,7 +128,7 @@ static PyObject *lib_build_cpython_func(LibObject *lib,
int i, type_index = _CFFI_GETARG(g->type_op);
_cffi_opcode_t *opcodes = lib->l_types_builder->ctx.types;
static const char *const format = ";\n\nCFFI C function from %s.lib";
- char *libname = PyText_AS_UTF8(lib->l_libname);
+ const char *libname = PyText_AS_UTF8(lib->l_libname);
struct funcbuilder_s funcbuilder;
/* return type: */
@@ -206,7 +207,7 @@ static PyObject *lib_build_and_cache_attr(LibObject *lib, PyObject *name,
const struct _cffi_global_s *g;
CTypeDescrObject *ct;
builder_c_t *types_builder = lib->l_types_builder;
- char *s = PyText_AsUTF8(name);
+ const char *s = PyText_AsUTF8(name);
if (s == NULL)
return NULL;
@@ -493,7 +494,7 @@ static PyObject *_lib_dict(LibObject *lib)
static PyObject *lib_getattr(LibObject *lib, PyObject *name)
{
- char *p;
+ const char *p;
PyObject *x;
LIB_GET_OR_CACHE_ADDR(x, lib, name, goto missing);