Skip to content

Commit 94a6460

Browse files
committed
Revert "remove redundant casts"
This reverts commit cd2c97f.
1 parent a8975ed commit 94a6460

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Modules/md5module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ md5_get_state(PyObject *module)
7272
static MD5object *
7373
newMD5object(MD5State * st)
7474
{
75-
MD5object *md5 = PyObject_GC_New(MD5object, st->md5_type);
75+
MD5object *md5 = (MD5object *)PyObject_GC_New(MD5object, st->md5_type);
7676
if (!md5) {
7777
return NULL;
7878
}

Modules/sha1module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ sha1_get_state(PyObject *module)
7373
static SHA1object *
7474
newSHA1object(SHA1State *st)
7575
{
76-
SHA1object *sha = PyObject_GC_New(SHA1object, st->sha1_type);
76+
SHA1object *sha = (SHA1object *)PyObject_GC_New(SHA1object, st->sha1_type);
7777
if (sha == NULL) {
7878
return NULL;
7979
}

Modules/sha2module.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ static void SHA512copy(SHA512object *src, SHA512object *dest)
101101
static SHA256object *
102102
newSHA224object(sha2_state *state)
103103
{
104-
SHA256object *sha = PyObject_GC_New(SHA256object, state->sha224_type);
104+
SHA256object *sha = (SHA256object *)PyObject_GC_New(
105+
SHA256object, state->sha224_type);
105106
if (!sha) {
106107
return NULL;
107108
}
@@ -114,7 +115,8 @@ newSHA224object(sha2_state *state)
114115
static SHA256object *
115116
newSHA256object(sha2_state *state)
116117
{
117-
SHA256object *sha = PyObject_GC_New(SHA256object, state->sha256_type);
118+
SHA256object *sha = (SHA256object *)PyObject_GC_New(
119+
SHA256object, state->sha256_type);
118120
if (!sha) {
119121
return NULL;
120122
}
@@ -127,7 +129,8 @@ newSHA256object(sha2_state *state)
127129
static SHA512object *
128130
newSHA384object(sha2_state *state)
129131
{
130-
SHA512object *sha = PyObject_GC_New(SHA512object, state->sha384_type);
132+
SHA512object *sha = (SHA512object *)PyObject_GC_New(
133+
SHA512object, state->sha384_type);
131134
if (!sha) {
132135
return NULL;
133136
}
@@ -140,7 +143,8 @@ newSHA384object(sha2_state *state)
140143
static SHA512object *
141144
newSHA512object(sha2_state *state)
142145
{
143-
SHA512object *sha = PyObject_GC_New(SHA512object, state->sha512_type);
146+
SHA512object *sha = (SHA512object *)PyObject_GC_New(
147+
SHA512object, state->sha512_type);
144148
if (!sha) {
145149
return NULL;
146150
}

0 commit comments

Comments
 (0)