Commit 61f4df80 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Static analysis fixups

Line 114:
Remove the potential divide by zero by considering that the only way to get xspace=0 is when yspace <= 1, in which case it's a unity grid.
Line 295:
Add some brackets to make the expression unambiguous. Fortunately with Norcroft ((thing & 1) == 1) results in the same output as (thing & (1 == 1)) in this situation.
From a tip off in https://www.riscosopen.org/forum/forums/4/topics/3990

Version 1.29. Tagged as 'Draw-1_29'
parent 2ab1e96d
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.28"
Module_Version SETA 128
Module_MajorVersion SETS "1.29"
Module_Version SETA 129
Module_MinorVersion SETS ""
Module_Date SETS "04 Dec 2015"
Module_ApplicationDate SETS "04-Dec-15"
Module_Date SETS "02 May 2016"
Module_ApplicationDate SETS "02-May-16"
Module_ComponentName SETS "Draw"
Module_ComponentPath SETS "castle/RiscOS/Sources/Apps/Draw"
Module_FullVersion SETS "1.28"
Module_HelpVersion SETS "1.28 (04 Dec 2015)"
Module_FullVersion SETS "1.29"
Module_HelpVersion SETS "1.29 (02 May 2016)"
END
/* (1.28)
/* (1.29)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.28
#define Module_MajorVersion_CMHG 1.29
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 04 Dec 2015
#define Module_Date_CMHG 02 May 2016
#define Module_MajorVersion "1.28"
#define Module_Version 128
#define Module_MajorVersion "1.29"
#define Module_Version 129
#define Module_MinorVersion ""
#define Module_Date "04 Dec 2015"
#define Module_Date "02 May 2016"
#define Module_ApplicationDate "04-Dec-15"
#define Module_ApplicationDate "02-May-16"
#define Module_ComponentName "Draw"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Draw"
#define Module_FullVersion "1.28"
#define Module_HelpVersion "1.28 (04 Dec 2015)"
#define Module_LibraryVersionInfo "1:28"
#define Module_FullVersion "1.29"
#define Module_HelpVersion "1.29 (02 May 2016)"
#define Module_LibraryVersionInfo "1:29"
......@@ -108,9 +108,10 @@ void draw_grid_snap (viewrec *vuue, draw_objcoord *pt)
/* Find rounded down x, y coordinates */
if (xspace == 0)
{ x0 = x1 = xx;
{ /* Implies yspace <= 1 */
x0 = x1 = xx;
dx0 = dx1 = 0;
colnum = x0/xspace;
colnum = xx;
}
else
{ x0 = (xx/xspace)*xspace;
......@@ -289,7 +290,7 @@ void draw_grid_paint (viewrec *vuue, draw_objcoord *org, draw_bboxtyp clip)
yDelta = (int) (yInc/ySteps);
xStart = clip.x0;
if ((clip.y0/yInc) & 1 == 1) /* Row number test */
if (((clip.y0/yInc) & 1) == 1) /* Row number test */
{ clip.x0 = (int) (clip.x0 + xInc/2);
if (clip.x0 >= xStart) clip.x0 -= xInc;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment