| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,26 +54,6 @@ DL_IMPORT(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, | |||
| 54 | 54 | ||
| 55 | 55 | /* The rest of the interface is specific for frame objects */ | |
| 56 | 56 | ||
| 57 | - /* Tuple access macros */ | ||
| 58 | - | ||
| 59 | - #ifndef Py_DEBUG | ||
| 60 | - #define GETITEM(v, i) PyTuple_GET_ITEM((PyTupleObject *)(v), (i)) | ||
| 61 | - #define GETITEMNAME(v, i) \ | ||
| 62 | - PyString_AS_STRING((PyStringObject *)GETITEM((v), (i))) | ||
| 63 | - #else | ||
| 64 | - #define GETITEM(v, i) PyTuple_GetItem((v), (i)) | ||
| 65 | - #define GETITEMNAME(v, i) PyString_AsString(GETITEM(v, i)) | ||
| 66 | - #endif | ||
| 67 | - | ||
| 68 | - #define GETUSTRINGVALUE(s) ((unsigned char *)PyString_AS_STRING(s)) | ||
| 69 | - | ||
| 70 | - /* Code access macros */ | ||
| 71 | - | ||
| 72 | - #define Getconst(f, i) (GETITEM((f)->f_code->co_consts, (i))) | ||
| 73 | - #define Getname(f, i) (GETITEMNAME((f)->f_code->co_names, (i))) | ||
| 74 | - #define Getnamev(f, i) (GETITEM((f)->f_code->co_names, (i))) | ||
| 75 | - | ||
| 76 | - | ||
| 77 | 57 | /* Block management functions */ | |
| 78 | 58 | ||
| 79 | 59 | DL_IMPORT(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -521,11 +521,18 @@ eval_frame(PyFrameObject *f) | |||
| 521 | 521 | char *filename; | |
| 522 | 522 | #endif | |
| 523 | 523 | ||
| 524 | + /* Tuple access macros */ | ||
| 525 | + | ||
| 526 | + #ifndef Py_DEBUG | ||
| 527 | + #define GETITEM(v, i) PyTuple_GET_ITEM((PyTupleObject *)(v), (i)) | ||
| 528 | + #else | ||
| 529 | + #define GETITEM(v, i) PyTuple_GetItem((v), (i)) | ||
| 530 | + #endif | ||
| 531 | + | ||
| 524 | 532 | /* Code access macros */ | |
| 525 | 533 | ||
| 526 | - #define GETCONST(i) Getconst(f, i) | ||
| 527 | - #define GETNAME(i) Getname(f, i) | ||
| 528 | - #define GETNAMEV(i) Getnamev(f, i) | ||
| 534 | + #define GETCONST(i) (GETITEM(co->co_consts, (i))) | ||
| 535 | + #define GETNAMEV(i) (GETITEM(co->co_names, (i))) | ||
| 529 | 536 | #define INSTR_OFFSET() (next_instr - first_instr) | |
| 530 | 537 | #define NEXTOP() (*next_instr++) | |
| 531 | 538 | #define NEXTARG() (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2]) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments