S
Sheldon
Hi Everyone,
I have defined a function:
struct Transient arrFromHdfNode(HL_NodeList *nodelist, struct
Transient retv);
and in the code:
struct Transient arrFromHdfNode(HL_NodeList *nodelist, struct
Transient retv) {
snip
if(hdfdata != NULL) free(hdfdata);
return retv;
fail:
if(hdfdata != NULL) free(hdfdata);
exit(EXIT_FAILURE);
}
called the function like this:
if (arrFromHdfNode(nodelist,retv) == NULL) {
fprintf(stderr,"Failed getting data\n");
goto fail;
or like this
if (!(arrFromHdfNode(nodelist,retv))) {
fprintf(stderr,"Failed getting data\n");
goto fail;
The functions should return a struct or exit(EXIT_FAILURE) if
something went wrong.
For the first call I got the error:
error: invalid operands to binary ==
and for the second I got:
error: wrong type argument to unary exclamation mark
Can someone point me in the right direction? What is going on here?
Thanks in advance,
/S
I have defined a function:
struct Transient arrFromHdfNode(HL_NodeList *nodelist, struct
Transient retv);
and in the code:
struct Transient arrFromHdfNode(HL_NodeList *nodelist, struct
Transient retv) {
snip
if(hdfdata != NULL) free(hdfdata);
return retv;
fail:
if(hdfdata != NULL) free(hdfdata);
exit(EXIT_FAILURE);
}
called the function like this:
if (arrFromHdfNode(nodelist,retv) == NULL) {
fprintf(stderr,"Failed getting data\n");
goto fail;
or like this
if (!(arrFromHdfNode(nodelist,retv))) {
fprintf(stderr,"Failed getting data\n");
goto fail;
The functions should return a struct or exit(EXIT_FAILURE) if
something went wrong.
For the first call I got the error:
error: invalid operands to binary ==
and for the second I got:
error: wrong type argument to unary exclamation mark
Can someone point me in the right direction? What is going on here?
Thanks in advance,
/S