Skip to content

Commit

Permalink
Add explicit casts to external C function to make example compile wit…
Browse files Browse the repository at this point in the history
…h stricter compiler flags.
  • Loading branch information
maltelenz committed May 20, 2014
1 parent 24265a2 commit 4406de3
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -17,12 +17,12 @@ typedef struct {

void *
createVectorTable(double *data, size_t np) {
VectorTable *table = malloc(sizeof(VectorTable));
VectorTable *table = (VectorTable*) malloc(sizeof(VectorTable));
if (table) {
/* Allocate memory for data */
table->x = malloc(sizeof(double)*np);
table->x = (double*) malloc(sizeof(double)*np);
if (table->x) {
table->y = malloc(sizeof(double)*np);
table->y = (double*) malloc(sizeof(double)*np);
if (table->y) {
/* Copy data into our local array */
size_t i;
Expand Down

0 comments on commit 4406de3

Please sign in to comment.