]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix peg_generator compiler warnings under MSVC (GH-20405)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 26 May 2020 04:52:21 +0000 (21:52 -0700)
committerGitHub <noreply@github.com>
Tue, 26 May 2020 04:52:21 +0000 (21:52 -0700)
(cherry picked from commit a2bbedc8b18c001d2f9e702e6e678efbb2990daa)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Parser/tokenizer.c
Tools/peg_generator/peg_extension/peg_extension.c

index b81fa118f216eb051247e9eefe3c989de9be4e56..cebfadc8e89f3040cdb685a9761dbfd9428623fb 100644 (file)
                || c == '_'\
                || (c >= 128))
 
-extern char *PyOS_Readline(FILE *, FILE *, const char *);
-/* Return malloc'ed string including trailing \n;
-   empty malloc'ed string for EOF;
-   NULL if interrupted */
 
 /* Don't ever change this -- it would break the portability of Python code */
 #define TABSIZE 8
index fb552eed3ba01a8fe27ad4b258f47ecff5cd3c74..96d3a52b8808803af3b3c9fbb45c48725e56aa93 100644 (file)
@@ -96,21 +96,21 @@ error:
 }
 
 static PyObject *
-clear_memo_stats()
+clear_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
 {
     _PyPegen_clear_memo_statistics();
     Py_RETURN_NONE;
 }
 
 static PyObject *
-get_memo_stats()
+get_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
 {
     return _PyPegen_get_memo_statistics();
 }
 
 // TODO: Write to Python's sys.stdout instead of C's stdout.
 static PyObject *
-dump_memo_stats()
+dump_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored))
 {
     PyObject *list = _PyPegen_get_memo_statistics();
     if (list == NULL) {
@@ -124,7 +124,7 @@ dump_memo_stats()
             break;
         }
         if (count > 0) {
-            printf("%4ld %9ld\n", i, count);
+            printf("%4zd %9ld\n", i, count);
         }
     }
     Py_DECREF(list);