-
Notifications
You must be signed in to change notification settings - Fork 120
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
Fix returning argument types from methods. #3
Conversation
@@ -433,7 +433,7 @@ unsigned method_get_number_of_arguments(struct objc_method *method) | |||
char* method_copyArgumentType(Method method, unsigned int index) | |||
{ | |||
if (NULL == method) { return NULL; } | |||
const char *types = findParameterStart(method->types, index); | |||
const char *types = findParameterStart(method->types, index + 1); |
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.
Does method_getArgumentType
need the same fix? And please can we have a test case?
It did indeed.
Included now. |
@@ -393,7 +393,7 @@ void method_getArgumentType(Method method, | |||
size_t dst_len) | |||
{ | |||
if (NULL == method) { return; } | |||
const char *types = findParameterStart(method->types, index); | |||
const char *types = findParameterStart(method->types, index + 1); |
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.
Rather than having the +1 in both places, it would probably be cleaner to fix findParaneterStart
to start in the right place.
Good idea, thanks. Fixed now. |
Fix returning argument types from methods.
A tiny fix: method_copyArgumentType() didn't account for the fact that the return type is the first element in the method signature.