summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-11 14:18:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-11 14:18:09 (GMT)
commitc07422c119ab1f53fbaec489872af7e89d6dde4f (patch)
tree00b8bc5254bdbf25151b75367698d96ec52a2691 /Python
parentc1efe5f0396210be09a5ed540cfc8f5dd0a787f4 (diff)
downloadcpython-c07422c119ab1f53fbaec489872af7e89d6dde4f.zip
cpython-c07422c119ab1f53fbaec489872af7e89d6dde4f.tar.gz
cpython-c07422c119ab1f53fbaec489872af7e89d6dde4f.tar.bz2
Splitted the WFILE structure to WFILE and RFILE.
Diffstat (limited to 'Python')
-rw-r--r--Python/marshal.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 51d35c2..c1ce2fe 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -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)