Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove redundant casts
  • Loading branch information
picnixz committed Dec 4, 2024
commit cd2c97facc97dc53020fba1f84d0c001bdaf528b
2 changes: 1 addition & 1 deletion Modules/md5module.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ md5_get_state(PyObject *module)
static MD5object *
newMD5object(MD5State * st)
{
MD5object *md5 = (MD5object *)PyObject_GC_New(MD5object, st->md5_type);
MD5object *md5 = PyObject_GC_New(MD5object, st->md5_type);
if (!md5) {
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/sha1module.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ sha1_get_state(PyObject *module)
static SHA1object *
newSHA1object(SHA1State *st)
{
SHA1object *sha = (SHA1object *)PyObject_GC_New(SHA1object, st->sha1_type);
SHA1object *sha = PyObject_GC_New(SHA1object, st->sha1_type);
if (sha == NULL) {
return NULL;
}
Expand Down
12 changes: 4 additions & 8 deletions Modules/sha2module.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ static void SHA512copy(SHA512object *src, SHA512object *dest)
static SHA256object *
newSHA224object(sha2_state *state)
{
SHA256object *sha = (SHA256object *)PyObject_GC_New(
SHA256object, state->sha224_type);
SHA256object *sha = PyObject_GC_New(SHA256object, state->sha224_type);
if (!sha) {
return NULL;
}
Expand All @@ -115,8 +114,7 @@ newSHA224object(sha2_state *state)
static SHA256object *
newSHA256object(sha2_state *state)
{
SHA256object *sha = (SHA256object *)PyObject_GC_New(
SHA256object, state->sha256_type);
SHA256object *sha = PyObject_GC_New(SHA256object, state->sha256_type);
if (!sha) {
return NULL;
}
Expand All @@ -129,8 +127,7 @@ newSHA256object(sha2_state *state)
static SHA512object *
newSHA384object(sha2_state *state)
{
SHA512object *sha = (SHA512object *)PyObject_GC_New(
SHA512object, state->sha384_type);
SHA512object *sha = PyObject_GC_New(SHA512object, state->sha384_type);
if (!sha) {
return NULL;
}
Expand All @@ -143,8 +140,7 @@ newSHA384object(sha2_state *state)
static SHA512object *
newSHA512object(sha2_state *state)
{
SHA512object *sha = (SHA512object *)PyObject_GC_New(
SHA512object, state->sha512_type);
SHA512object *sha = PyObject_GC_New(SHA512object, state->sha512_type);
if (!sha) {
return NULL;
}
Expand Down
3 changes: 1 addition & 2 deletions Modules/sha3module.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ typedef struct {
static SHA3object *
newSHA3object(PyTypeObject *type)
{
SHA3object *newobj;
newobj = (SHA3object *)PyObject_New(SHA3object, type);
SHA3object *newobj = PyObject_New(SHA3object, type);
if (newobj == NULL) {
return NULL;
}
Expand Down