Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 8f908ec

Browse files
Anselm KruisAnselm Kruis
Anselm Kruis
authored and
Anselm Kruis
committed
Stackless issue #179: Rename smelly symbols
Rename the following symbols (reported by Tools/scripts/smelly.py): _dont_optimise_away_goobledigoobs -> slp_dont_optimise_away_goobledigoobs _dont_optimise_away_saved_tstat_with_magic -> slp_dont_optimise_away_saved_tstat_with_magic _dont_optimise_away_slp_eval_frame_functions -> slp_dont_optimise_away_slp_eval_frame_functions channel_seq_callback -> slp_channel_seq_callback init_cframetype -> slp_init_cframetype init_prickelpit -> slp_init_prickelpit
1 parent d211caa commit 8f908ec

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

Python/ceval.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3863,7 +3863,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
38633863

38643864
#ifdef STACKLESS
38653865
/* a global write only dummy variable */
3866-
char _dont_optimise_away_slp_eval_frame_functions;
3866+
char slp_dont_optimise_away_slp_eval_frame_functions;
38673867

38683868
PyObject * _Py_HOT_FUNCTION
38693869
slp_eval_frame_noval(PyFrameObject *f, int throwflag, PyObject *retval)
@@ -3874,7 +3874,7 @@ slp_eval_frame_noval(PyFrameObject *f, int throwflag, PyObject *retval)
38743874
* it serves as a marker whether we expect a value or
38753875
* not, and it makes debugging a little easier.
38763876
*/
3877-
_dont_optimise_away_slp_eval_frame_functions = 1;
3877+
slp_dont_optimise_away_slp_eval_frame_functions = 1;
38783878
r = slp_eval_frame_value(f, throwflag, retval);
38793879
return r;
38803880
}
@@ -3889,7 +3889,7 @@ slp_eval_frame_iter(PyFrameObject *f, int throwflag, PyObject *retval)
38893889
* for_iter operation. In this case we need to handle
38903890
* null without error as valid result.
38913891
*/
3892-
_dont_optimise_away_slp_eval_frame_functions = 2;
3892+
slp_dont_optimise_away_slp_eval_frame_functions = 2;
38933893
r = slp_eval_frame_value(f, throwflag, retval);
38943894
return r;
38953895
}
@@ -3904,7 +3904,7 @@ slp_eval_frame_setup_with(PyFrameObject *f, int throwflag, PyObject *retval)
39043904
* SETUP_WITH operation.
39053905
* NOTE / XXX: see above.
39063906
*/
3907-
_dont_optimise_away_slp_eval_frame_functions = 3;
3907+
slp_dont_optimise_away_slp_eval_frame_functions = 3;
39083908
r = slp_eval_frame_value(f, throwflag, retval);
39093909
return r;
39103910
}
@@ -3919,7 +3919,7 @@ slp_eval_frame_with_cleanup(PyFrameObject *f, int throwflag, PyObject *retval)
39193919
* WITH_CLEANUP operation.
39203920
* NOTE / XXX: see above.
39213921
*/
3922-
_dont_optimise_away_slp_eval_frame_functions = 4;
3922+
slp_dont_optimise_away_slp_eval_frame_functions = 4;
39233923
r = slp_eval_frame_value(f, throwflag, retval);
39243924
return r;
39253925
}

Stackless/core/cframeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ PyTypeObject PyCFrame_Type = {
319319
PyObject_Del, /* tp_free */
320320
};
321321

322-
int init_cframetype(void)
322+
int slp_init_cframetype(void)
323323
{
324324
if (PyType_Ready(&PyCFrame_Type))
325325
return -1;

Stackless/core/cframeobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
int init_cframetype(void);
2+
int slp_init_cframetype(void);

Stackless/core/slp_transfer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ extern int slp_switch(void);
8686
#endif
8787

8888
/* a write only variable used to prevent overly optimisation */
89-
intptr_t *_dont_optimise_away_goobledigoobs;
89+
intptr_t *slp_dont_optimise_away_goobledigoobs;
9090
static int
9191
climb_stack_and_transfer(PyCStackObject **cstprev, PyCStackObject *cst,
9292
PyTaskletObject *prev)
@@ -109,7 +109,7 @@ climb_stack_and_transfer(PyCStackObject **cstprev, PyCStackObject *cst,
109109
/* hinder the compiler to optimise away
110110
goobledigoobs and the alloca call.
111111
This happens with gcc 4.7.x and -O2 */
112-
_dont_optimise_away_goobledigoobs = goobledigoobs;
112+
slp_dont_optimise_away_goobledigoobs = goobledigoobs;
113113
}
114114
return slp_transfer(cstprev, cst, prev);
115115
}

Stackless/module/channelobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ _channel_send_sequence(PyChannelObject *self, PyObject *v)
960960
*/
961961

962962
PyObject *
963-
channel_seq_callback(PyFrameObject *_f, int exc, PyObject *retval)
963+
slp_channel_seq_callback(PyFrameObject *_f, int exc, PyObject *retval)
964964
{
965965
PyThreadState *ts = PyThreadState_GET();
966966
PyCFrameObject *f = (PyCFrameObject *) _f;
@@ -1046,7 +1046,7 @@ channel_send_sequence(PyChannelObject *self, PyObject *v)
10461046
if (it == NULL)
10471047
return NULL;
10481048

1049-
f = slp_cframe_new(channel_seq_callback, 1);
1049+
f = slp_cframe_new(slp_channel_seq_callback, 1);
10501050
if (f == NULL)
10511051
goto error;
10521052

Stackless/module/channelobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
PyObject * channel_seq_callback(struct _frame *f, int throwflag,
2+
PyObject * slp_channel_seq_callback(struct _frame *f, int throwflag,
33
PyObject *retval);

Stackless/module/scheduling.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ typedef struct {
355355
/* not a valid ptr and not a common integer */
356356
#define SAVED_TSTATE_MAGIC1 (((intptr_t)transfer_with_tracing)+1)
357357
#define SAVED_TSTATE_MAGIC2 (-1*((intptr_t)transfer_with_tracing))
358-
saved_tstat_with_magic_t * _dont_optimise_away_saved_tstat_with_magic;
358+
saved_tstat_with_magic_t * slp_dont_optimise_away_saved_tstat_with_magic;
359359

360360
static int
361361
transfer_with_tracing(PyCStackObject **cstprev, PyCStackObject *cst, PyTaskletObject *prev)
@@ -370,7 +370,7 @@ transfer_with_tracing(PyCStackObject **cstprev, PyCStackObject *cst, PyTaskletOb
370370
/* prevent overly compiler optimisation.
371371
We store the address of sm into a global variable.
372372
This way the optimizer can't change the layout of the structure. */
373-
_dont_optimise_away_saved_tstat_with_magic = &sm;
373+
slp_dont_optimise_away_saved_tstat_with_magic = &sm;
374374

375375
sm.s.tracing = ts->tracing;
376376
sm.s.c_profilefunc = ts->c_profilefunc;

Stackless/module/stacklessmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ PyInit__stackless(void)
17021702
};
17031703

17041704
if (0
1705-
|| init_cframetype()
1705+
|| slp_init_cframetype()
17061706
|| PyType_Ready(&PyChannel_Type)
17071707
|| PyType_Ready(&PyAtomic_Type)
17081708
)
@@ -1733,7 +1733,7 @@ PyInit__stackless(void)
17331733
Py_DECREF(tmp);
17341734

17351735
/* add the prickelpit submodule */
1736-
tmp = init_prickelpit();
1736+
tmp = slp_init_prickelpit();
17371737
if (tmp == NULL)
17381738
goto fail;
17391739
INSERT("_wrap", tmp);

Stackless/pickling/prickelpit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ DEF_INVALID_EXEC(eval_frame_noval)
840840
DEF_INVALID_EXEC(eval_frame_iter)
841841
DEF_INVALID_EXEC(eval_frame_setup_with)
842842
DEF_INVALID_EXEC(eval_frame_with_cleanup)
843-
DEF_INVALID_EXEC(channel_seq_callback)
843+
DEF_INVALID_EXEC(slp_channel_seq_callback)
844844
DEF_INVALID_EXEC(slp_restore_tracing)
845845
DEF_INVALID_EXEC(slp_tp_init_callback)
846846

@@ -1205,7 +1205,7 @@ static int init_frametype(PyObject * mod)
12051205
|| slp_register_execute(&PyFrame_Type, "eval_frame_with_cleanup",
12061206
slp_eval_frame_with_cleanup, REF_INVALID_EXEC(eval_frame_with_cleanup))
12071207
|| slp_register_execute(&PyCFrame_Type, "channel_seq_callback",
1208-
channel_seq_callback, REF_INVALID_EXEC(channel_seq_callback))
1208+
slp_channel_seq_callback, REF_INVALID_EXEC(slp_channel_seq_callback))
12091209
|| slp_register_execute(&PyCFrame_Type, "slp_restore_tracing",
12101210
slp_restore_tracing, REF_INVALID_EXEC(slp_restore_tracing))
12111211
|| slp_register_execute(&PyCFrame_Type, "slp_tp_init_callback",
@@ -1986,7 +1986,7 @@ static struct PyModuleDef _wrapmodule = {
19861986
};
19871987

19881988
PyObject*
1989-
init_prickelpit(void)
1989+
slp_init_prickelpit(void)
19901990
{
19911991
PyObject *tmp;
19921992

Stackless/pickling/prickelpit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern char slp_pickle_moduledict__doc__[];
5151

5252
/* initialization */
5353

54-
PyObject *init_prickelpit(void);
54+
PyObject *slp_init_prickelpit(void);
5555

5656
#ifdef __cplusplus
5757
}

0 commit comments

Comments
 (0)