#define UWORD2 unsigned short int
typedef BYTE Boolean;
Boolean evaluateBit(UWORD2 *value, int bitnumber);
Boolean evaluateBit(UWORD2 *value, int bitnumber) {
int one=1;
return (one &(*value >bitnumber));
}
When I call the function like this:
#include <stdlib.h>
#define UWORD2 unsigned short int
typedef BYTE Boolean;
Boolean evaluateBit(UWORD2 *value, int bitnumber);
int main(void) {
Boolean island;
int row=15;
int col=15;
int i,j;
float qual[row][col];
/* another function assigns values to qual and at the same time casts
them to float */
/* below the float values are recasted to unsigned char before being
sent to the function */
for (i=0;i<col;i++){
for (j=0;j<row;j++){
island = evaluateBit((unsigned char)&qual[i][j],4);
}
}
return (1)
}
Boolean evaluateBit(UWORD2 *value, int bitnumber) {
int one=1;
return (one &(*value >bitnumber));
}
I get the following warning:
"warning: passing arg 1 of `evaluateBit' makes pointer from integer
without a cast"
I don't understand the return statement and why this warning occurs.
Thanks in advance,
Sheldon