Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make 3 casts explicit #1523

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/calcium.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ CALCIUM_INLINE
void calcium_stream_init_str(calcium_stream_t out)
{
out->fp = NULL;
out->s = flint_malloc(16);
out->s = (char *) flint_malloc(16);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you need to cast a void *?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid in C++.

out->s[0] = '\0';
out->len = 0;
out->alloc = 16;
Expand Down
4 changes: 2 additions & 2 deletions src/fexpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ FEXPR_INLINE fexpr_ptr
_fexpr_vec_init(slong len)
{
slong i;
fexpr_ptr vec = (fexpr_struct *) flint_malloc(sizeof(fexpr_struct) * len);
fexpr_ptr vec = (fexpr_ptr) flint_malloc(sizeof(fexpr_struct) * len);
for (i = 0; i < len; i++)
fexpr_init(vec + i);
return vec;
Expand Down Expand Up @@ -456,7 +456,7 @@ fexpr_vec_init(fexpr_vec_t vec, slong len)
else
{
slong i;
vec->entries = flint_malloc(sizeof(fexpr_struct) * len);
vec->entries = (fexpr_ptr) flint_malloc(sizeof(fexpr_struct) * len);
for (i = 0; i < len; i++)
fexpr_init(vec->entries + i);
vec->length = vec->alloc = len;
Expand Down