Skip to content

Commit aad76e9

Browse files
Use intermingled declarations for new code
1 parent 8583991 commit aad76e9

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Modules/_bz2module.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ _bz2_BZ2Compressor_impl(PyTypeObject *type, int compresslevel)
338338
/*[clinic end generated code: output=83346c96beaacad7 input=d4500d2a52c8b263]*/
339339
{
340340
int bzerror;
341-
BZ2Compressor *self;
342341

343342
if (!(1 <= compresslevel && compresslevel <= 9)) {
344343
PyErr_SetString(PyExc_ValueError,
@@ -347,7 +346,7 @@ _bz2_BZ2Compressor_impl(PyTypeObject *type, int compresslevel)
347346
}
348347

349348
assert(type != NULL && type->tp_alloc != NULL);
350-
self = (BZ2Compressor *)type->tp_alloc(type, 0);
349+
BZ2Compressor *self = (BZ2Compressor *)type->tp_alloc(type, 0);
351350
if (self == NULL) {
352351
return NULL;
353352
}
@@ -642,11 +641,10 @@ static PyObject *
642641
_bz2_BZ2Decompressor_impl(PyTypeObject *type)
643642
/*[clinic end generated code: output=5150d51ccaab220e input=b87413ce51853528]*/
644643
{
645-
BZ2Decompressor *self;
646644
int bzerror;
647645

648646
assert(type != NULL && type->tp_alloc != NULL);
649-
self = (BZ2Decompressor *)type->tp_alloc(type, 0);
647+
BZ2Decompressor *self = (BZ2Decompressor *)type->tp_alloc(type, 0);
650648
if (self == NULL) {
651649
return NULL;
652650
}

Modules/_lzmamodule.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,6 @@ Compressor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
775775
uint32_t preset = LZMA_PRESET_DEFAULT;
776776
PyObject *preset_obj = Py_None;
777777
PyObject *filterspecs = Py_None;
778-
Compressor *self;
779778

780779
_lzma_state *state = PyType_GetModuleState(type);
781780
assert(state != NULL);
@@ -803,7 +802,7 @@ Compressor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
803802
}
804803

805804
assert(type != NULL && type->tp_alloc != NULL);
806-
self = (Compressor *)type->tp_alloc(type, 0);
805+
Compressor *self = (Compressor *)type->tp_alloc(type, 0);
807806
if (self == NULL) {
808807
return NULL;
809808
}
@@ -1204,7 +1203,6 @@ _lzma_LZMADecompressor_impl(PyTypeObject *type, int format,
12041203
PyObject *memlimit, PyObject *filters)
12051204
/*[clinic end generated code: output=2d46d5e70f10bc7f input=ca40cd1cb1202b0d]*/
12061205
{
1207-
Decompressor *self;
12081206
const uint32_t decoder_flags = LZMA_TELL_ANY_CHECK | LZMA_TELL_NO_CHECK;
12091207
uint64_t memlimit_ = UINT64_MAX;
12101208
lzma_ret lzret;
@@ -1234,7 +1232,7 @@ _lzma_LZMADecompressor_impl(PyTypeObject *type, int format,
12341232
}
12351233

12361234
assert(type != NULL && type->tp_alloc != NULL);
1237-
self = (Decompressor *)type->tp_alloc(type, 0);
1235+
Decompressor *self = (Decompressor *)type->tp_alloc(type, 0);
12381236
if (self == NULL) {
12391237
return NULL;
12401238
}

0 commit comments

Comments
 (0)