Skip to content

Commit

Permalink
Satisfy uncrustify and address pr comments
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Ezequiel Marchi <brian.marchi65@gmail.com>
  • Loading branch information
BMarchi committed Oct 17, 2019
1 parent bd7bc42 commit 4002d0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions rcl/include/rcl/localhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RCL__LOCALHOST_H
#define RCL__LOCALHOST_H
#ifndef RCL__LOCALHOST_H_
#define RCL__LOCALHOST_H_

#ifdef __cplusplus
extern "C"
Expand All @@ -23,7 +23,7 @@ extern "C"
#include "rcl/types.h"
#include "rcl/visibility_control.h"

extern const char * RCL_LOCALHOST_ENV_VAR;
extern const char * const RCL_LOCALHOST_ENV_VAR;

/// Determine if the user wants to communicate using loopback only.
/**
Expand All @@ -39,4 +39,4 @@ rcl_localhost_only();
}
#endif

#endif // RCL__LOCALHOST_H
#endif // RCL__LOCALHOST_H_
8 changes: 4 additions & 4 deletions rcl/src/rcl/localhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

#include <rcl/localhost.h>

#include "rcutils/get_env.h"

#include <stdlib.h>
#include <string.h>

const char * RCL_LOCALHOST_ENV_VAR = "ROS_LOCALHOST_ONLY";
#include "rcutils/get_env.h"

const char * const RCL_LOCALHOST_ENV_VAR = "ROS_LOCALHOST_ONLY";

bool
rcl_localhost_only()
{
const char * ros_local_host_env_val = NULL;
return rcutils_get_env(RCL_LOCALHOST_ENV_VAR, &ros_local_host_env_val) == NULL &&
ros_local_host_env_val != NULL && strcmp(ros_local_host_env_val, "1") == 0;
ros_local_host_env_val != NULL && strcmp(ros_local_host_env_val, "1") == 0;
}

0 comments on commit 4002d0f

Please sign in to comment.