[Scummvm-git-logs] scummvm master -> 04242ce829bd55f03e084b85a23055b23e598fb6
digitall
dgturner at iee.org
Sun Sep 15 17:24:30 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
04242ce829 LUA: Fix Coverity Warnings in File Class
Commit: 04242ce829bd55f03e084b85a23055b23e598fb6
https://github.com/scummvm/scummvm/commit/04242ce829bd55f03e084b85a23055b23e598fb6
Author: D G Turner (digitall at scummvm.org)
Date: 2019-09-15T16:21:02+01:00
Commit Message:
LUA: Fix Coverity Warnings in File Class
Changed paths:
common/lua/scummvm_file.cpp
diff --git a/common/lua/scummvm_file.cpp b/common/lua/scummvm_file.cpp
index 1a5af0f..a65a238 100644
--- a/common/lua/scummvm_file.cpp
+++ b/common/lua/scummvm_file.cpp
@@ -26,7 +26,7 @@
namespace Lua {
-LuaFileProxy::LuaFileProxy(const Common::String &filename, const Common::String &mode) {
+LuaFileProxy::LuaFileProxy(const Common::String &filename, const Common::String &mode) : _readPos(0) {
assert(filename.contains("config.lua"));
if (mode == "r")
setupConfigFile();
@@ -44,11 +44,7 @@ Common::String LuaFileProxy::formatDouble(double value) {
double integerPart = floor(value);
double fractionalPart = (value - integerPart) * 1000000.0;
- Common::String out = Common::String::format("%.0f.%.0f", integerPart, fractionalPart);
- if (negative)
- out = "-" + out;
-
- return out;
+ return Common::String::format("%s%.0f.%.0f", negative ? "-" : "", integerPart, fractionalPart);
}
void LuaFileProxy::setupConfigFile() {
More information about the Scummvm-git-logs
mailing list