Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c07422c

Browse files
Splitted the WFILE structure to WFILE and RFILE.
1 parent c1efe5f commit c07422c

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

Python/marshal.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,10 @@ typedef struct {
6565
FILE *fp;
6666
int error; /* see WFERR_* values */
6767
int depth;
68-
/* If fp == NULL, the following are valid: */
69-
PyObject *readable; /* Stream-like object being read from */
7068
PyObject *str;
71-
PyObject *current_filename;
7269
char *ptr;
7370
char *end;
7471
char *buf;
75-
Py_ssize_t buf_size;
76-
PyObject *refs; /* dict on marshal, list on unmarshal */
7772
_Py_hashtable_t *hashtable;
7873
int version;
7974
} WFILE;
@@ -636,7 +631,17 @@ PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version)
636631
w_flush(&wf);
637632
}
638633

639-
typedef WFILE RFILE; /* Same struct with different invariants */
634+
typedef struct {
635+
FILE *fp;
636+
int depth;
637+
PyObject *readable; /* Stream-like object being read from */
638+
PyObject *current_filename;
639+
char *ptr;
640+
char *end;
641+
char *buf;
642+
Py_ssize_t buf_size;
643+
PyObject *refs; /* a list */
644+
} RFILE;
640645

641646
static char *
642647
r_string(Py_ssize_t n, RFILE *p)

0 commit comments

Comments
 (0)