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

[ControllerInterface] Avoid warning about conversion from int64_t to unsigned int #1173

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

destogl
Copy link
Member

@destogl destogl commented Nov 21, 2023

Without this there is a warning. For what I found the best way is to do static cast.

ros2_control/controller_interface/src/controller_interface_base.cpp:88:67: warning: conversion from ‘int64_t’{aka ‘long int’} to ‘unsigned int’ may change value [-Wconversion]
88 |     update_rate_ = get_node()->get_parameter("update_rate").as_int();

#GitHub-Programming-Rocks

…o `unsigned int`

Without this there is a warning. For what I found the best way is to do static cast.

```
ros2_control/controller_interface/src/controller_interface_base.cpp:88:67: warning: conversion from ‘int64_t’{aka ‘long int’} to ‘unsigned int’ may change value [-Wconversion]
88 |     update_rate_ = get_node()->get_parameter("update_rate").as_int();
```
Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

A few more to go to be contributor of the month

@destogl destogl merged commit 2569b76 into master Nov 21, 2023
13 checks passed
@destogl destogl deleted the controller-interface-static-cast-param branch November 21, 2023 17:40
@christophfroehlich christophfroehlich added the backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. label Jul 20, 2024
mergify bot pushed a commit that referenced this pull request Jul 20, 2024
…o `unsigned int` (#1173)

Without this there is a warning. For what I found the best way is to do static cast.

```
ros2_control/controller_interface/src/controller_interface_base.cpp:88:67: warning: conversion from ‘int64_t’{aka ‘long int’} to ‘unsigned int’ may change value [-Wconversion]
88 |     update_rate_ = get_node()->get_parameter("update_rate").as_int();
```

(cherry picked from commit 2569b76)
@christophfroehlich christophfroehlich added the backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. label Jul 20, 2024
mergify bot pushed a commit that referenced this pull request Jul 20, 2024
…o `unsigned int` (#1173)

Without this there is a warning. For what I found the best way is to do static cast.

```
ros2_control/controller_interface/src/controller_interface_base.cpp:88:67: warning: conversion from ‘int64_t’{aka ‘long int’} to ‘unsigned int’ may change value [-Wconversion]
88 |     update_rate_ = get_node()->get_parameter("update_rate").as_int();
```

(cherry picked from commit 2569b76)

# Conflicts:
#	controller_interface/src/controller_interface_base.cpp
christophfroehlich pushed a commit that referenced this pull request Jul 20, 2024
…o `unsigned int` (#1173)

Without this there is a warning. For what I found the best way is to do static cast.

```
ros2_control/controller_interface/src/controller_interface_base.cpp:88:67: warning: conversion from ‘int64_t’{aka ‘long int’} to ‘unsigned int’ may change value [-Wconversion]
88 |     update_rate_ = get_node()->get_parameter("update_rate").as_int();
```

(cherry picked from commit 2569b76)
bmagyar pushed a commit that referenced this pull request Jul 21, 2024
bmagyar pushed a commit that referenced this pull request Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants