]> granicus.if.org Git - python/commitdiff
PyFile_WriteString(): change prototype so that the string arg is
authorTim Peters <tim.peters@gmail.com>
Wed, 28 Nov 2001 22:13:25 +0000 (22:13 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 28 Nov 2001 22:13:25 +0000 (22:13 +0000)
const char* instead of char*.  The change is conceptually correct, and
indirectly fixes a compiler wng introduced when somebody else innocently
passed a const char* to this function.

Include/fileobject.h
Objects/fileobject.c

index 94d35918c5fa6bc9b9fe8584889bfdeb8f1a2feb..632c436c3308c3aac3be6277cb878ace3e6d9a6c 100644 (file)
@@ -21,7 +21,7 @@ extern DL_IMPORT(PyObject *) PyFile_Name(PyObject *);
 extern DL_IMPORT(PyObject *) PyFile_GetLine(PyObject *, int);
 extern DL_IMPORT(int) PyFile_WriteObject(PyObject *, PyObject *, int);
 extern DL_IMPORT(int) PyFile_SoftSpace(PyObject *, int);
-extern DL_IMPORT(int) PyFile_WriteString(char *, PyObject *);
+extern DL_IMPORT(int) PyFile_WriteString(const char *, PyObject *);
 extern DL_IMPORT(int) PyObject_AsFileDescriptor(PyObject *);
 
 /* The default encoding used by the platform file system APIs
index de1a93c44e271e330d87b9af915f3f1439edc428..a60d3ef44aaa44e293291744ce17d49ec57bbb8e 100644 (file)
@@ -1634,7 +1634,7 @@ PyFile_WriteObject(PyObject *v, PyObject *f, int flags)
 }
 
 int
-PyFile_WriteString(char *s, PyObject *f)
+PyFile_WriteString(const char *s, PyObject *f)
 {
        if (f == NULL) {
                /* Should be caused by a pre-existing error */