Jump to content
  • 0
Brynner

question about the typedef

Question

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.

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'

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.