question about the typedef

Brynner

Community Contributors
Messages
563
Points
0
Github
https://github.com/bgamez23
what happen to typedef int?

typedef int (*AtCommandFunc)(const int fd, struct map_session_data* sd, const char* command, const char* message);
it became typedef bool?

typedef bool (*AtCommandFunc)(const int fd, struct map_session_data* sd, const char* command, const char* message,struct AtCommandInfo *info);
what is the correct way to use the typedef int?

typedef int (*AtCommandFunc)(const int fd, struct map_session_data* sd, const char* command, const char* message);
because im getting warnings.

Code:
srcmapatcommand.c(9694): warning C4113: 'int (__cdecl *)(const int,map_session_data *,const char *,const char *)' differs in parameter lists from 'AtCommandFunc'srcmapatcommand.c(9694): warning C4133: 'initializing' : incompatible types - from 'int (__cdecl *)(const int,map_session_data *,const char *,const char *)' to 'AtCommandFunc'
 
im just asking if the old

typedef int (*AtCommandFunc)(const int fd, struct map_session_data* sd, const char* command, const char* message);
is already replace with the new one. which is.

typedef bool (*AtCommandFunc)(const int fd, struct map_session_data* sd, const char* command, const char* message,struct AtCommandInfo *info);

i hope you get it. because you can't use the old typedef int.

or else you'll got this warning upon compiling.

srcmapatcommand.c(9694): warning C4113: 'int (__cdecl *)(const int,map_session_data *,const char *,const char *)' differs in parameter lists from 'AtCommandFunc'srcmapatcommand.c(9694): warning C4133: 'initializing' : incompatible types - from 'int (__cdecl *)(const int,map_session_data *,const char *,const char *)' to 'AtCommandFunc'
i hope you get it clearly.

 
Back
Top