T
Tydr Schnubbis
/* my declarations */
struct bitmap_set {
char *filename;
int n_files;
};
struct bitmap_set bitmap_sets[] = {
/* <filename>, <n_files> */
{ "player_00g.bmp", 1 },
{ "player_00.bmp", 1 },
/* ... snip ...*/
{ NULL, 0 } /* sentinel */
};
/* in a function in the same file: */
ASSERT(strlen(GRAPHICS_DIR) + strlen(OTHER_PATH_SEPARATOR)
+ strlen(bitmap_sets[set_i].filename) /* LINE 71 */
<= MAX_PATH_LENGTH);
/* no warning for this: */
size_t len = strlen(bitmap_sets[set_i].filename);
Compiler message:
gcc -Wall -W -Wno-unused -Wredundant-decls -Winline -ffast-math -O2 -g
-c -o files.o files.c
files.c: In function `files_load_bitmaps':
files.c:71: warning: passing arg 1 of `strlen' makes pointer from
integer without a cast
What's wrong here?
strlen(bitmap_sets[set_i].filename)
is okay in the assignment, but not in the ASSERT().
What am I not seeing here?
Tor
struct bitmap_set {
char *filename;
int n_files;
};
struct bitmap_set bitmap_sets[] = {
/* <filename>, <n_files> */
{ "player_00g.bmp", 1 },
{ "player_00.bmp", 1 },
/* ... snip ...*/
{ NULL, 0 } /* sentinel */
};
/* in a function in the same file: */
ASSERT(strlen(GRAPHICS_DIR) + strlen(OTHER_PATH_SEPARATOR)
+ strlen(bitmap_sets[set_i].filename) /* LINE 71 */
<= MAX_PATH_LENGTH);
/* no warning for this: */
size_t len = strlen(bitmap_sets[set_i].filename);
Compiler message:
gcc -Wall -W -Wno-unused -Wredundant-decls -Winline -ffast-math -O2 -g
-c -o files.o files.c
files.c: In function `files_load_bitmaps':
files.c:71: warning: passing arg 1 of `strlen' makes pointer from
integer without a cast
What's wrong here?
strlen(bitmap_sets[set_i].filename)
is okay in the assignment, but not in the ASSERT().
What am I not seeing here?
Tor