Skip to content

Commit 4406de3

Browse files
committed
Add explicit casts to external C function to make example compile with stricter compiler flags.
1 parent 24265a2 commit 4406de3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ModelicaByExample/Functions/Interpolation/source/VectorTable.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ typedef struct {
1717

1818
void *
1919
createVectorTable(double *data, size_t np) {
20-
VectorTable *table = malloc(sizeof(VectorTable));
20+
VectorTable *table = (VectorTable*) malloc(sizeof(VectorTable));
2121
if (table) {
2222
/* Allocate memory for data */
23-
table->x = malloc(sizeof(double)*np);
23+
table->x = (double*) malloc(sizeof(double)*np);
2424
if (table->x) {
25-
table->y = malloc(sizeof(double)*np);
25+
table->y = (double*) malloc(sizeof(double)*np);
2626
if (table->y) {
2727
/* Copy data into our local array */
2828
size_t i;

0 commit comments

Comments
 (0)