diff options
-rw-r--r-- | c/_cffi_backend.c | 4 | ||||
-rw-r--r-- | c/call_python.c | 2 | ||||
-rw-r--r-- | c/cdlopen.c | 3 | ||||
-rw-r--r-- | c/ffi_obj.c | 6 | ||||
-rw-r--r-- | c/file_emulator.h | 2 | ||||
-rw-r--r-- | c/lib_obj.c | 9 |
6 files changed, 14 insertions, 12 deletions
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c index 6ca51ca..c6004bb 100644 --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -2675,7 +2675,7 @@ cdata_sub(PyObject *v, PyObject *w) static void _cdata_attr_errmsg(char *errmsg, CDataObject *cd, PyObject *attr) { - char *text; + const char *text; if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return; PyErr_Clear(); @@ -5900,7 +5900,7 @@ static PyObject *b_new_enum_type(PyObject *self, PyObject *args) if (!PyText_Check(tmpkey)) { #if PY_MAJOR_VERSION < 3 if (PyUnicode_Check(tmpkey)) { - char *text = PyText_AsUTF8(tmpkey); + const char *text = PyText_AsUTF8(tmpkey); if (text == NULL) goto error; Py_DECREF(tmpkey); diff --git a/c/call_python.c b/c/call_python.c index 6e15ca3..b41042b 100644 --- a/c/call_python.c +++ b/c/call_python.c @@ -51,7 +51,7 @@ static PyObject *_get_interpstate_dict(void) static PyObject *_ffi_def_extern_decorator(PyObject *outer_args, PyObject *fn) { - char *s; + const char *s; PyObject *error, *onerror, *infotuple, *old1; int index, err; const struct _cffi_global_s *g; diff --git a/c/cdlopen.c b/c/cdlopen.c index 032bd3f..d1e952f 100644 --- a/c/cdlopen.c +++ b/c/cdlopen.c @@ -1,6 +1,7 @@ /* ffi.dlopen() interface with dlopen()/dlsym()/dlclose() */ -static void *cdlopen_fetch(PyObject *libname, void *libhandle, char *symbol) +static void *cdlopen_fetch(PyObject *libname, void *libhandle, + const char *symbol) { void *address; diff --git a/c/ffi_obj.c b/c/ffi_obj.c index ecf37c5..1b41be6 100644 --- a/c/ffi_obj.c +++ b/c/ffi_obj.c @@ -92,7 +92,7 @@ static PyObject *ffiobj_new(PyTypeObject *type, PyObject *args, PyObject *kwds) /* forward, declared in cdlopen.c because it's mostly useful for this case */ static int ffiobj_init(PyObject *self, PyObject *args, PyObject *kwds); -static PyObject *ffi_fetch_int_constant(FFIObject *ffi, char *name, +static PyObject *ffi_fetch_int_constant(FFIObject *ffi, const char *name, int recursion) { int index; @@ -145,7 +145,7 @@ static PyObject *ffi_fetch_int_constant(FFIObject *ffi, char *name, #define ACCEPT_ALL (ACCEPT_STRING | ACCEPT_CTYPE | ACCEPT_CDATA) #define CONSIDER_FN_AS_FNPTR 8 -static CTypeDescrObject *_ffi_bad_type(FFIObject *ffi, char *input_text) +static CTypeDescrObject *_ffi_bad_type(FFIObject *ffi, const char *input_text) { size_t length = strlen(input_text); char *extra; @@ -188,7 +188,7 @@ static CTypeDescrObject *_ffi_type(FFIObject *ffi, PyObject *arg, PyObject *x = PyDict_GetItem(types_dict, arg); if (x == NULL) { - char *input_text = PyText_AS_UTF8(arg); + const char *input_text = PyText_AS_UTF8(arg); int err, index = parse_c_type(&ffi->info, input_text); if (index < 0) return _ffi_bad_type(ffi, input_text); diff --git a/c/file_emulator.h b/c/file_emulator.h index f2dd2d0..82a34c0 100644 --- a/c/file_emulator.h +++ b/c/file_emulator.h @@ -33,7 +33,7 @@ static FILE *PyFile_AsFile(PyObject *ob_file) PyObject *ob, *ob_capsule = NULL, *ob_mode = NULL; FILE *f; int fd; - char *mode; + const char *mode; ob = PyObject_CallMethod(ob_file, "flush", NULL); if (ob == NULL) 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); |