diff --git a/docs/rh-log.txt b/docs/rh-log.txt
index c96a50fc3..e586dc0b4 100644
--- a/docs/rh-log.txt
+++ b/docs/rh-log.txt
@@ -1,3 +1,10 @@
+February 2, 2007
+- Fixed: The SafeDivScales used a signed shift for their if test. This fails
+ when a == 0x80000000, because the result of abs will still be negative as
+ long as we use signed math.
+- Fixed: SafeDivScale31 performed DivScale32 instead.
+- Fixed: R_DrawSpanP_ASM had a short jump into a different section.
+
January 30, 2007
- Fixed: When quiting from fullscreen mode, RestoreConView() did not ungrab
the mouse.
diff --git a/src/m_fixed.h b/src/m_fixed.h
index 20daa5436..3d7f577b7 100644
--- a/src/m_fixed.h
+++ b/src/m_fixed.h
@@ -23,7 +23,7 @@
#define MAKESAFEDIVSCALE(x) \
inline SDWORD SafeDivScale##x (SDWORD a, SDWORD b) \
{ \
- if (abs(a) >> (31-x) >= abs (b)) \
+ if ((DWORD)abs(a) >> (31-x) >= (DWORD)abs (b)) \
return (a^b)<0 ? FIXED_MIN : FIXED_MAX; \
return DivScale##x (a, b); \
}
@@ -62,14 +62,14 @@ MAKESAFEDIVSCALE(30)
inline SDWORD SafeDivScale31 (SDWORD a, SDWORD b)
{
- if (abs(a) >= abs (b))
+ if ((DWORD)abs(a) >= (DWORD)abs (b))
return (a^b)<0 ? FIXED_MIN : FIXED_MAX;
- return DivScale32 (a, b);
+ return DivScale31 (a, b);
}
inline SDWORD SafeDivScale32 (SDWORD a, SDWORD b)
{
- if (abs(a) >= abs (b) >> 1)
+ if ((DWORD)abs(a) >= (DWORD)abs (b) >> 1)
return (a^b)<0 ? FIXED_MIN : FIXED_MAX;
return DivScale32 (a, b);
}
diff --git a/src/tmap.nas b/src/tmap.nas
index 4a09d5b89..4ce36154a 100644
--- a/src/tmap.nas
+++ b/src/tmap.nas
@@ -321,7 +321,7 @@ R_DrawSpanP_ASM:
mov eax,[ds_x2]
mov ecx,[ds_x1]
sub eax,ecx
- jl aret ; count < 0: nothing to do, so leave
+ jl near rdspret ; count < 0: nothing to do, so leave
push ebx
push edi
diff --git a/zdoom.vcproj b/zdoom.vcproj
index 4c2984919..6ee4c8b90 100644
--- a/zdoom.vcproj
+++ b/zdoom.vcproj
@@ -4774,7 +4774,7 @@
@@ -4818,7 +4818,7 @@
@@ -4862,7 +4862,7 @@
@@ -4906,7 +4906,7 @@
@@ -4950,7 +4950,7 @@
@@ -5376,7 +5376,7 @@