From 7bb91ae27ea67c450292a21652fe2ffaba00ade1 Mon Sep 17 00:00:00 2001 From: Allen Date: Sat, 12 Jun 2021 03:53:00 -0400 Subject: [PATCH] Fixed Compile Errors Next is linker errors due to the breaking changes in stdio.h in the last 7 years. --- .gitignore | 7 +++++- src/DMX_Remake/DMX_Remake/DMX_Remake.vcxproj | 25 ++++++++++++++++---- src/headers/common.h | 10 ++++---- src/source/lightsManager.cpp | 2 +- src/source/main.cpp | 4 ++-- 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index aaad961..5b0d51e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,9 @@ src/DMX_Remake/DMX_Remake/Release/DMX.exe.intermediate.manifest *.user src/DMX_Remake/Debug/DMX_Debug.exe src/DMX_Remake/Release/DMX.exe -*.opensdf \ No newline at end of file +*.opensdf +src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.db-shm +src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.db-wal +src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.opendb +src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.db +src/DMX_Remake/.vs/DMX_Remake/v16/Browse.VC.db diff --git a/src/DMX_Remake/DMX_Remake/DMX_Remake.vcxproj b/src/DMX_Remake/DMX_Remake/DMX_Remake.vcxproj index 013f689..2500386 100644 --- a/src/DMX_Remake/DMX_Remake/DMX_Remake.vcxproj +++ b/src/DMX_Remake/DMX_Remake/DMX_Remake.vcxproj @@ -59,7 +59,7 @@ Level3 Disabled - _MBCS;ALLEGRO_HAVE_STDINT_H;DMXDEBUG;CURL_STATICLIB;%(PreprocessorDefinitions) + _MBCS;CURL_STATICLIB;DMXDEBUG;CURL_STATICLIB;%(PreprocessorDefinitions) 4701;%(DisableSpecificWarnings) Default true @@ -74,16 +74,26 @@ true - allegro-4.4.2-mt.lib;loadpng-1.5-mt.lib;logg-1.0-mt.lib;zlib-1.2.5-static-mt.lib;fmodvc.lib;apeg_r.lib;ogg_static.lib;vorbis_static.lib;libtheora.lib;winmm.lib;urlmon.lib;hidapi.lib;libcurl.lib;Ws2_32.lib;wldap32.lib;%(AdditionalDependencies) + allegro-4.4.2-mt.lib;loadpng-1.5-mt.lib;logg-1.0-mt.lib;zlib-1.2.5-static-mt.lib;fmodvc.lib;apeg_r.lib;ogg_static.lib;vorbis_static.lib;libtheora.lib;winmm.lib;urlmon.lib;hidapi.lib;libcurl.lib;Ws2_32.lib;wldap32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) Windows libcmt.lib - UseLinkTimeCodeGeneration + UseFastLinkTimeCodeGeneration false + + + + + + + MachineX86 del $(ProjectDir)\debug\version.obj touch the attract mode to update the __DATE__ + + false + @@ -92,7 +102,7 @@ true true Default - _MBCS;ALLEGRO_HAVE_STDINT_H;CURL_STATICLIB;%(PreprocessorDefinitions) + _MBCS;CURL_STATICLIB;CURL_STATICLIB;%(PreprocessorDefinitions) true stdc17 false @@ -100,12 +110,14 @@ false + false + MultiThreadedDLL true true true - allegro-4.4.2-mt.lib;loadpng-1.5-mt.lib;logg-1.0-mt.lib;zlib-1.2.5-static-mt.lib;fmodvc.lib;apeg_r.lib;ogg_static.lib;vorbis_static.lib;libtheora.lib;winmm.lib;urlmon.lib;hidapi.lib;libcurl.lib;Ws2_32.lib;wldap32.lib;%(AdditionalDependencies) + allegro-4.4.2-mt.lib;loadpng-1.5-mt.lib;logg-1.0-mt.lib;zlib-1.2.5-static-mt.lib;fmodvc.lib;apeg_r.lib;ogg_static.lib;vorbis_static.lib;libtheora.lib;winmm.lib;urlmon.lib;hidapi.lib;libcurl.lib;Ws2_32.lib;wldap32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) Windows false libcmt.lib @@ -114,6 +126,9 @@ del $(ProjectDir)\release\versionManager.obj touch the attract mode to update the __DATE__ + + false + diff --git a/src/headers/common.h b/src/headers/common.h index 31e7003..89f94e3 100644 --- a/src/headers/common.h +++ b/src/headers/common.h @@ -4,6 +4,11 @@ #ifndef _COMMONDMXH_H_ #define _COMMONDMXH_H_ +#include +#include +#include +#include + #pragma warning(disable : 4312) #include "../lib/allegro/include/allegro.h" // allegro library #include "../lib/allegro/include/winalleg.h" @@ -14,11 +19,6 @@ #include "../lib/fmodapi375win/api/inc/fmod.h" // an audio library used for playing keysounds #pragma warning(default : 4312) -#include -#include -#include -#include - #define UTIME unsigned long int #define UNUSED(var) (void)(var) diff --git a/src/source/lightsManager.cpp b/src/source/lightsManager.cpp index 43b4a5e..0239a08 100644 --- a/src/source/lightsManager.cpp +++ b/src/source/lightsManager.cpp @@ -257,7 +257,7 @@ void LightsManager::loadLampProgram(const char* filename) else { struct LAMP_STEP lamp; - sscanf_s(temp, "%d, %d, %d, %d, %c", &lamp.timing, &lamp.group, &lamp.addDuration, &lamp.color, &lamp.option); + sscanf_s(temp, "%d, %d, %d, %d, %c", &lamp.timing, &lamp.group, &lamp.addDuration, &lamp.color, &lamp.option, sizeof(char)); lampProgram.push_back(lamp); } diff --git a/src/source/main.cpp b/src/source/main.cpp index ca6fef1..22312a6 100644 --- a/src/source/main.cpp +++ b/src/source/main.cpp @@ -341,8 +341,8 @@ int main() FILE* tfp = NULL; fopen_s(&tfp, "testchart.txt", "rt"); fscanf_s(tfp, "%d", &testChartSongID); - fscanf_s(tfp, " %c", &tempch[0]); - fscanf_s(tfp, "%c", &tempch[1]); + fscanf_s(tfp, " %c", &tempch[0], sizeof(char)); + fscanf_s(tfp, "%c", &tempch[1], sizeof(char)); fclose(tfp); if ( tempch[1] == 'm' )