mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-13 22:57:52 +00:00
Merge pull request #30 from jlesage/compiler_warning_fix
Better way to fix a 'return from incompatible pointer type' compiler warning (Thanks again, Jocelyn! This seems to work on the compiler that was having problems before. I'll merge it and see how it does across the system)
This commit is contained in:
@@ -183,8 +183,9 @@ class CMockGenerator
|
||||
file << " UNITY_TEST_FAIL(cmock_line, \"Function '#{function[:name]}' called later than expected.\");\n"
|
||||
# file << " UNITY_TEST_ASSERT((cmock_call_instance->CallOrder == ++GlobalVerifyOrder), cmock_line, \"Out of order function calls. Function '#{function[:name]}'\");\n"
|
||||
end
|
||||
return_type_cast = function[:return][:const?] ? "(const #{function[:return][:type]})" : ''
|
||||
file << @plugins.run(:mock_implementation, function)
|
||||
file << " return cmock_call_instance->ReturnVal;\n" unless (function[:return][:void?])
|
||||
file << " return #{return_type_cast}cmock_call_instance->ReturnVal;\n" unless (function[:return][:void?])
|
||||
file << "}\n\n"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user