]> granicus.if.org Git - python/commitdiff
Splitted the WFILE structure to WFILE and RFILE.
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 11 Feb 2015 14:18:09 +0000 (16:18 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Wed, 11 Feb 2015 14:18:09 +0000 (16:18 +0200)
Python/marshal.c

index 51d35c22956fd7511274a99066c6b9d77aac7438..c1ce2fe8d6b47035b00c2aa07caf99ac9556f611 100644 (file)
@@ -65,15 +65,10 @@ typedef struct {
     FILE *fp;
     int error;  /* see WFERR_* values */
     int depth;
-    /* If fp == NULL, the following are valid: */
-    PyObject *readable;    /* Stream-like object being read from */
     PyObject *str;
-    PyObject *current_filename;
     char *ptr;
     char *end;
     char *buf;
-    Py_ssize_t buf_size;
-    PyObject *refs; /* dict on marshal, list on unmarshal */
     _Py_hashtable_t *hashtable;
     int version;
 } WFILE;
@@ -636,7 +631,17 @@ PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version)
     w_flush(&wf);
 }
 
-typedef WFILE RFILE; /* Same struct with different invariants */
+typedef struct {
+    FILE *fp;
+    int depth;
+    PyObject *readable;  /* Stream-like object being read from */
+    PyObject *current_filename;
+    char *ptr;
+    char *end;
+    char *buf;
+    Py_ssize_t buf_size;
+    PyObject *refs;  /* a list */
+} RFILE;
 
 static char *
 r_string(Py_ssize_t n, RFILE *p)