]> granicus.if.org Git - python/commitdiff
SF patch #470393 (Jim Ahlstrom): Add missing marshal function
authorGuido van Rossum <guido@python.org>
Fri, 19 Oct 2001 01:46:21 +0000 (01:46 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 19 Oct 2001 01:46:21 +0000 (01:46 +0000)
    In Include/, marshal.h declares both
    PyMarshal_ReadLongFromFile()
    and PyMarshal_ReadShortFromFile(),
    but the second is missing from marshal.c.

[Shouldn't the return type be declared as 'short' instead of 'int'?
But 'int' is what was in marshal.h all those years...  --Guido]

Python/marshal.c

index 944ae35a0c1f4373f0458785d8f1afac58bac0f0..806b91c71d4402767e0874888691447b330b4f24 100644 (file)
@@ -635,6 +635,14 @@ r_object(RFILE *p)
        }
 }
 
+int
+PyMarshal_ReadShortFromFile(FILE *fp)
+{
+       RFILE rf;
+       rf.fp = fp;
+       return r_short(&rf);
+}
+
 long
 PyMarshal_ReadLongFromFile(FILE *fp)
 {