mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-09 21:43:06 -04:00
Use bool, true, and false in more places
There were still places where I was storing booleans in int variables and explicitly using 0 and 1.
This commit is contained in:
parent
c9ce6d79a9
commit
08bbcb04f6
18
bedstead.c
18
bedstead.c
@ -2613,7 +2613,7 @@ static struct glyph const *glyphs_by_name[NGLYPHS];
|
||||
|
||||
static void dolookups(struct glyph const *);
|
||||
|
||||
static int
|
||||
static bool
|
||||
getpix(char const data[YSIZE], int x, int y, unsigned flags)
|
||||
{
|
||||
|
||||
@ -3150,7 +3150,7 @@ killpoint(point *p)
|
||||
|
||||
static vec const zero = { 0, 0 };
|
||||
|
||||
static int
|
||||
static bool
|
||||
vec_eqp(vec v1, vec v2)
|
||||
{
|
||||
return v1.x == v2.x && v1.y == v2.y;
|
||||
@ -3202,7 +3202,7 @@ fix_identical(point *p)
|
||||
}
|
||||
|
||||
/* Are a, b, and c distinct collinear points in that order? */
|
||||
static int
|
||||
static bool
|
||||
vec_inline3(vec a, vec b, vec c)
|
||||
{
|
||||
return
|
||||
@ -3211,7 +3211,7 @@ vec_inline3(vec a, vec b, vec c)
|
||||
}
|
||||
|
||||
/* Are a, b, c, and d distinct collinear points in that order? */
|
||||
static int
|
||||
static bool
|
||||
vec_inline4(vec a, vec b, vec c, vec d)
|
||||
{
|
||||
return vec_inline3(a, b, c) && vec_inline3(b, c, d);
|
||||
@ -3234,7 +3234,7 @@ fix_isolated(point *p)
|
||||
killpoint(p);
|
||||
}
|
||||
|
||||
static int done_anything;
|
||||
static bool done_anything;
|
||||
|
||||
static void
|
||||
fix_edges(point *a0, point *b0)
|
||||
@ -3259,7 +3259,7 @@ fix_edges(point *a0, point *b0)
|
||||
fix_isolated(b0);
|
||||
fix_identical(b0);
|
||||
fix_collinear(a1);
|
||||
done_anything = 1;
|
||||
done_anything = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3269,7 +3269,7 @@ clean_path()
|
||||
int i, j;
|
||||
|
||||
do {
|
||||
done_anything = 0;
|
||||
done_anything = false;
|
||||
for (i = 0; i < nextpoint; i++)
|
||||
for (j = i+1; points[i].next && j < nextpoint; j++)
|
||||
if (points[j].next)
|
||||
@ -3384,7 +3384,7 @@ adjust_weight()
|
||||
}
|
||||
|
||||
static void
|
||||
blackpixel(int x, int y, int bl, int br, int tr, int tl)
|
||||
blackpixel(int x, int y, bool bl, bool br, bool tr, bool tl)
|
||||
{
|
||||
x *= XPIX_S; y *= YPIX_S;
|
||||
|
||||
@ -3401,7 +3401,7 @@ blackpixel(int x, int y, int bl, int br, int tr, int tl)
|
||||
}
|
||||
|
||||
static void
|
||||
whitepixel(int x, int y, int bl, int br, int tr, int tl)
|
||||
whitepixel(int x, int y, bool bl, bool br, bool tr, bool tl)
|
||||
{
|
||||
x *= XPIX_S; y *= YPIX_S;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user