File fix-compiler-warnings-errors.patch of Package rigsofrods
diff -Nur rigs-of-rods-0.4.7.0/source/main/gui/panels/GUI_DebugOptions.cpp new/source/main/gui/panels/GUI_DebugOptions.cpp
--- rigs-of-rods-0.4.7.0/source/main/gui/panels/GUI_DebugOptions.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/main/gui/panels/GUI_DebugOptions.cpp 2017-03-03 17:16:09.525836280 +0100
@@ -234,7 +234,7 @@
// now save the GameSettingsMap
for (it = DebugOptionsMap.begin(); it != DebugOptionsMap.end(); it++)
{
- if (it->first.c_str() == "User Token" || it->first.c_str() == "User Token Hash")
+ if (it->first == "User Token" || it->first == "User Token Hash")
return;
Settings::getSingleton().setSetting(it->first.c_str(), it->second.c_str()); //Avoid restarting the game in few cases.
@@ -256,4 +256,4 @@
{
SaveConfig();
Hide();
-}
\ No newline at end of file
+}
diff -Nur rigs-of-rods-0.4.7.0/source/main/gui/TruckHUD.cpp new/source/main/gui/TruckHUD.cpp
--- rigs-of-rods-0.4.7.0/source/main/gui/TruckHUD.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/main/gui/TruckHUD.cpp 2017-03-03 17:15:44.057644610 +0100
@@ -394,7 +394,7 @@
}
// hide command section title if no commands
- overlayElement = overlayElement = OverlayManager::getSingleton().getOverlayElement("tracks/TruckInfoBox/CommandsTitleLabel");
+ overlayElement = OverlayManager::getSingleton().getOverlayElement("tracks/TruckInfoBox/CommandsTitleLabel");
overlayElement->setCaption("");
if (filledCommands > 0)
{
diff -Nur rigs-of-rods-0.4.7.0/source/main/physics/BeamFactory.cpp new/source/main/physics/BeamFactory.cpp
--- rigs-of-rods-0.4.7.0/source/main/physics/BeamFactory.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/main/physics/BeamFactory.cpp 2017-03-03 17:18:19.498817244 +0100
@@ -58,6 +58,7 @@
#endif // USE_MYGUI
#include <algorithm>
+#include <cstring>
using namespace Ogre;
@@ -95,9 +96,9 @@
// Get CPU vendor
char vendor[12];
cpuID(0, regs);
- ((unsigned *)vendor)[0] = regs[1]; // EBX
- ((unsigned *)vendor)[1] = regs[3]; // EDX
- ((unsigned *)vendor)[2] = regs[2]; // ECX
+ memcpy((void *)vendor, (void *)®s[1], 4); // EBX
+ memcpy((void *)&vendor[4], (void *)®s[3], 4); // EDX
+ memcpy((void *)&vendor[8], (void *)®s[2], 4); // ECX
std::string cpuVendor = std::string(vendor, 12);
// Get CPU features
diff -Nur rigs-of-rods-0.4.7.0/source/main/physics/BeamForcesEuler.cpp new/source/main/physics/BeamForcesEuler.cpp
--- rigs-of-rods-0.4.7.0/source/main/physics/BeamForcesEuler.cpp 2016-11-20 17:08:00.000000000 +0100
+++ new/source/main/physics/BeamForcesEuler.cpp 2017-03-03 17:17:17.818351133 +0100
@@ -1622,9 +1622,9 @@
{
float ns = 0;
ground_model_t *gm = 0; // this is used as result storage, so we can use it later on
- bool contacted = false;
+ bool contacted = gEnv->collisions->groundCollision(&nodes[i], nodes[i].collTestTimer, &gm, &ns);
// reverted this construct to the old form, don't mess with it, the binary operator is intentionally!
- if ((contacted=gEnv->collisions->groundCollision(&nodes[i], nodes[i].collTestTimer, &gm, &ns)) | gEnv->collisions->nodeCollision(&nodes[i], contacted, nodes[i].collTestTimer, &ns, &gm))
+ if (contacted | gEnv->collisions->nodeCollision(&nodes[i], contacted, nodes[i].collTestTimer, &ns, &gm))
{
// FX
if (gm && doUpdate && !nodes[i].disable_particles)