diff --git a/src/gl/data/gl_setup.cpp b/src/gl/data/gl_setup.cpp index 7959b2083..c34b149d5 100644 --- a/src/gl/data/gl_setup.cpp +++ b/src/gl/data/gl_setup.cpp @@ -399,20 +399,15 @@ static void AddToVertex(const sector_t * sec, TArray & list) static void InitVertexData() { - TArray * vt_sectorlists; - - int i,j,k; - - vt_sectorlists = new TArray[level.vertexes.Size()]; - + auto vt_sectorlists = new TArray[level.vertexes.Size()]; for(auto &line : level.lines) { - for(j=0;j<2;j++) + for(int j = 0; j < 2; ++j) { vertex_t * v = j==0? line.v1 : line.v2; - for(k=0;k<2;k++) + for(int k = 0; k < 2; ++k) { sector_t * sec = k==0? line.frontsector : line.backsector; @@ -427,7 +422,7 @@ static void InitVertexData() } } - for(i=0;i 1) qsort(level.sides[i].segs, level.sides[i].numsegs, sizeof(seg_t*), segcmp); } diff --git a/src/nodebuild.cpp b/src/nodebuild.cpp index 735ee10f7..19dc16b61 100644 --- a/src/nodebuild.cpp +++ b/src/nodebuild.cpp @@ -1053,7 +1053,7 @@ void FNodeBuilder::PrintSet (int l, DWORD set) Printf (PRINT_LOG, "set %d:\n", l); for (; set != DWORD_MAX; set = Segs[set].next) { - Printf (PRINT_LOG, "\t%u(%td)%c%d(%d,%d)-%d(%d,%d)\n", set, Segs[set].frontsector->sectornum, + Printf (PRINT_LOG, "\t%u(%d)%c%d(%d,%d)-%d(%d,%d)\n", set, Segs[set].frontsector->sectornum, Segs[set].linedef == -1 ? '+' : ':', Segs[set].v1, Vertices[Segs[set].v1].x>>16, Vertices[Segs[set].v1].y>>16, diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index 51e59ec08..bfe341265 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -376,7 +376,9 @@ static bool LoadGLSegs(FileReader * lump) { // check for gl-vertices segs[i].v1 = &level.vertexes[checkGLVertex3(LittleLong(ml->v1))]; segs[i].v2 = &level.vertexes[checkGLVertex3(LittleLong(ml->v2))]; - segs[i].PartnerSeg = LittleLong(ml->partner) == 0xffffffffu? nullptr : &segs[LittleLong(ml->partner)]; + + const DWORD partner = LittleLong(ml->partner); + segs[i].PartnerSeg = DWORD_MAX == partner ? nullptr : &segs[partner]; if(ml->linedef != 0xffff) // skip minisegs { diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 8dc46e922..6a944452e 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -378,7 +378,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, subsector_t *&ss, subs .StringPtr(nullptr, str) .EndArray(); - if (num_verts == level.vertexes.Size() && num_subs == numsubsectors && hasglnodes) + if (num_verts == (int)level.vertexes.Size() && num_subs == numsubsectors && hasglnodes) { success = true; int sub = 0; @@ -1009,4 +1009,4 @@ void P_FreeMapDataBackup() loadsectors.Clear(); loadlines.Clear(); loadsides.Clear(); -} \ No newline at end of file +} diff --git a/src/p_scroll.cpp b/src/p_scroll.cpp index 11de6023f..8dcf18a53 100644 --- a/src/p_scroll.cpp +++ b/src/p_scroll.cpp @@ -529,7 +529,7 @@ void P_SpawnScrollers(void) FLineIdIterator itr(l->args[0]); while ((s = itr.Next()) >= 0) { - if (s != i) + if (s != (int)i) new DScroller(dx, dy, &level.lines[s], control, accel); } break; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index c7c59aaa9..b94e12b9b 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -2298,7 +2298,7 @@ static void P_AllocateSideDefs (MapData *map, int count) sidetemp[i].a.alpha = SHRT_MIN; sidetemp[i].a.map = NO_SIDE; } - auto numsides = map->Size(ML_SIDEDEFS) / sizeof(mapsidedef_t); + int numsides = map->Size(ML_SIDEDEFS) / sizeof(mapsidedef_t); if (count < numsides) { Printf ("Map has %d unused sidedefs\n", numsides - count); diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index fd86299dc..2c4d1422a 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -8485,7 +8485,7 @@ static int BuiltinFormat(VMValue *args, TArray &defaultparam, int numpa // various type flags are not supported. not like stuff like 'hh' modifier is to be used in the VM. // the only combination that is parsed locally is %n$... bool haveargnums = false; - for (int i = 0; i < fmtstring.Len(); i++) + for (size_t i = 0; i < fmtstring.Len(); i++) { char c = fmtstring[i]; if (in_fmt)