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

Map ROS char into C signed char #211

Merged
merged 6 commits into from
Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// array types for all primitive types
ROSIDL_GENERATOR_C__PRIMITIVE_ARRAY(bool, bool)
ROSIDL_GENERATOR_C__PRIMITIVE_ARRAY(byte, uint8_t)
ROSIDL_GENERATOR_C__PRIMITIVE_ARRAY(char, char)
ROSIDL_GENERATOR_C__PRIMITIVE_ARRAY(char, signed char)
ROSIDL_GENERATOR_C__PRIMITIVE_ARRAY(float32, float)
ROSIDL_GENERATOR_C__PRIMITIVE_ARRAY(float64, double)
ROSIDL_GENERATOR_C__PRIMITIVE_ARRAY(int8, int8_t)
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/rosidl_generator_c/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def generate_c(generator_arguments_file):
MSG_TYPE_TO_C = {
'bool': 'bool',
'byte': 'uint8_t',
'char': 'char',
'char': 'signed char',
'float32': 'float',
'float64': 'double',
'uint8': 'uint8_t',
Expand Down
2 changes: 1 addition & 1 deletion rosidl_generator_c/src/primitives_array_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
// array functions for all primitive types
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_ARRAY_FUNCTIONS(bool, bool)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_ARRAY_FUNCTIONS(byte, uint8_t)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_ARRAY_FUNCTIONS(char, char)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_ARRAY_FUNCTIONS(char, signed char)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_ARRAY_FUNCTIONS(float32, float)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_ARRAY_FUNCTIONS(float64, double)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_ARRAY_FUNCTIONS(int8, int8_t)
Expand Down
8 changes: 4 additions & 4 deletions rosidl_generator_c/test/test_interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ int test_primitives(void)
EXPECT_EQ(127, rosidl_generator_c__msg__Constants__TOTO);
EXPECT_EQ(48, rosidl_generator_c__msg__Constants__TATA);

char_msg.empty_char = CHAR_MIN;
EXPECT_EQ(CHAR_MIN, char_msg.empty_char);
char_msg.empty_char = SCHAR_MIN;
EXPECT_EQ(SCHAR_MIN, char_msg.empty_char);

char_msg.empty_char = CHAR_MAX;
EXPECT_EQ(CHAR_MAX, char_msg.empty_char);
char_msg.empty_char = SCHAR_MAX;
EXPECT_EQ(SCHAR_MAX, char_msg.empty_char);

float32_msg.empty_float32 = FLT_MIN;
EXPECT_EQ(FLT_MIN, float32_msg.empty_float32);
Expand Down