-
Notifications
You must be signed in to change notification settings - Fork 683
Remove EXTERN_C macros and use block based solution #901
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
Remove EXTERN_C macros and use block based solution #901
Conversation
95a2a51
to
a322d15
Compare
jerry_api_create_object_value (jerry_api_object_t *value); | ||
|
||
/** | ||
* Creates a JERRY_API_DATA_TYPE_STRING type jerry_api_value_t from the | ||
* given jerry_api_string_t *parameter and returns with it. | ||
*/ | ||
extern EXTERN_C jerry_api_value_t | ||
jerry_api_create_string_value (jerry_api_string_t *value); | ||
jerry_api_value_t jerry_api_create_string_value (jerry_api_string_t *value); |
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.
Why did the style change here? Above this point, return type was in a separate line, from this on, it's on the same line as the rest of the function declaration. It would be good to follow one style everywhere.
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.
I agree with that we should use one style, but which one?
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.
Well, the public headers mostly use the same-line style, while internal headers mix it, sometimes even inside the same header. However, C sources use the return-type-on-separate-line style everywhere. So, I'm not sure... Happy to hear the opinion of others.
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.
It is easier to read when the return type is in the same line, so I prefer that.
a322d15
to
908dc95
Compare
|
||
extern EXTERN_C int gettimeofday (void *tp, void *tzp); | ||
int gettimeofday (void *tp, void *tzp); |
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.
Why is everything indented here? All the other headers are non-indented.
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.
accident, I'll fix
e076a9e
to
97c87e8
Compare
I've updated the PR |
@@ -101,7 +101,8 @@ foreach file_name [getSourceFileNames] { | |||
set expect_newline false | |||
} | |||
} elseif {$tok_type in {leftbrace rightbrace}} { | |||
if {[lindex $prev_tok 1] == $line_num} { | |||
if {[lindex $prev_tok 1] == $line_num | |||
&& ![regexp {^extern "C"} [getLine $file_name $line_num]]} { |
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.
Is this still needed?
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.
No
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.
fixed
If tools/vera++/scripts/rules/jerry_braces_on_separate_line.tcl is fixed, LGTM (FWIW) |
97c87e8
to
3f744dd
Compare
@zherczeg, please check |
LGTM |
Related issue: jerryscript-project#900 JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
3f744dd
to
a0bedaa
Compare
Related issue: #900
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com