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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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