From 7f70f3d4ed1de5f96e32702e467d5906bc60f320 Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 11 Aug 2021 17:43:43 +1000 Subject: [PATCH] fix build for switch --- gmsrc/src/gm/gmCodeGen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gmsrc/src/gm/gmCodeGen.cpp b/gmsrc/src/gm/gmCodeGen.cpp index 8e8d4df..59a9874 100644 --- a/gmsrc/src/gm/gmCodeGen.cpp +++ b/gmsrc/src/gm/gmCodeGen.cpp @@ -980,7 +980,7 @@ bool gmCodeGenPrivate::GenStmtSwitch(const gmCodeTreeNode * a_node, gmByteCodeGe casestmtjumpfromlocs.InsertLast(jumpfromstmtloc); ++casestmtid; // Go back and backfill ptrs to the jump to loc - for (caseid = 0; caseid < casejumpfromlocs.Count(); ++caseid) + for (caseid = 0; caseid < (gmuint)casejumpfromlocs.Count(); ++caseid) { // jump to position a_byteCode->Seek(casejumpfromlocs[caseid]); @@ -992,7 +992,7 @@ bool gmCodeGenPrivate::GenStmtSwitch(const gmCodeTreeNode * a_node, gmByteCodeGe casejumpfromlocs.ResetAndFreeMemory(); gmuint end_of_stmt = a_byteCode->Tell(); a_byteCode->Seek(casefailloc); - a_byteCode->Emit(BC_BRA, jumpfromstmtloc + SIZEOF_BC_BRA); + a_byteCode->Emit(BC_BRA, jumpfromstmtloc + (gmuint)SIZEOF_BC_BRA); // Jump back to where we were ready for next statement a_byteCode->Seek(jumpfromstmtloc + SIZEOF_BC_BRA); // reset case @@ -1008,7 +1008,7 @@ bool gmCodeGenPrivate::GenStmtSwitch(const gmCodeTreeNode * a_node, gmByteCodeGe if (!Generate(defaultstmt, a_byteCode)) return false; } gmuint end_of_code = a_byteCode->Tell(); - for (caseid = 0; caseid < casestmtjumpfromlocs.Count(); ++caseid) + for (caseid = 0; caseid < (gmuint)casestmtjumpfromlocs.Count(); ++caseid) { gmuint loc = casestmtjumpfromlocs[caseid]; // jump to position