From 9356834157747a830e380ef2689d4de90571d8d1 Mon Sep 17 00:00:00 2001 From: Belonit <54427022+Belonit@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:25:46 +0300 Subject: [PATCH 1/8] Use the standard MSVC cdecl spelling --- code/vqalib/vqapalette.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/vqalib/vqapalette.h b/code/vqalib/vqapalette.h index 856c58f1..136e2eb0 100644 --- a/code/vqalib/vqapalette.h +++ b/code/vqalib/vqapalette.h @@ -39,10 +39,10 @@ extern "C" { #endif -void cdecl SetPalette(unsigned char *palette,long numbytes,unsigned long slowpal); -void cdecl ReadPalette(void *palette); -void cdecl SetDAC(long color, long red, long green, long blue); -void cdecl TranslatePalette(void *pal24, void *pal15, long numbytes); +void __cdecl SetPalette(unsigned char *palette,long numbytes,unsigned long slowpal); +void __cdecl ReadPalette(void *palette); +void __cdecl SetDAC(long color, long red, long green, long blue); +void __cdecl TranslatePalette(void *pal24, void *pal15, long numbytes); #ifdef __cplusplus } From 2ed277a492cd838f72f3c1ef7cc0ec0378938db5 Mon Sep 17 00:00:00 2001 From: Belonit <54427022+Belonit@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:25:46 +0300 Subject: [PATCH 2/8] Remove obsolete register specifiers --- code/lzo1x_c.cpp | 12 ++++++------ code/lzo1x_d.cpp | 8 ++++---- code/vqalib/unvq.cpp | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/code/lzo1x_c.cpp b/code/lzo1x_c.cpp index ebcf7dd7..d612da89 100644 --- a/code/lzo1x_c.cpp +++ b/code/lzo1x_c.cpp @@ -121,7 +121,7 @@ static int do_compress(const lzo_byte * in, lzo_uint in_len, lzo_voidp wrkmem ) { - register const lzo_byte *ip; + const lzo_byte *ip; lzo_uint dv; lzo_byte *op; const lzo_byte * const in_end = in + in_len; @@ -139,7 +139,7 @@ static int do_compress(const lzo_byte * in, lzo_uint in_len, DVAL_NEXT(dv,ip); UPDATE_D(dict,cycle,dv,ip); ip++; for (;;) { - register const lzo_byte *m_pos; + const lzo_byte *m_pos; lzo_uint m_len; lzo_ptrdiff_t m_off; lzo_uint lit; @@ -197,7 +197,7 @@ static int do_compress(const lzo_byte * in, lzo_uint in_len, /* store current literal run */ if (lit > 0) { - register lzo_uint t = lit; + lzo_uint t = lit; if (t <= 3) { assert(op - 2 > out); @@ -206,7 +206,7 @@ static int do_compress(const lzo_byte * in, lzo_uint in_len, if (t <= 18) { *op++ = LZO_BYTE(t - 3); } else { - register lzo_uint tt = t - 18; + lzo_uint tt = t - 18; *op++ = 0; while (tt > 255) { @@ -304,7 +304,7 @@ static int do_compress(const lzo_byte * in, lzo_uint in_len, /* store final literal run */ if (in_end - ii > 0) { - register lzo_uint t = in_end - ii; + lzo_uint t = in_end - ii; if (op == out && t <= 238) { *op++ = LZO_BYTE(17 + t); @@ -315,7 +315,7 @@ static int do_compress(const lzo_byte * in, lzo_uint in_len, if (t <= 18) { *op++ = LZO_BYTE(t - 3); } else { - register lzo_uint tt = t - 18; + lzo_uint tt = t - 18; *op++ = 0; while (tt > 255) { diff --git a/code/lzo1x_d.cpp b/code/lzo1x_d.cpp index 502f2a37..d25d3965 100644 --- a/code/lzo1x_d.cpp +++ b/code/lzo1x_d.cpp @@ -95,10 +95,10 @@ int lzo1x_decompress ( const lzo_byte * in, lzo_uint in_len, lzo_byte * out, lzo_uint * out_len, lzo_voidp ) { - register lzo_byte *op; - register const lzo_byte *ip; - register lzo_uint t; - register const lzo_byte *m_pos; + lzo_byte *op; + const lzo_byte *ip; + lzo_uint t; + const lzo_byte *m_pos; const lzo_byte * const ip_end = in + in_len; *out_len = 0; diff --git a/code/vqalib/unvq.cpp b/code/vqalib/unvq.cpp index 4eb83ef9..f218874e 100644 --- a/code/vqalib/unvq.cpp +++ b/code/vqalib/unvq.cpp @@ -956,7 +956,7 @@ void __cdecl UnVQ2_C0_4x4_TRANS(unsigned char * codebook, unsigned char * pointe { uint8_t * dst = (uint8_t *)buffer; uint8_t * row_base = (uint8_t *)buffer; - register uint16_t * src = (uint16_t *)pointers; + uint16_t * src = (uint16_t *)pointers; uint32_t blocks = 0; uint32_t total = blocksperrow * numrows; @@ -1222,7 +1222,7 @@ void __cdecl UnVQ2_C0_4x4_KEY(unsigned char * codebook, unsigned char * pointers { uint8_t * dst = (uint8_t *)buffer; uint8_t * row_base = (uint8_t *)buffer; - register uint16_t * src = (uint16_t *)pointers; + uint16_t * src = (uint16_t *)pointers; uint32_t blocks = 0; uint32_t total = numrows * blocksperrow; @@ -2010,7 +2010,7 @@ void __cdecl UnVQ2_C0_4x2_KEY(unsigned char * codebook, unsigned char * pointers { uint8_t * dst = (uint8_t *)buffer; uint8_t * row_base = (uint8_t *)buffer; - register uint16_t * src = (uint16_t *)pointers; + uint16_t * src = (uint16_t *)pointers; uint32_t blocks = 0; uint32_t total = numrows * blocksperrow; From 6c0483114f4f6eaa5b6a3e0680581ed682c1dcdc Mon Sep 17 00:00:00 2001 From: Belonit <54427022+Belonit@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:25:46 +0300 Subject: [PATCH 3/8] Remove the duplicate friend default argument --- code/int.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/int.h b/code/int.h index b258e61c..1a22d621 100644 --- a/code/int.h +++ b/code/int.h @@ -173,7 +173,7 @@ class Int { // Friend helper functions. template - friend T Generate_Prime(Straw & rng, int pbits, T const * = 0); + friend T Generate_Prime(Straw & rng, int pbits, T const *); template friend T Gcd(const Int & a, const T & b); // friend bool NextPrime(Int & p, const Int & max, bool blumInt=false); From 52b770cb111c2d12ba019fc12525c4098d5d4aa5 Mon Sep 17 00:00:00 2001 From: Belonit <54427022+Belonit@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:25:46 +0300 Subject: [PATCH 4/8] Include FontClass definition in list.h --- code/list.h | 1 + 1 file changed, 1 insertion(+) diff --git a/code/list.h b/code/list.h index e2b6dfbd..2897e7cf 100644 --- a/code/list.h +++ b/code/list.h @@ -34,6 +34,7 @@ #include "control.h" #include "dialog.h" +#include "font.h" #include "shapebtn.h" #include "slider.h" #include "vector.h" From e4cd0e3f3ebf44fa3e8cdb0cd85ce676b1f65815 Mon Sep 17 00:00:00 2001 From: Belonit <54427022+Belonit@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:25:46 +0300 Subject: [PATCH 5/8] Make command-line hash values explicitly signed --- code/init.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/init.cpp b/code/init.cpp index c4543ac6..b876c495 100644 --- a/code/init.cpp +++ b/code/init.cpp @@ -204,7 +204,7 @@ struct ChooseCampaignStruct { ** Enable the set of limited cheat key options. */ #ifdef _DEBUG -#define PARM_PLAYTEST 0xF7DDC227 // "PLAYTEST" +#define PARM_PLAYTEST static_cast(0xF7DDC227u) // "PLAYTEST" #endif /* @@ -212,11 +212,11 @@ struct ChooseCampaignStruct { */ #ifdef _DEBUG #ifndef PARM_PLAYTEST -#define PARM_PLAYTEST 0xF7DDC227 // "PLAYTEST" +#define PARM_PLAYTEST static_cast(0xF7DDC227u) // "PLAYTEST" #endif #endif -#define PARM_INSTALL 0xD95C68A2 // "FROMINSTALL" +#define PARM_INSTALL static_cast(0xD95C68A2u) // "FROMINSTALL" /**************************************** From 1dad40907e4a66f8ad9be68c4f4b2aae227aa2f1 Mon Sep 17 00:00:00 2001 From: Belonit <54427022+Belonit@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:25:46 +0300 Subject: [PATCH 6/8] Define bignum template static members explicitly --- code/int.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/int.cpp b/code/int.cpp index 04b0a083..de173442 100644 --- a/code/int.cpp +++ b/code/int.cpp @@ -35,7 +35,7 @@ #include "mpmath.h" -int bignum::Error = 0; -bool bignum::Carry = false; -bool bignum::Borrow = false; -bignum bignum::Remainder; +template<> int Int::Error = 0; +template<> bool Int::Carry = false; +template<> bool Int::Borrow = false; +template<> Int Int::Remainder{}; From 199c627dc04849361943cb8c67d4069314a48312 Mon Sep 17 00:00:00 2001 From: Belonit <54427022+Belonit@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:25:46 +0300 Subject: [PATCH 7/8] Fix _wsproto.h include casing --- code/_wsproto.cpp | 2 +- code/wsproto.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/_wsproto.cpp b/code/_wsproto.cpp index 2514d980..3762adf9 100644 --- a/code/_wsproto.cpp +++ b/code/_wsproto.cpp @@ -31,7 +31,7 @@ #include "always.h" -#include "_WSProto.h" +#include "_wsproto.h" WinsockInterfaceClass *PacketTransport = 0; //The object for interfacing with Winsock diff --git a/code/wsproto.h b/code/wsproto.h index ce2e02e7..cfcd4336 100644 --- a/code/wsproto.h +++ b/code/wsproto.h @@ -31,7 +31,7 @@ #pragma once -#include "_WSProto.h" +#include "_wsproto.h" #include "ipxaddr.h" #include "vector.h" From 556dbac21ba86682bff64ac3ba7ce7c0b85f0df9 Mon Sep 17 00:00:00 2001 From: Belonit <54427022+Belonit@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:25:46 +0300 Subject: [PATCH 8/8] Rename the TagClass cleanup method TagClass::Init is static but has the same signature as the virtual AbstractClass::Init. Clang rejects this conflict, while MSVC accepts it as an extension. --- code/scenario.cpp | 2 +- code/tag.cpp | 2 +- code/tag.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/scenario.cpp b/code/scenario.cpp index f2b91b73..b1a3a272 100644 --- a/code/scenario.cpp +++ b/code/scenario.cpp @@ -926,7 +926,7 @@ void Clear_Scenario(void) Map.ZoneConnections.Clear(); - TagClass::Init(); + TagClass::Delete_All(); for (index = 0; index < ARRAY_SIZE(Scen->GlobalFlags); index++) { Scen->Set_Global_To(index, false); diff --git a/code/tag.cpp b/code/tag.cpp index 2183dcd7..1fc370b3 100644 --- a/code/tag.cpp +++ b/code/tag.cpp @@ -333,7 +333,7 @@ void TagClass::Set_Position(Cell cell) /// This routine is called when a scenario is torn down so that no tag from the previous /// mission survives into the next one. /// -void TagClass::Init(void) +void TagClass::Delete_All(void) { while (Tags.Count() > 0) { delete Tags[0]; diff --git a/code/tag.h b/code/tag.h index 9567f1ab..fe24ffe5 100644 --- a/code/tag.h +++ b/code/tag.h @@ -59,7 +59,7 @@ class TagClass : public AbstractClass static void All_Timer_Global_Reset(int global); static void All_Timer_Local_Reset(int local); - static void Init(void); + static void Delete_All(void); void Link(TriggerClass *trigger); bool Unlink(TriggerClass *trigger);