summaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
authorTim Wiederhake <twied@gmx.net>2023-12-30 20:49:48 +0100
committerTim Wiederhake <twied@gmx.net>2024-01-21 13:14:37 +0100
commit365a94b62df6144ad016e587f3756d974b6e2018 (patch)
tree08182cf099e612ba7830c929375c56c06035368a /src/parse.c
parent7fe0acdb259c7dd9f3b6214ba16f272da81beadb (diff)
Add explicit cast after memory allocation
Still valid c, but now also valid c++. Signed-off-by: Tim Wiederhake <twied@gmx.net>
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parse.c b/src/parse.c
index 0ad806e..4ffc4aa 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -1037,7 +1037,7 @@ do_var_savecolor(int key)
Cptr cptrav, cpnew;
if (!chead) {
- chead = malloc(sizeof(Cnode));
+ chead = (Cnode *) malloc(sizeof(Cnode));
chead->i = key;
chead->next = NULL;
}
@@ -1046,7 +1046,7 @@ do_var_savecolor(int key)
while (cptrav->next != NULL) {
cptrav = cptrav->next;
}
- cpnew = malloc(sizeof(Cnode));
+ cpnew = (Cnode *) malloc(sizeof(Cnode));
cpnew->i = key;
cpnew->next = NULL;
cptrav->next = cpnew;
@@ -1155,7 +1155,7 @@ do_squeeze_entry(name_list ** list, char *name, int justify, int num, int denom)
if (HasShape) {
SqueezeInfo *sinfo;
- sinfo = malloc(sizeof(SqueezeInfo));
+ sinfo = (SqueezeInfo *) malloc(sizeof(SqueezeInfo));
if (!sinfo) {
parseWarning("unable to allocate %lu bytes for squeeze info",