mirror of https://github.com/python/cpython
ANSI-fication of the sources.
This commit is contained in:
parent
1f0968c5f8
commit
1b190b4636
|
@ -36,9 +36,7 @@ static struct memberlist frame_memberlist[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
frame_getattr(f, name)
|
frame_getattr(PyFrameObject *f, char *name)
|
||||||
PyFrameObject *f;
|
|
||||||
char *name;
|
|
||||||
{
|
{
|
||||||
if (strcmp(name, "f_locals") == 0)
|
if (strcmp(name, "f_locals") == 0)
|
||||||
PyFrame_FastToLocals(f);
|
PyFrame_FastToLocals(f);
|
||||||
|
@ -46,10 +44,7 @@ frame_getattr(f, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
frame_setattr(f, name, value)
|
frame_setattr(PyFrameObject *f, char *name, PyObject *value)
|
||||||
PyFrameObject *f;
|
|
||||||
char *name;
|
|
||||||
PyObject *value;
|
|
||||||
{
|
{
|
||||||
return PyMember_Set((char *)f, frame_memberlist, name, value);
|
return PyMember_Set((char *)f, frame_memberlist, name, value);
|
||||||
}
|
}
|
||||||
|
@ -76,8 +71,7 @@ frame_setattr(f, name, value)
|
||||||
static PyFrameObject *free_list = NULL;
|
static PyFrameObject *free_list = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
frame_dealloc(f)
|
frame_dealloc(PyFrameObject *f)
|
||||||
PyFrameObject *f;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
PyObject **fastlocals;
|
PyObject **fastlocals;
|
||||||
|
@ -121,11 +115,8 @@ PyTypeObject PyFrame_Type = {
|
||||||
};
|
};
|
||||||
|
|
||||||
PyFrameObject *
|
PyFrameObject *
|
||||||
PyFrame_New(tstate, code, globals, locals)
|
PyFrame_New(PyThreadState *tstate, PyCodeObject *code,
|
||||||
PyThreadState *tstate;
|
PyObject *globals, PyObject *locals)
|
||||||
PyCodeObject *code;
|
|
||||||
PyObject *globals;
|
|
||||||
PyObject *locals;
|
|
||||||
{
|
{
|
||||||
PyFrameObject *back = tstate->frame;
|
PyFrameObject *back = tstate->frame;
|
||||||
static PyObject *builtin_object;
|
static PyObject *builtin_object;
|
||||||
|
@ -238,11 +229,7 @@ PyFrame_New(tstate, code, globals, locals)
|
||||||
/* Block management */
|
/* Block management */
|
||||||
|
|
||||||
void
|
void
|
||||||
PyFrame_BlockSetup(f, type, handler, level)
|
PyFrame_BlockSetup(PyFrameObject *f, int type, int handler, int level)
|
||||||
PyFrameObject *f;
|
|
||||||
int type;
|
|
||||||
int handler;
|
|
||||||
int level;
|
|
||||||
{
|
{
|
||||||
PyTryBlock *b;
|
PyTryBlock *b;
|
||||||
if (f->f_iblock >= CO_MAXBLOCKS)
|
if (f->f_iblock >= CO_MAXBLOCKS)
|
||||||
|
@ -254,8 +241,7 @@ PyFrame_BlockSetup(f, type, handler, level)
|
||||||
}
|
}
|
||||||
|
|
||||||
PyTryBlock *
|
PyTryBlock *
|
||||||
PyFrame_BlockPop(f)
|
PyFrame_BlockPop(PyFrameObject *f)
|
||||||
PyFrameObject *f;
|
|
||||||
{
|
{
|
||||||
PyTryBlock *b;
|
PyTryBlock *b;
|
||||||
if (f->f_iblock <= 0)
|
if (f->f_iblock <= 0)
|
||||||
|
@ -267,8 +253,7 @@ PyFrame_BlockPop(f)
|
||||||
/* Convert between "fast" version of locals and dictionary version */
|
/* Convert between "fast" version of locals and dictionary version */
|
||||||
|
|
||||||
void
|
void
|
||||||
PyFrame_FastToLocals(f)
|
PyFrame_FastToLocals(PyFrameObject *f)
|
||||||
PyFrameObject *f;
|
|
||||||
{
|
{
|
||||||
/* Merge fast locals into f->f_locals */
|
/* Merge fast locals into f->f_locals */
|
||||||
PyObject *locals, *map;
|
PyObject *locals, *map;
|
||||||
|
@ -312,9 +297,7 @@ PyFrame_FastToLocals(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PyFrame_LocalsToFast(f, clear)
|
PyFrame_LocalsToFast(PyFrameObject *f, int clear)
|
||||||
PyFrameObject *f;
|
|
||||||
int clear;
|
|
||||||
{
|
{
|
||||||
/* Merge f->f_locals into fast locals */
|
/* Merge f->f_locals into fast locals */
|
||||||
PyObject *locals, *map;
|
PyObject *locals, *map;
|
||||||
|
@ -349,7 +332,7 @@ PyFrame_LocalsToFast(f, clear)
|
||||||
/* Clear out the free list */
|
/* Clear out the free list */
|
||||||
|
|
||||||
void
|
void
|
||||||
PyFrame_Fini()
|
PyFrame_Fini(void)
|
||||||
{
|
{
|
||||||
while (free_list != NULL) {
|
while (free_list != NULL) {
|
||||||
PyFrameObject *f = free_list;
|
PyFrameObject *f = free_list;
|
||||||
|
|
Loading…
Reference in New Issue