From 48981775a0154f33b0a1272a6ea8d32b20956da7 Mon Sep 17 00:00:00 2001 From: flabbert Date: Sat, 14 Dec 2024 09:21:12 +0100 Subject: [PATCH 1/8] whitespace fix --- Sources/CvTalkingHeadMessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CvTalkingHeadMessage.cpp b/Sources/CvTalkingHeadMessage.cpp index 06f115d6cd..4c2d4bfd45 100644 --- a/Sources/CvTalkingHeadMessage.cpp +++ b/Sources/CvTalkingHeadMessage.cpp @@ -210,7 +210,7 @@ int CvTalkingHeadMessage::getExpireTurn() const case MESSAGE_TYPE_CHAT: iExpireTurn += 20; break; - case MESSAGE_TYPE_COMBAT_MESSAGE: + case MESSAGE_TYPE_COMBAT_MESSAGE: iExpireTurn += 20; break; case MESSAGE_TYPE_MINOR_EVENT: From 802d87ee148ea44e03a96eea0d9c92f89786eccc Mon Sep 17 00:00:00 2001 From: flabbert Date: Sat, 14 Dec 2024 09:21:22 +0100 Subject: [PATCH 2/8] update launch settings --- .vscode/c_cpp_properties.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index bbc1c13d29..804355ba67 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -12,9 +12,8 @@ "${workspaceFolder}\\Build\\deps\\Boost-1.55.0\\include", "${workspaceFolder}\\Build\\deps\\Python24\\include" ], - "defines": ["_DEBUG", "UNICODE", "_UNICODE"], + "defines": ["_DEBUG", "_UNICODE", "_MSC_VER=900"], "windowsSdkVersion": "10.0.22621.0", - "compilerPath": "${workspaceFolder}\\Build\\deps\\Microsoft Visual C++ Toolkit 2003\\bin\\cl.exe", "cStandard": "c99", "cppStandard": "c++03", "intelliSenseMode": "windows-msvc-x86" From 9e06394b8691075cba83f7f638d8cd6fc4612161 Mon Sep 17 00:00:00 2001 From: flabbert Date: Sat, 14 Dec 2024 09:36:55 +0100 Subject: [PATCH 3/8] update the vscode properties file, if launcing inside Sources folder --- Sources/.vscode/c_cpp_properties.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/.vscode/c_cpp_properties.json b/Sources/.vscode/c_cpp_properties.json index ced110af92..6a47a75d3c 100644 --- a/Sources/.vscode/c_cpp_properties.json +++ b/Sources/.vscode/c_cpp_properties.json @@ -12,7 +12,12 @@ "${workspaceFolder}\\..\\Build\\deps\\Boost-1.55.0\\include", "${workspaceFolder}\\..\\Build\\deps\\Python24\\include" ], - "defines": [], + "defines": [ + "_DEBUG", + "_UNICODE", + "_MSC_VER=900", + "FP_PROFILE_EXTRA_ENABLE" + ], "windowsSdkVersion": "10.0.22621.0", "compilerPath": "cl.exe", "cStandard": "c99", From 44b86f2fe50262a8c2fed0b6cfa7fe6b50943049 Mon Sep 17 00:00:00 2001 From: flabbert Date: Sat, 14 Dec 2024 09:38:02 +0100 Subject: [PATCH 4/8] fix cpp properties --- .vscode/c_cpp_properties.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 804355ba67..bcc7e8551d 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -12,7 +12,12 @@ "${workspaceFolder}\\Build\\deps\\Boost-1.55.0\\include", "${workspaceFolder}\\Build\\deps\\Python24\\include" ], - "defines": ["_DEBUG", "_UNICODE", "_MSC_VER=900"], + "defines": [ + "_DEBUG", + "_UNICODE", + "_MSC_VER=900", + "FP_PROFILE_EXTRA_ENABLE" + ], "windowsSdkVersion": "10.0.22621.0", "cStandard": "c99", "cppStandard": "c++03", From 26968e9818c8d26257a28d351a96a4b4a3cceb25 Mon Sep 17 00:00:00 2001 From: flabbert Date: Sat, 14 Dec 2024 09:51:49 +0100 Subject: [PATCH 5/8] add more default defines for vscode --- .vscode/c_cpp_properties.json | 3 ++- Sources/.vscode/c_cpp_properties.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index bcc7e8551d..9307fa93d4 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -16,7 +16,8 @@ "_DEBUG", "_UNICODE", "_MSC_VER=900", - "FP_PROFILE_EXTRA_ENABLE" + "FP_PROFILE_EXTRA_ENABLE", + "_MOD_FRACTRADE" ], "windowsSdkVersion": "10.0.22621.0", "cStandard": "c99", diff --git a/Sources/.vscode/c_cpp_properties.json b/Sources/.vscode/c_cpp_properties.json index 6a47a75d3c..95c30423d0 100644 --- a/Sources/.vscode/c_cpp_properties.json +++ b/Sources/.vscode/c_cpp_properties.json @@ -16,7 +16,8 @@ "_DEBUG", "_UNICODE", "_MSC_VER=900", - "FP_PROFILE_EXTRA_ENABLE" + "FP_PROFILE_EXTRA_ENABLE", + "_MOD_FRACTRADE" ], "windowsSdkVersion": "10.0.22621.0", "compilerPath": "cl.exe", From de5dc827f157d5b7bf6176a39b3e4c3f3bda7477 Mon Sep 17 00:00:00 2001 From: flabbert Date: Sat, 14 Dec 2024 11:36:01 +0100 Subject: [PATCH 6/8] do not reuse variable from previous loop --- Sources/CvPlayerAI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/CvPlayerAI.cpp b/Sources/CvPlayerAI.cpp index 8055034e8c..f31466d73e 100644 --- a/Sources/CvPlayerAI.cpp +++ b/Sources/CvPlayerAI.cpp @@ -26223,11 +26223,11 @@ void CvPlayerAI::AI_setPushReligiousVictory() } bool bStateReligionBest = true; - for (iI = 0; iI < GC.getNumReligionInfos(); iI++) + for (int iJ = 0; iJ < GC.getNumReligionInfos(); iJ++) { - if (eStateReligion != (ReligionTypes)iI) + if (eStateReligion != (ReligionTypes)iJ) { - if (GC.getGame().calculateReligionPercent((ReligionTypes)iI) > iStateReligionInfluence) + if (GC.getGame().calculateReligionPercent((ReligionTypes)iJ) > iStateReligionInfluence) { bStateReligionBest = false; break; From e10a5beebd2555abff0604095b2f814ed93b903e Mon Sep 17 00:00:00 2001 From: flabbert Date: Sun, 15 Dec 2024 10:39:44 +0100 Subject: [PATCH 7/8] add vscode extension recommendation --- .vscode/extensions.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..7443ab451c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["ms-vscode.cpptools"] +} From 61f588f352e36d13ab95a1608d394aad49a8547f Mon Sep 17 00:00:00 2001 From: flabbert Date: Sun, 15 Dec 2024 10:40:08 +0100 Subject: [PATCH 8/8] add comment on first error of scoring to say that its harmless --- Sources/CvCityAI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/CvCityAI.cpp b/Sources/CvCityAI.cpp index f3b2d93558..7a900d4385 100644 --- a/Sources/CvCityAI.cpp +++ b/Sources/CvCityAI.cpp @@ -7321,6 +7321,7 @@ int CvCityAI::AI_getGoodTileCount() const { // This check is necessary to stop oscillation which can result // when best build changes food situation for city, changing the best build. + // this signature is erroring out in vscode, but it does compile and work as intended, so we ignore the error eBuild = scoring::min_score( pLoopPlot->units() | filtered(CvUnit::fn::getBuildType() != NO_BUILD) | transformed(CvUnit::fn::getBuildType()),