Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5b43126e
Commit
5b43126e
authored
Jan 02, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Regenerate.
parent
94962615
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
45 deletions
+45
-45
Python/Python-ast.c
Python/Python-ast.c
+45
-45
No files found.
Python/Python-ast.c
View file @
5b43126e
...
...
@@ -1098,70 +1098,70 @@ alias(identifier name, identifier asname, PyArena *arena)
#define CHECKSIZE(BUF, OFF, MIN) { \
int need = *(OFF) + MIN; \
if (need >= PyString_GET_SIZE(*(BUF))) { \
int newsize = PyString_GET_SIZE(*(BUF)) * 2; \
if (newsize < need) \
newsize = need; \
if (_PyString_Resize((BUF), newsize) < 0) \
return 0; \
} \
}
static
int
int need = *(OFF) + MIN; \
if (need >= PyString_GET_SIZE(*(BUF))) { \
int newsize = PyString_GET_SIZE(*(BUF)) * 2; \
if (newsize < need) \
newsize = need; \
if (_PyString_Resize((BUF), newsize) < 0) \
return 0; \
} \
}
static
int
marshal_write_int
(
PyObject
**
buf
,
int
*
offset
,
int
x
)
{
char
*
s
;
char
*
s
;
CHECKSIZE
(
buf
,
offset
,
4
)
s
=
PyString_AS_STRING
(
*
buf
)
+
(
*
offset
);
s
[
0
]
=
(
x
&
0xff
);
s
[
1
]
=
(
x
>>
8
)
&
0xff
;
s
[
2
]
=
(
x
>>
16
)
&
0xff
;
s
[
3
]
=
(
x
>>
24
)
&
0xff
;
*
offset
+=
4
;
return
1
;
CHECKSIZE
(
buf
,
offset
,
4
)
s
=
PyString_AS_STRING
(
*
buf
)
+
(
*
offset
);
s
[
0
]
=
(
x
&
0xff
);
s
[
1
]
=
(
x
>>
8
)
&
0xff
;
s
[
2
]
=
(
x
>>
16
)
&
0xff
;
s
[
3
]
=
(
x
>>
24
)
&
0xff
;
*
offset
+=
4
;
return
1
;
}
static
int
static
int
marshal_write_bool
(
PyObject
**
buf
,
int
*
offset
,
bool
b
)
{
if
(
b
)
marshal_write_int
(
buf
,
offset
,
1
);
else
marshal_write_int
(
buf
,
offset
,
0
);
return
1
;
if
(
b
)
marshal_write_int
(
buf
,
offset
,
1
);
else
marshal_write_int
(
buf
,
offset
,
0
);
return
1
;
}
static
int
static
int
marshal_write_identifier
(
PyObject
**
buf
,
int
*
offset
,
identifier
id
)
{
int
l
=
PyString_GET_SIZE
(
id
);
marshal_write_int
(
buf
,
offset
,
l
);
CHECKSIZE
(
buf
,
offset
,
l
);
memcpy
(
PyString_AS_STRING
(
*
buf
)
+
*
offset
,
PyString_AS_STRING
(
id
),
l
);
*
offset
+=
l
;
return
1
;
int
l
=
PyString_GET_SIZE
(
id
);
marshal_write_int
(
buf
,
offset
,
l
);
CHECKSIZE
(
buf
,
offset
,
l
);
memcpy
(
PyString_AS_STRING
(
*
buf
)
+
*
offset
,
PyString_AS_STRING
(
id
),
l
);
*
offset
+=
l
;
return
1
;
}
static
int
static
int
marshal_write_string
(
PyObject
**
buf
,
int
*
offset
,
string
s
)
{
int
len
=
PyString_GET_SIZE
(
s
);
marshal_write_int
(
buf
,
offset
,
len
);
CHECKSIZE
(
buf
,
offset
,
len
);
memcpy
(
PyString_AS_STRING
(
*
buf
)
+
*
offset
,
PyString_AS_STRING
(
s
),
len
);
*
offset
+=
len
;
return
1
;
int
len
=
PyString_GET_SIZE
(
s
);
marshal_write_int
(
buf
,
offset
,
len
);
CHECKSIZE
(
buf
,
offset
,
len
);
memcpy
(
PyString_AS_STRING
(
*
buf
)
+
*
offset
,
PyString_AS_STRING
(
s
),
len
);
*
offset
+=
len
;
return
1
;
}
static
int
static
int
marshal_write_object
(
PyObject
**
buf
,
int
*
offset
,
object
s
)
{
/* XXX */
return
0
;
/* XXX */
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment