Skip to content

Commit

Permalink
Merge pull request #100 from ros2/misra_fixup
Browse files Browse the repository at this point in the history
MISRA Fixup: #if -> #ifdef
  • Loading branch information
mjcarroll authored May 1, 2018
2 parents ba3f589 + 79a9296 commit 9092a25
Show file tree
Hide file tree
Showing 37 changed files with 74 additions and 74 deletions.
4 changes: 2 additions & 2 deletions include/rcutils/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__ALLOCATOR_H_
#define RCUTILS__ALLOCATOR_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -135,7 +135,7 @@ RCUTILS_WARN_UNUSED
void *
rcutils_reallocf(void * pointer, size_t size, rcutils_allocator_t * allocator);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/cmdline_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__CMDLINE_PARSER_H_
#define RCUTILS__CMDLINE_PARSER_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand All @@ -32,7 +32,7 @@ RCUTILS_PUBLIC
char *
rcutils_cli_get_option(char ** begin, char ** end, const char * option);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/concat.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__CONCAT_H_
#define RCUTILS__CONCAT_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand All @@ -35,7 +35,7 @@ RCUTILS_PUBLIC
char *
rcutils_concat(const char * lhs, const char * rhs, const char * delimiter);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/error_handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef RCUTILS__ERROR_HANDLING_H_
#define RCUTILS__ERROR_HANDLING_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -213,7 +213,7 @@ RCUTILS_PUBLIC
void
rcutils_reset_error(void);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__FILESYSTEM_H_
#define RCUTILS__FILESYSTEM_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -120,7 +120,7 @@ RCUTILS_PUBLIC
char *
rcutils_join_path(const char * left_hand_path, const char * right_hand_path);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/find.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__FIND_H_
#define RCUTILS__FIND_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -79,7 +79,7 @@ RCUTILS_PUBLIC
size_t
rcutils_find_lastn(const char * str, char delimiter, size_t string_length);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/format_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__FORMAT_STRING_H_
#define RCUTILS__FORMAT_STRING_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -71,7 +71,7 @@ rcutils_format_string_limit(
const char * format_string,
...);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/get_env.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__GET_ENV_H_
#define RCUTILS__GET_ENV_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -61,7 +61,7 @@ RCUTILS_WARN_UNUSED
const char *
rcutils_get_env(const char * env_name, const char ** env_value);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/isalnum_no_locale.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__ISALNUM_NO_LOCALE_H_
#define RCUTILS__ISALNUM_NO_LOCALE_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand All @@ -40,7 +40,7 @@ rcutils_isalnum_no_locale(char c)
return false;
}

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "rcutils/types/rcutils_ret.h"
#include "rcutils/visibility_control.h"

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -472,7 +472,7 @@ void rcutils_logging_console_output_handler(
} \
}

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__MACROS_H_
#define RCUTILS__MACROS_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -63,7 +63,7 @@ extern "C"
#define RCUTILS_STRINGIFY_IMPL(x) #x
#define RCUTILS_STRINGIFY(x) RCUTILS_STRINGIFY_IMPL(x)

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/repl_str.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#ifndef RCUTILS__REPL_STR_H_
#define RCUTILS__REPL_STR_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -133,7 +133,7 @@ rcutils_repl_str(

// Implementation copied from above mentioned source continues in repl_str.c.

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/snprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__SNPRINTF_H_
#define RCUTILS__SNPRINTF_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -45,7 +45,7 @@ extern "C"
_vsnprintf_s(buffer, buffer_size, _TRUNCATE, format, __VA_ARGS__)
#endif

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/split.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__SPLIT_H_
#define RCUTILS__SPLIT_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -59,7 +59,7 @@ rcutils_split_last(
rcutils_allocator_t allocator,
rcutils_string_array_t * string_array);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/strdup.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__STRDUP_H_
#define RCUTILS__STRDUP_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -67,7 +67,7 @@ RCUTILS_WARN_UNUSED
char *
rcutils_strndup(const char * str, size_t string_length, rcutils_allocator_t allocator);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__TIME_H_
#define RCUTILS__TIME_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -100,7 +100,7 @@ RCUTILS_WARN_UNUSED
rcutils_ret_t
rcutils_steady_time_now(rcutils_time_point_value_t * now);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__TYPES_H_
#define RCUTILS__TYPES_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand All @@ -24,7 +24,7 @@ extern "C"
#include "rcutils/types/string_map.h"
#include "rcutils/types/rcutils_ret.h"

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/types/rcutils_ret.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__TYPES__RCUTILS_RET_H_
#define RCUTILS__TYPES__RCUTILS_RET_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand All @@ -42,7 +42,7 @@ typedef int rcutils_ret_t;
/// Internal severity map for logger thresholds is invalid.
#define RCUTILS_RET_LOGGING_SEVERITY_MAP_INVALID 40

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/types/string_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__TYPES__STRING_ARRAY_H_
#define RCUTILS__TYPES__STRING_ARRAY_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -110,7 +110,7 @@ RCUTILS_WARN_UNUSED
rcutils_ret_t
rcutils_string_array_fini(rcutils_string_array_t * string_array);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/types/string_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__TYPES__STRING_MAP_H_
#define RCUTILS__TYPES__STRING_MAP_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -432,7 +432,7 @@ rcutils_string_map_copy(
const rcutils_string_map_t * src_string_map,
rcutils_string_map_t * dst_string_map);

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/rcutils/visibility_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef RCUTILS__VISIBILITY_CONTROL_H_
#define RCUTILS__VISIBILITY_CONTROL_H_

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -51,7 +51,7 @@ extern "C"
#define RCUTILS_PUBLIC_TYPE
#endif

#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions resource/logging_macros.h.em
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>

#if __cplusplus
#ifdef __cplusplus
extern "C"
{
#endif
Expand Down Expand Up @@ -248,7 +248,7 @@ from rcutils.logging import severities
///@@}

@[end for]@
#if __cplusplus
#ifdef __cplusplus
}
#endif

Expand Down
Loading

0 comments on commit 9092a25

Please sign in to comment.