diff Modules/_codecsmodule.c @ 32602:ab979ff8b02a legacy-trunk

Change some declarations from ``char *`` to ``const char *``. Also added docstrings for decode and encode; accidentally were left out of the PyMethodDev table.
author Brett Cannon <bcannon@gmail.com>
date Sat, 10 Jul 2004 21:41:14 +0000
parents 8ea2cb1ec598
children 57478a13fbf6
line wrap: on
line diff
--- a/Modules/_codecsmodule.c	Sat Jul 10 21:36:55 2004 +0000
+++ b/Modules/_codecsmodule.c	Sat Jul 10 21:41:14 2004 +0000
@@ -97,8 +97,8 @@
 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 @@
 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 @@
         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