Merge branch 'maint'

This commit is contained in:
Christoph Oelckers 2014-01-17 20:45:20 +01:00
commit e126c3ec2f
4 changed files with 8 additions and 8 deletions

View File

@ -1126,10 +1126,11 @@ if( NOT WIN32 )
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/link-make
COMMAND /bin/sh -c ${CMAKE_CURRENT_BINARY_DIR}/link-make )
endif( NOT WIN32 )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
# GCC misoptimizes this file
set_source_files_properties( oplsynth/fmopl.cpp PROPERTIES COMPILE_FLAGS "-fno-tree-dominator-opts -fno-tree-fre" )
endif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
# Need to enable intrinsics for this file.
if( SSE_MATTERS )
set_source_files_properties( x86.cpp PROPERTIES COMPILE_FLAGS "-msse2 -mmmx" )

View File

@ -775,7 +775,7 @@ void G_AddViewPitch (int look)
else if (look > 0)
{
// Avoid overflowing
if (LocalViewPitch + look <= LocalViewPitch)
if (LocalViewPitch > INT_MAX - look)
{
LocalViewPitch = 0x78000000;
}
@ -787,7 +787,7 @@ void G_AddViewPitch (int look)
else if (look < 0)
{
// Avoid overflowing
if (LocalViewPitch + look >= LocalViewPitch)
if (LocalViewPitch < INT_MIN - look)
{
LocalViewPitch = -0x78000000;
}

View File

@ -608,7 +608,7 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
if (delta > 0)
{
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
if (viewpitch + delta <= viewpitch)
if (viewpitch > INT_MAX - delta)
{
viewpitch = player->MaxPitch;
}
@ -620,7 +620,7 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
else if (delta < 0)
{
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
if (viewpitch + delta >= viewpitch)
if (viewpitch < INT_MIN - delta)
{
viewpitch = player->MinPitch;
}

View File

@ -704,8 +704,7 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
printf ("%d. %s (%s)\n", i+1, wads[i].Name.GetChars(), filepart);
}
printf ("Which one? ");
scanf ("%d", &i);
if (i > numwads)
if (scanf ("%d", &i) != 1 || i > numwads)
return -1;
return i-1;
}