Skip to content

Commit 9046167

Browse files
authored
Updates to rcutils to make rosdoc2 generation happier. (#416)
* Updates to rcutils to make rosdoc2 generation happier. In particular: * Fix a mostly duplicated and slightly wrong formatted docblock at the top of sha256.c * Add in a few field names so doxygen can resolve them. * Make a doxygen-only function signature of sha256_final, since rosdoc2 doesn't understand uint8_t[] * Modify the configuration to include all needed files. With this in place, all but one warning are removed when generating the documentation. Signed-off-by: Chris Lalancette <[email protected]>
1 parent 69b094e commit 9046167

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

Doxyfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ PROJECT_NUMBER = master
55
PROJECT_BRIEF = "C API providing common utilities and data structures."
66

77
# Use these lines to include the generated logging_macro.h (update install path if needed)
8-
#INPUT = README.md ../../../install_isolated/rcutils/include
9-
#STRIP_FROM_PATH = /Users/william/ros2_ws/install_isolated/rcutils/include
108
# Otherwise just generate for the local (non-generated header files)
11-
INPUT = README.md ./include
9+
INPUT = CONTRIBUTING.md README.md QUALITY_DECLARATION.md ./include
1210
EXCLUDE_PATTERNS = */stdatomic_helper/*
1311
USE_MDFILE_AS_MAINPAGE = README.md
1412
RECURSIVE = YES
@@ -26,6 +24,7 @@ PREDEFINED += RCUTILS_PUBLIC=
2624
PREDEFINED += RCUTILS_PUBLIC_TYPE=
2725
PREDEFINED += RCUTILS_WARN_UNUSED=
2826
PREDEFINED += RCUTILS_ENABLE_FAULT_INJECTION=
27+
PREDEFINED += DOXYGEN_ONLY
2928

3029
# Tag files that do not exist will produce a warning and cross-project linking will not work.
3130
TAGFILES += "../../../doxygen_tag_files/cppreference-doxygen-web.tag.xml=http://en.cppreference.com/w/"

include/rcutils/logging.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ rcutils_logging_severity_level_from_string(
215215
* \param[in] args The variable argument list
216216
*/
217217
typedef void (* rcutils_logging_output_handler_t)(
218-
const rcutils_log_location_t *, // location
219-
int, // severity
220-
const char *, // name
221-
rcutils_time_point_value_t, // timestamp
222-
const char *, // format
223-
va_list * // args
218+
const rcutils_log_location_t * location,
219+
int severity,
220+
const char * name,
221+
rcutils_time_point_value_t timestamp,
222+
const char * format,
223+
va_list * args
224224
);
225225

226226
/// Get the current output handler.

include/rcutils/sha256.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
/// \file Provides a simple SHA256 algorithm for hashing.
16-
/// This implementation makes no security guarantees, its use case
17-
/// is for non-sensitive comparison of message digests
18-
/// Implementation originally copied from Brad Conte
19-
/// https://github.com/B-Con/crypto-algorithms/blob/master/sha256.c
20-
2115
/** \file sha256.h
2216
* \brief SHA256 implementation
2317
*
@@ -28,6 +22,8 @@
2822
* Algorithm specification can be found here:
2923
* http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf
3024
* This implementation uses little endian byte order.
25+
* This implementation makes no security guarantees, its use case if for
26+
* non-sensitive comparison of message digests.
3127
*/
3228

3329
#ifndef RCUTILS__SHA256_H_
@@ -83,10 +79,19 @@ void rcutils_sha256_update(rcutils_sha256_ctx_t * ctx, const uint8_t * data, siz
8379
* \param[out] output_hash Calculated sha256 message digest to be filled
8480
* \return void
8581
*/
82+
#ifdef DOXYGEN_ONLY
83+
// One of the tools used by rosdoc2 misunderstands uint8_t[] as a uint8_t,
84+
// so make it a pointer for documentation purposes.
85+
RCUTILS_PUBLIC
86+
void rcutils_sha256_final(
87+
rcutils_sha256_ctx_t * ctx,
88+
uint8_t * output_hash);
89+
#else
8690
RCUTILS_PUBLIC
8791
void rcutils_sha256_final(
8892
rcutils_sha256_ctx_t * ctx,
8993
uint8_t output_hash[RCUTILS_SHA256_BLOCK_SIZE]);
94+
#endif
9095

9196
#ifdef __cplusplus
9297
}

include/rcutils/types/hash_map.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typedef struct RCUTILS_PUBLIC_TYPE rcutils_hash_map_s
4444
* \return A hash value for the provided string
4545
*/
4646
typedef size_t (* rcutils_hash_map_key_hasher_t)(
47-
const void * // key to hash
47+
const void * key
4848
);
4949

5050
/// The function signature for a key comparison function.
@@ -56,8 +56,8 @@ typedef size_t (* rcutils_hash_map_key_hasher_t)(
5656
* \return Zero if val1 == val2.
5757
*/
5858
typedef int (* rcutils_hash_map_key_cmp_t)(
59-
const void *, // val1
60-
const void * // val2
59+
const void * val1,
60+
const void * val2
6161
);
6262

6363
/**

0 commit comments

Comments
 (0)