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

Drop support for long double/float128. #843

Draft
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Draft
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
1 change: 0 additions & 1 deletion rosidl_generator_c/rosidl_generator_c/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def prefix_with_bom_if_necessary(content: str) -> str:
BASIC_IDL_TYPES_TO_C = {
'float': 'float',
'double': 'double',
'long double': 'long double',
'char': 'signed char',
'wchar': 'uint16_t',
'boolean': 'bool',
Expand Down
3 changes: 1 addition & 2 deletions rosidl_generator_cpp/rosidl_generator_cpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def prefix_with_bom_if_necessary(content: str) -> str:
'wchar': 'char16_t',
'float': 'float',
'double': 'double',
'long double': 'long double',
'uint8': 'uint8_t',
'int8': 'int8_t',
'uint16': 'uint16_t',
Expand Down Expand Up @@ -199,7 +198,7 @@ def primitive_value_to_cpp(type_, value):
if type_.typename in [
'short', 'unsigned short',
'char', 'wchar',
'double', 'long double',
'double',
'octet',
'int8', 'uint8',
'int16', 'uint16',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,15 @@ unbounded_sequence_of_wstrings: []
/*{
test_msgs::idl::IdlOnlyTypes msg;
msg.wchar_value = u'ö';
msg.long_double_value = 1.125;
EXPECT_STREQ(
R"(wchar_value: "\u00f6"
long_double_value: 1.12500
)",
to_yaml(
msg).c_str());

msg.wchar_value = u'貓';
EXPECT_STREQ(
R"(wchar_value: "\u8c93"
long_double_value: 1.12500
)",
to_yaml(
msg).c_str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ def parse_rihs_string(rihs_str: str) -> Tuple[int, str]:
'uint64': 'FIELD_TYPE_UINT64',
'float': 'FIELD_TYPE_FLOAT',
'double': 'FIELD_TYPE_DOUBLE',
'long': 'LONG_DOUBLE',
'char': 'FIELD_TYPE_CHAR',
'wchar': 'FIELD_TYPE_WCHAR',
'boolean': 'FIELD_TYPE_BOOLEAN',
Expand Down Expand Up @@ -272,7 +271,6 @@ def parse_rihs_string(rihs_str: str) -> Tuple[int, str]:
# Floating-Point Types
'FIELD_TYPE_FLOAT': 10,
'FIELD_TYPE_DOUBLE': 11,
'FIELD_TYPE_LONG_DOUBLE': 12,

# Char and WChar Types
'FIELD_TYPE_CHAR': 13,
Expand Down Expand Up @@ -308,7 +306,6 @@ def parse_rihs_string(rihs_str: str) -> Tuple[int, str]:
'FIELD_TYPE_UINT64_ARRAY': 57,
'FIELD_TYPE_FLOAT_ARRAY': 58,
'FIELD_TYPE_DOUBLE_ARRAY': 59,
'FIELD_TYPE_LONG_DOUBLE_ARRAY': 60,
'FIELD_TYPE_CHAR_ARRAY': 61,
'FIELD_TYPE_WCHAR_ARRAY': 62,
'FIELD_TYPE_BOOLEAN_ARRAY': 63,
Expand All @@ -332,7 +329,6 @@ def parse_rihs_string(rihs_str: str) -> Tuple[int, str]:
'FIELD_TYPE_UINT64_BOUNDED_SEQUENCE': 105,
'FIELD_TYPE_FLOAT_BOUNDED_SEQUENCE': 106,
'FIELD_TYPE_DOUBLE_BOUNDED_SEQUENCE': 107,
'FIELD_TYPE_LONG_DOUBLE_BOUNDED_SEQUENCE': 108,
'FIELD_TYPE_CHAR_BOUNDED_SEQUENCE': 109,
'FIELD_TYPE_WCHAR_BOUNDED_SEQUENCE': 110,
'FIELD_TYPE_BOOLEAN_BOUNDED_SEQUENCE': 111,
Expand All @@ -356,7 +352,6 @@ def parse_rihs_string(rihs_str: str) -> Tuple[int, str]:
'FIELD_TYPE_UINT64_UNBOUNDED_SEQUENCE': 153,
'FIELD_TYPE_FLOAT_UNBOUNDED_SEQUENCE': 154,
'FIELD_TYPE_DOUBLE_UNBOUNDED_SEQUENCE': 155,
'FIELD_TYPE_LONG_DOUBLE_UNBOUNDED_SEQUENCE': 156,
'FIELD_TYPE_CHAR_UNBOUNDED_SEQUENCE': 157,
'FIELD_TYPE_WCHAR_UNBOUNDED_SEQUENCE': 158,
'FIELD_TYPE_BOOLEAN_UNBOUNDED_SEQUENCE': 159,
Expand Down
3 changes: 1 addition & 2 deletions rosidl_parser/rosidl_parser/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
FLOATING_POINT_TYPES: Final = ( # rule (24)
'float',
'double',
'long double',
)
CHARACTER_TYPES: Final = (
'char', # rule (34)
Expand Down Expand Up @@ -104,7 +103,7 @@
NonexplicitIntegerTypeValues = Union[SignedNonexplicitIntegerTypeValues,
UnsignedNonexplicitIntegerTypeValues]

FloatingPointTypeValues = Literal['float', 'double', 'long double']
FloatingPointTypeValues = Literal['float', 'double']
CharacterTypeValues = Literal['char', 'wchar']
BooleanValue = Literal['boolean']
OctetValue = Literal['octet']
Expand Down
2 changes: 0 additions & 2 deletions rosidl_parser/rosidl_parser/grammar.lark
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,9 @@ base_type_spec.2: integer_type
// (24)
floating_pt_type.2: floating_pt_type_float
| floating_pt_type_double
| floating_pt_type_long_double
// separate rules to identify the floating point type
floating_pt_type_float: "float"
floating_pt_type_double: "double"
floating_pt_type_long_double: "long" "double"

// (25)
integer_type.2: signed_int
Expand Down
1 change: 0 additions & 1 deletion rosidl_parser/rosidl_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ def add_message_members(msg: Message, tree: 'ParseTree') -> None:
BASE_TYPE_SPEC_TO_IDL_TYPE: Dict[str, 'BasicTypeValues'] = {
'floating_pt_type_float': 'float',
'floating_pt_type_double': 'double',
'floating_pt_type_long_double': 'long double',
'char_type': 'char',
'wide_char_type': 'wchar',
'boolean_type': 'boolean',
Expand Down
1 change: 0 additions & 1 deletion rosidl_parser/test/msg/MyMessage.idl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module rosidl_parser {
unsigned long long unsigned_long_long_value;
float float_value;
double double_value;
long double long_double_value;
char char_value;
wchar wchar_value;
boolean boolean_value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// sequence types for all basic types
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(float, float)
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(double, double)
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(long_double, long double)
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(char, signed char)
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(wchar, uint16_t)
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(boolean, bool)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ extern "C"
/**@{*/
ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS(float)
ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS(double)
ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS(long_double)
ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS(char)
ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS(wchar)
ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS(boolean)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/Field.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/field.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__FIELD__FUNCTIONS_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__FIELD__FUNCTIONS_H_

Expand Down Expand Up @@ -57,7 +60,7 @@ rosidl_runtime_c__type_description__Field__fini(rosidl_runtime_c__type_descripti
*/
ROSIDL_GENERATOR_C_PUBLIC
rosidl_runtime_c__type_description__Field *
rosidl_runtime_c__type_description__Field__create();
rosidl_runtime_c__type_description__Field__create(void);

/// Destroy msg/Field message.
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/Field.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/field.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__FIELD__STRUCT_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__FIELD__STRUCT_H_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/FieldType.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/field_type.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__FIELD_TYPE__FUNCTIONS_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__FIELD_TYPE__FUNCTIONS_H_

Expand Down Expand Up @@ -57,7 +60,7 @@ rosidl_runtime_c__type_description__FieldType__fini(rosidl_runtime_c__type_descr
*/
ROSIDL_GENERATOR_C_PUBLIC
rosidl_runtime_c__type_description__FieldType *
rosidl_runtime_c__type_description__FieldType__create();
rosidl_runtime_c__type_description__FieldType__create(void);

/// Destroy msg/FieldType message.
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/FieldType.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/field_type.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__FIELD_TYPE__STRUCT_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__FIELD_TYPE__STRUCT_H_

Expand Down Expand Up @@ -114,12 +117,6 @@ enum
rosidl_runtime_c__type_description__FieldType__FIELD_TYPE_DOUBLE = 11
};

/// Constant 'FIELD_TYPE_LONG_DOUBLE'.
enum
{
rosidl_runtime_c__type_description__FieldType__FIELD_TYPE_LONG_DOUBLE = 12
};

/// Constant 'FIELD_TYPE_CHAR'.
/**
* Char and WChar Types
Expand Down Expand Up @@ -267,12 +264,6 @@ enum
rosidl_runtime_c__type_description__FieldType__FIELD_TYPE_DOUBLE_ARRAY = 59
};

/// Constant 'FIELD_TYPE_LONG_DOUBLE_ARRAY'.
enum
{
rosidl_runtime_c__type_description__FieldType__FIELD_TYPE_LONG_DOUBLE_ARRAY = 60
};

/// Constant 'FIELD_TYPE_CHAR_ARRAY'.
enum
{
Expand Down Expand Up @@ -402,12 +393,6 @@ enum
rosidl_runtime_c__type_description__FieldType__FIELD_TYPE_DOUBLE_BOUNDED_SEQUENCE = 107
};

/// Constant 'FIELD_TYPE_LONG_DOUBLE_BOUNDED_SEQUENCE'.
enum
{
rosidl_runtime_c__type_description__FieldType__FIELD_TYPE_LONG_DOUBLE_BOUNDED_SEQUENCE = 108
};

/// Constant 'FIELD_TYPE_CHAR_BOUNDED_SEQUENCE'.
enum
{
Expand Down Expand Up @@ -537,12 +522,6 @@ enum
rosidl_runtime_c__type_description__FieldType__FIELD_TYPE_DOUBLE_UNBOUNDED_SEQUENCE = 155
};

/// Constant 'FIELD_TYPE_LONG_DOUBLE_UNBOUNDED_SEQUENCE'.
enum
{
rosidl_runtime_c__type_description__FieldType__FIELD_TYPE_LONG_DOUBLE_UNBOUNDED_SEQUENCE = 156
};

/// Constant 'FIELD_TYPE_CHAR_UNBOUNDED_SEQUENCE'.
enum
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/IndividualTypeDescription.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/individual_type_description.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__INDIVIDUAL_TYPE_DESCRIPTION__FUNCTIONS_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__INDIVIDUAL_TYPE_DESCRIPTION__FUNCTIONS_H_

Expand Down Expand Up @@ -57,7 +60,7 @@ rosidl_runtime_c__type_description__IndividualTypeDescription__fini(rosidl_runti
*/
ROSIDL_GENERATOR_C_PUBLIC
rosidl_runtime_c__type_description__IndividualTypeDescription *
rosidl_runtime_c__type_description__IndividualTypeDescription__create();
rosidl_runtime_c__type_description__IndividualTypeDescription__create(void);

/// Destroy msg/IndividualTypeDescription message.
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/IndividualTypeDescription.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/individual_type_description.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__INDIVIDUAL_TYPE_DESCRIPTION__STRUCT_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__INDIVIDUAL_TYPE_DESCRIPTION__STRUCT_H_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/KeyValue.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/key_value.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__KEY_VALUE__FUNCTIONS_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__KEY_VALUE__FUNCTIONS_H_

Expand Down Expand Up @@ -57,7 +60,7 @@ rosidl_runtime_c__type_description__KeyValue__fini(rosidl_runtime_c__type_descri
*/
ROSIDL_GENERATOR_C_PUBLIC
rosidl_runtime_c__type_description__KeyValue *
rosidl_runtime_c__type_description__KeyValue__create();
rosidl_runtime_c__type_description__KeyValue__create(void);

/// Destroy msg/KeyValue message.
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/KeyValue.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/key_value.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__KEY_VALUE__STRUCT_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__KEY_VALUE__STRUCT_H_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/TypeDescription.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/type_description.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__TYPE_DESCRIPTION__FUNCTIONS_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__TYPE_DESCRIPTION__FUNCTIONS_H_

Expand Down Expand Up @@ -57,7 +60,7 @@ rosidl_runtime_c__type_description__TypeDescription__fini(rosidl_runtime_c__type
*/
ROSIDL_GENERATOR_C_PUBLIC
rosidl_runtime_c__type_description__TypeDescription *
rosidl_runtime_c__type_description__TypeDescription__create();
rosidl_runtime_c__type_description__TypeDescription__create(void);

/// Destroy msg/TypeDescription message.
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/TypeDescription.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/type_description.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__TYPE_DESCRIPTION__STRUCT_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__TYPE_DESCRIPTION__STRUCT_H_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/TypeSource.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/type_source.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__TYPE_SOURCE__FUNCTIONS_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__TYPE_SOURCE__FUNCTIONS_H_

Expand Down Expand Up @@ -57,7 +60,7 @@ rosidl_runtime_c__type_description__TypeSource__fini(rosidl_runtime_c__type_desc
*/
ROSIDL_GENERATOR_C_PUBLIC
rosidl_runtime_c__type_description__TypeSource *
rosidl_runtime_c__type_description__TypeSource__create();
rosidl_runtime_c__type_description__TypeSource__create(void);

/// Destroy msg/TypeSource message.
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// with input from type_description_interfaces:msg/TypeSource.idl
// generated code does not contain a copyright notice

// IWYU pragma: private, include "type_description_interfaces/msg/type_source.h"


#ifndef ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__TYPE_SOURCE__STRUCT_H_
#define ROSIDL_RUNTIME_C__TYPE_DESCRIPTION__TYPE_SOURCE__STRUCT_H_

Expand Down
1 change: 0 additions & 1 deletion rosidl_runtime_c/src/primitives_sequence_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
// array functions for all basic types
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_SEQUENCE_FUNCTIONS(float, float)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_SEQUENCE_FUNCTIONS(double, double)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_SEQUENCE_FUNCTIONS(long_double, long double)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_SEQUENCE_FUNCTIONS(char, signed char)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_SEQUENCE_FUNCTIONS(wchar, uint16_t)
ROSIDL_GENERATOR_C__DEFINE_PRIMITIVE_SEQUENCE_FUNCTIONS(boolean, bool)
Expand Down
2 changes: 1 addition & 1 deletion rosidl_runtime_c/src/type_description/field__description.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ rosidl_runtime_c__type_description__Field__get_type_description_sources(
static bool constructed = false;
if (!constructed) {
sources[0] = *rosidl_runtime_c__type_description__Field__get_individual_type_description_source(NULL),
sources[0] = *rosidl_runtime_c__type_description__FieldType__get_individual_type_description_source(NULL);
sources[1] = *rosidl_runtime_c__type_description__FieldType__get_individual_type_description_source(NULL);
constructed = true;
}
return &source_sequence;
Expand Down
2 changes: 1 addition & 1 deletion rosidl_runtime_c/src/type_description/field__functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ rosidl_runtime_c__type_description__Field__copy(
}

rosidl_runtime_c__type_description__Field *
rosidl_runtime_c__type_description__Field__create()
rosidl_runtime_c__type_description__Field__create(void)
{
rcutils_allocator_t allocator = rcutils_get_default_allocator();
rosidl_runtime_c__type_description__Field * msg = (rosidl_runtime_c__type_description__Field *)allocator.allocate(sizeof(rosidl_runtime_c__type_description__Field), allocator.state);
Expand Down
Loading