mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-09-25 11:37:29 +00:00
Fixed 'unused variable `cmock_line' compiler warning.
Warning was produced by generated code for functions without args.
This commit is contained in:
@@ -136,7 +136,7 @@ class CMockGenerator
|
||||
def create_mock_verify_function(file, functions)
|
||||
file << "void #{@clean_mock_name}_Verify(void)\n{\n"
|
||||
verifications = functions.collect {|function| @plugins.run(:mock_verify, function)}.join
|
||||
file << " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n" unless verifications.empty?
|
||||
file << " UNITY_LINE_TYPE cmock_line;\n cmock_line = TEST_LINE_NUM;\n" unless verifications.empty?
|
||||
file << verifications
|
||||
file << "}\n\n"
|
||||
end
|
||||
@@ -170,7 +170,7 @@ class CMockGenerator
|
||||
# Create mock function
|
||||
file << "#{function_mod_and_rettype} #{function[:name]}(#{args_string})\n"
|
||||
file << "{\n"
|
||||
file << " UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;\n"
|
||||
file << " UNITY_LINE_TYPE cmock_line;\n cmock_line = TEST_LINE_NUM;\n"
|
||||
file << " CMOCK_#{function[:name]}_CALL_INSTANCE* cmock_call_instance = (CMOCK_#{function[:name]}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.#{function[:name]}_CallInstance);\n"
|
||||
file << " Mock.#{function[:name]}_CallInstance = CMock_Guts_MemNext(Mock.#{function[:name]}_CallInstance);\n"
|
||||
file << @plugins.run(:mock_implementation_precheck, function)
|
||||
|
||||
Reference in New Issue
Block a user