From 75c3f3c7b3e936008bbf6dfe8602af4a0d32b603 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Wed, 9 Jul 2025 17:02:21 -0400 Subject: [PATCH] minor tweaks --- lib/cmock_header_parser.rb | 4 +++- src/cmock.h | 2 +- test/system/test_compilation/parsing.h | 9 +++++++++ vendor/c_exception | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index 070b658..1a4779c 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -578,7 +578,7 @@ class CMockHeaderParser # remove default argument statements from mock definitions args.gsub!(/=\s*[a-zA-Z0-9_.]+\s*/, ' ') - # check for var args + # check for var args and place in their own collection for handling separately if args =~ /\.\.\./ decl[:var_arg] = args.match(/[\w\s]*\.\.\./).to_s.strip args = if args =~ /,[\w\s]*\.\.\./ @@ -589,6 +589,8 @@ class CMockHeaderParser else decl[:var_arg] = nil end + + # parse out and clean up the remainder of the arguments args = clean_args(args, parse_project) decl[:args_string] = args decl[:args] = parse_args(args) diff --git a/src/cmock.h b/src/cmock.h index 0918cc0..4c860f2 100644 --- a/src/cmock.h +++ b/src/cmock.h @@ -18,7 +18,7 @@ #define CMOCK_VERSION_MAJOR 2 #define CMOCK_VERSION_MINOR 6 -#define CMOCK_VERSION_BUILD 0 +#define CMOCK_VERSION_BUILD 1 #define CMOCK_VERSION ((CMOCK_VERSION_MAJOR << 16) | (CMOCK_VERSION_MINOR << 8) | CMOCK_VERSION_BUILD) /* should be big enough to index full range of CMOCK_MEM_MAX */ diff --git a/test/system/test_compilation/parsing.h b/test/system/test_compilation/parsing.h index f19186e..78c023d 100644 --- a/test/system/test_compilation/parsing.h +++ b/test/system/test_compilation/parsing.h @@ -84,6 +84,15 @@ typedef struct int (*another_function_pointer_in_a_struct) (void); } another_thing_that_should_get_ignored; +typedef enum +{ + A_ENUM_VALUE = -18, /**< Comment */ + ANOTHER_ENUM_VALUE = -19 /**< Another comment. + This one goes on and on. */ +} SET_OF_ENUM_VALUES_T; + +void DoesStuffWithEnum(SET_OF_ENUM_VALUES_T enumVal); + inline int stuff(int num) { int reg = 0x12; diff --git a/vendor/c_exception b/vendor/c_exception index be54d74..37673b7 160000 --- a/vendor/c_exception +++ b/vendor/c_exception @@ -1 +1 @@ -Subproject commit be54d7440e0d9c78515070665892af4e15f8b14c +Subproject commit 37673b75954b33ebd593d180993c64d3bef45bc0