Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function types behaviour #251

Merged
merged 3 commits into from Jan 17, 2014
Merged

Function types behaviour #251

merged 3 commits into from Jan 17, 2014

Conversation

panikon
Copy link
Member

@panikon panikon commented Jan 14, 2014

Updated return values of some atcommands.
Altered many function types from int to bool(C99) and added meaningful return values.
Altered many function types from int to void as they didn't have any meaningful return value.
Replaced chrif_char_offline with a macro as this function did exactly the same as chrif_char_offline_nsd.

Altered many function types from int to bool(C99) and added meaningful return values.
Altered many function types from int to void as they didn't have any meaningful return value.
Replaced chrif_char_offline with a macro as this function did exactly the same as chrif_char_offline_nsd.
@shennetsind
Copy link
Member

Hi.
Thank you for your contribution its much appreciated.
I have a point I'd like to bring up, you've modified chrif_parse's return value however that is a RecvFunc type and since all the others passed untouched, it'd be a type mismatch error

typedef int (*RecvFunc)(int fd);
        session[chrif->fd]->func_parse = chrif->parse;

I'd ask you to revert that for the sake of the remainder of your pull request, so we can merge it as soon as possible to avoid any conflicts future commits may cause to it (and we can see about the recvtype stuff afterwards).
There are two other things, the chrif.h interface members for char_ask_name_answer and changemapserverack are not matching their chrif.c functions.
Once again thank you for your contribution, looking forward to the revisions.

@panikon
Copy link
Member Author

panikon commented Jan 15, 2014

Sorry about those mistakes in those interface members, there wasn't any errors or warnings when I built and usually when there were any mismatches between members and their functions there were, so I didn't even recheck them. I already changed those errors and sent a patch. https://github.com/panikon/Hercules/commit/761d3eb8291c997a627dc42da39913eb52abfce3
Thank you for your time.

@@ -239,8 +238,8 @@ int chrif_isconnected(void) {
* Flag = 1: Character is quitting
* Flag = 2: Character is changing map-servers
*------------------------------------------*/
int chrif_save(struct map_session_data *sd, int flag) {
nullpo_retr(-1, sd);
bool chrif_save(struct map_session_data *sd, int flag) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Careful here, there's still a chrif_check(-1) (line 254) that returns -1

@MishimaHaruna
Copy link
Member

Hello! Thanks for your contribution. There are a few more little things I pointed out, if you could fix those, I believe we can merge it

@panikon
Copy link
Member Author

panikon commented Jan 16, 2014

Thank you for pointing out those mistakes, I corrected them and already pushed https://github.com/panikon/Hercules/commit/0267cad28133b4c245f1cf100a24ab8a14cf2a73

MishimaHaruna added a commit that referenced this pull request Jan 17, 2014
Function types behaviour
@MishimaHaruna MishimaHaruna merged commit e9affc5 into HerculesWS:master Jan 17, 2014
@MishimaHaruna
Copy link
Member

Merged. Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants