Skip to content

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

Merged

Conversation

LaszloLango
Copy link
Contributor

Related issue: #900

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com

@LaszloLango LaszloLango added minor api Related to the public API style Related to coding style labels Feb 19, 2016
@LaszloLango LaszloLango force-pushed the refactor-extern-c-define branch from 95a2a51 to a322d15 Compare February 19, 2016 07:43
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);
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Member

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.

@LaszloLango LaszloLango force-pushed the refactor-extern-c-define branch from a322d15 to 908dc95 Compare February 19, 2016 08:30

extern EXTERN_C int gettimeofday (void *tp, void *tzp);
int gettimeofday (void *tp, void *tzp);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

accident, I'll fix

@LaszloLango LaszloLango force-pushed the refactor-extern-c-define branch 3 times, most recently from e076a9e to 97c87e8 Compare February 19, 2016 14:16
@LaszloLango
Copy link
Contributor Author

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]]} {
Copy link
Member

Choose a reason for hiding this comment

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

Is this still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@akosthekiss
Copy link
Member

If tools/vera++/scripts/rules/jerry_braces_on_separate_line.tcl is fixed, LGTM (FWIW)

@LaszloLango LaszloLango force-pushed the refactor-extern-c-define branch from 97c87e8 to 3f744dd Compare February 19, 2016 14:30
@LaszloLango
Copy link
Contributor Author

@zherczeg, please check

@zherczeg
Copy link
Member

LGTM

Related issue: jerryscript-project#900

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the public API minor style Related to coding style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants