diff options
author | Brett Cannon <bcannon@gmail.com> | 2004-07-10 21:41:14 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2004-07-10 21:41:14 (GMT) |
commit | 3e377decefafa80c6266b54e1e02c4699be7f785 (patch) | |
tree | ff3ecb35faf578276795f749b6569320ce44f21b /Modules/_codecsmodule.c | |
parent | 27d3dda7f16257fe9c9d67292aca8c6fbaa2a84e (diff) | |
download | cpython-3e377decefafa80c6266b54e1e02c4699be7f785.zip cpython-3e377decefafa80c6266b54e1e02c4699be7f785.tar.gz cpython-3e377decefafa80c6266b54e1e02c4699be7f785.tar.bz2 |
Change some declarations from ``char *`` to ``const char *``. Also added
docstrings for decode and encode; accidentally were left out of the PyMethodDev
table.
Diffstat (limited to 'Modules/_codecsmodule.c')
-rw-r--r-- | Modules/_codecsmodule.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c index fdc664b..7509c1b 100644 --- a/Modules/_codecsmodule.c +++ b/Modules/_codecsmodule.c @@ -97,8 +97,8 @@ codecs.register_error that can handle ValueErrors."); static PyObject * codec_encode(PyObject *self, PyObject *args) { - char *encoding = NULL; - char *errors = NULL; + const char *encoding = NULL; + const char *errors = NULL; PyObject *v; if (!PyArg_ParseTuple(args, "O|ss:encode", &v, &encoding, &errors)) @@ -130,8 +130,8 @@ able to handle ValueErrors."); static PyObject * codec_decode(PyObject *self, PyObject *args) { - char *encoding = NULL; - char *errors = NULL; + const char *encoding = NULL; + const char *errors = NULL; PyObject *v; if (!PyArg_ParseTuple(args, "O|ss:decode", &v, &encoding, &errors)) @@ -835,8 +835,10 @@ static PyMethodDef _codecs_functions[] = { register__doc__}, {"lookup", codec_lookup, METH_VARARGS, lookup__doc__}, - {"encode", codec_encode, METH_VARARGS}, - {"decode", codec_decode, METH_VARARGS}, + {"encode", codec_encode, METH_VARARGS, + encode__doc__}, + {"decode", codec_decode, METH_VARARGS, + decode__doc__}, {"escape_encode", escape_encode, METH_VARARGS}, {"escape_decode", escape_decode, METH_VARARGS}, #ifdef Py_USING_UNICODE |