mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 07:39:41 +00:00
Fix some MSVC warnings.
Several fixes are warnings about truncations on 64-bit, while others are complaints about mixed signed / unsigned integer operations.
This commit is contained in:
parent
ead801f2d0
commit
9ea22324f7
8 changed files with 13 additions and 10 deletions
|
@ -615,6 +615,7 @@ if (WIN32)
|
|||
4244 # Storing value of one type in variable of another (size_t in int, for example)
|
||||
4305 # Truncating value (double to float, for example)
|
||||
4309 # Variable overflow, trying to store 128 in a signed char for example
|
||||
4351 # New behavior: elements of array 'array' will be default initialized (desired behavior)
|
||||
4355 # Using 'this' in member initialization list
|
||||
4505 # Unreferenced local function has been removed
|
||||
4701 # Potentially uninitialized local variable used
|
||||
|
@ -633,7 +634,9 @@ if (WIN32)
|
|||
set(SHINY_OGRE_WARNINGS "${WARNINGS} /wd4101")
|
||||
set_target_properties(shiny.OgrePlatform PROPERTIES COMPILE_FLAGS ${SHINY_OGRE_WARNINGS})
|
||||
set_target_properties(sdl4ogre PROPERTIES COMPILE_FLAGS ${WARNINGS})
|
||||
set_target_properties(oics PROPERTIES COMPILE_FLAGS ${WARNINGS})
|
||||
# oics uses tinyxml, which has an initialized but unused variable
|
||||
set(OICS_WARNINGS "${WARNINGS} /wd4189")
|
||||
set_target_properties(oics PROPERTIES COMPILE_FLAGS ${OICS_WARNINGS})
|
||||
set_target_properties(components PROPERTIES COMPILE_FLAGS ${WARNINGS})
|
||||
if (BUILD_LAUNCHER)
|
||||
set_target_properties(omwlauncher PROPERTIES COMPILE_FLAGS ${WARNINGS})
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace CSVRender
|
|||
|
||||
std::stringstream windowHandle;
|
||||
#ifdef WIN32
|
||||
windowHandle << Ogre::StringConverter::toString((unsigned long)(this->winId()));
|
||||
windowHandle << Ogre::StringConverter::toString((uintptr_t)(this->winId()));
|
||||
#else
|
||||
windowHandle << this->winId();
|
||||
#endif
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace MWGui
|
|||
size_t viewRange = mScrollView->getCanvasSize().height;
|
||||
if(viewPosition > viewRange)
|
||||
viewPosition = viewRange;
|
||||
mScrollView->setViewOffset(MyGUI::IntPoint(0, -viewPosition));
|
||||
mScrollView->setViewOffset(MyGUI::IntPoint(0, viewPosition * -1));
|
||||
}
|
||||
|
||||
void MWList::setPropertyOverride(const std::string &_key, const std::string &_value)
|
||||
|
|
|
@ -319,7 +319,7 @@ void LocalMap::createFogOfWar(const std::string& texturePrefix)
|
|||
std::vector<uint32> buffer;
|
||||
|
||||
// initialize to (0, 0, 0, 1)
|
||||
buffer.resize(sFogOfWarResolution*sFogOfWarResolution, (255 << 24));
|
||||
buffer.resize(sFogOfWarResolution*sFogOfWarResolution, 0xFF000000);
|
||||
|
||||
// upload to the texture
|
||||
memcpy(tex->getBuffer()->lock(HardwareBuffer::HBL_DISCARD), &buffer[0], sFogOfWarResolution*sFogOfWarResolution*4);
|
||||
|
|
|
@ -747,7 +747,7 @@ double VideoState::synchronize_video(AVFrame *src_frame, double pts)
|
|||
* buffer. We use this to store the global_pts in
|
||||
* a frame at the time it is allocated.
|
||||
*/
|
||||
static uint64_t global_video_pkt_pts = AV_NOPTS_VALUE;
|
||||
static uint64_t global_video_pkt_pts = static_cast<uint64_t>(AV_NOPTS_VALUE);
|
||||
static int our_get_buffer(struct AVCodecContext *c, AVFrame *pic)
|
||||
{
|
||||
int ret = avcodec_default_get_buffer(c, pic);
|
||||
|
|
|
@ -385,7 +385,7 @@ namespace MWSound
|
|||
sound = mOutput->playSound3D(file, initialPos, volume, basevol, pitch, min, max, mode|type, offset);
|
||||
mActiveSounds[sound] = std::make_pair(MWWorld::Ptr(), soundId);
|
||||
}
|
||||
catch(std::exception &e)
|
||||
catch(std::exception &)
|
||||
{
|
||||
//std::cout <<"Sound Error: "<<e.what()<< std::endl;
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace Terrain
|
|||
|
||||
// North
|
||||
row = verts-1;
|
||||
outerStep = 1 << (lodDeltas[North] + lodLevel);
|
||||
outerStep = size_t(1) << (lodDeltas[North] + lodLevel);
|
||||
for (size_t col = 0; col < verts-1; col += outerStep)
|
||||
{
|
||||
indices.push_back(verts*(col+outerStep)+row);
|
||||
|
@ -142,7 +142,7 @@ namespace Terrain
|
|||
|
||||
// West
|
||||
size_t col = 0;
|
||||
outerStep = 1 << (lodDeltas[West] + lodLevel);
|
||||
outerStep = size_t(1) << (lodDeltas[West] + lodLevel);
|
||||
for (size_t row = 0; row < verts-1; row += outerStep)
|
||||
{
|
||||
indices.push_back(verts*col+row+outerStep);
|
||||
|
@ -166,7 +166,7 @@ namespace Terrain
|
|||
|
||||
// East
|
||||
col = verts-1;
|
||||
outerStep = 1 << (lodDeltas[East] + lodLevel);
|
||||
outerStep = size_t(1) << (lodDeltas[East] + lodLevel);
|
||||
for (size_t row = 0; row < verts-1; row += outerStep)
|
||||
{
|
||||
indices.push_back(verts*col+row);
|
||||
|
|
2
extern/sdl4ogre/sdlwindowhelper.cpp
vendored
2
extern/sdl4ogre/sdlwindowhelper.cpp
vendored
|
@ -32,7 +32,7 @@ SDLWindowHelper::SDLWindowHelper (SDL_Window* window, int w, int h,
|
|||
#ifdef WIN32
|
||||
case SDL_SYSWM_WINDOWS:
|
||||
// Windows code
|
||||
winHandle = Ogre::StringConverter::toString((unsigned long)wmInfo.info.win.window);
|
||||
winHandle = Ogre::StringConverter::toString((uintptr_t)wmInfo.info.win.window);
|
||||
break;
|
||||
#elif __MACOSX__
|
||||
case SDL_SYSWM_COCOA:
|
||||
|
|
Loading…
Reference in a new issue