From 64e1c6a340b6aad7ae1f45e9812b0190522df1ea Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 30 Mar 2024 00:00:10 +0100 Subject: [PATCH] fix compiler warning --- src/hardware/hw_main.c | 5 +++-- src/r_segs.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 6c80a8a6..6e9c8ae3 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1639,7 +1639,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (rover->master->flags & ML_TFERLINE) { - size_t linenum = min(gr_curline->linedef-gr_backsector->lines[0], rover->master->frontsector->linecount); + size_t linenum = min((size_t)(gr_curline->linedef-gr_backsector->lines[0]), rover->master->frontsector->linecount); newline = rover->master->frontsector->lines[0] + linenum; texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture); } @@ -1798,10 +1798,11 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (rover->master->flags & ML_TFERLINE) { - size_t linenum = min(gr_curline->linedef-gr_backsector->lines[0], rover->master->frontsector->linecount); + size_t linenum = min((size_t)(gr_curline->linedef-gr_backsector->lines[0]), rover->master->frontsector->linecount); newline = rover->master->frontsector->lines[0] + linenum; texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture); } + #ifdef ESLOPE //backsides h = *rover->t_slope ? P_GetZAt(*rover->t_slope, v1x, v1y) : *rover->topheight; hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight; diff --git a/src/r_segs.c b/src/r_segs.c index 5dd46ea0..9223357f 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -733,7 +733,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (pfloor->master->flags & ML_TFERLINE) { - size_t linenum = min(curline->linedef-backsector->lines[0], pfloor->master->frontsector->linecount); + size_t linenum = min((size_t)(curline->linedef-backsector->lines[0]), pfloor->master->frontsector->linecount); newline = pfloor->master->frontsector->lines[0] + linenum; texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture); }