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
Add in_set definition #26
Conversation
High Level Prototypes/hex0.c
Outdated
int in_set(int c, char* s){ | ||
for(int i=0;;i++){ | ||
char a = s[i]; | ||
if(a=='\0'){ | ||
return FALSE; | ||
} | ||
if(a == c){ | ||
return TRUE; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you keep coding style same as in other parts of the file?
Mostly braces, add spaces around ==
.
This addition makes the file compilable so it can be used to test new implementations of hex0 against it.
@stikonas I reviewed the style, hope it's ok now. |
I noticed that not only hex0 but also hex1 and hex2 used the same prototype. Now that stage0-posix was updated to include M2libc, I guess it might be a better idea to instead update the high-level prototype to M2libc and include a Makefile, so that it is more obvious that you need to link with See #27 |
Thank you for bringing this issue to our attention. |
In that case, I must suggest to move the :) |
Absolutely fair ekaitz-zarraga. and if you wish to make a pull request for that change, I certainly would be more than happy to merge that ^_^ |
With this in_set the hex0.c can be compiled and used to test if new implementations of hex0 are working as expected.