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:
Mark VanderVoord
2014-05-08 14:41:19 -04:00
+2 -1
View File
@@ -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