From 85285d447882117ea1227cb9319df67bce34c982 Mon Sep 17 00:00:00 2001 From: onbcode Date: Tue, 9 Apr 2024 15:51:13 -0300 Subject: [PATCH] Remaining minimal changes required to compile --- code/TabCompetition.h | 2 +- code/TabTeam.cpp | 6 ++++-- code/iof30interface.cpp | 4 ++-- code/listeditor.h | 2 +- code/oEvent.h | 2 +- code/oListInfo.cpp | 2 +- code/zip.cpp | 20 ++++++++++++++------ 7 files changed, 24 insertions(+), 14 deletions(-) diff --git a/code/TabCompetition.h b/code/TabCompetition.h index ff03ebe..0d54e53 100644 --- a/code/TabCompetition.h +++ b/code/TabCompetition.h @@ -134,7 +134,7 @@ class TabCompetition : void selectExportSplitOptions(gdioutput &gdi); void showSelectId(std::pair& priSecondId, gdioutput& gdi); - pair TabCompetition::getPreferredIdTypes(gdioutput& gdi); + pair getPreferredIdTypes(gdioutput& gdi); void saveExtraFields(gdioutput& gdi, oEvent::ExtraFieldContext type); diff --git a/code/TabTeam.cpp b/code/TabTeam.cpp index f2055b1..e033015 100644 --- a/code/TabTeam.cpp +++ b/code/TabTeam.cpp @@ -169,7 +169,8 @@ int TabTeam::searchCB(gdioutput &gdi, int type, void *data) { void TabTeam::selectTeam(gdioutput &gdi, pTeam t) { - if (gdioutput* gdi_comments = getExtraWindow("comments", false); gdi_comments) + gdioutput* gdi_comments = getExtraWindow("comments", false); + if ( gdi_comments) gdi_comments->closeWindow(); if (t){ @@ -1259,7 +1260,8 @@ int TabTeam::teamCB(gdioutput &gdi, GuiEventType type, BaseInfo* data) { if (teamId>0) save(gdi, true); - if (gdioutput* gdi_settings = getExtraWindow("comments", false); gdi_settings) + gdioutput* gdi_settings = getExtraWindow("comments", false); + if ( gdi_settings) gdi_settings->closeWindow(); return true; diff --git a/code/iof30interface.cpp b/code/iof30interface.cpp index 4c4bf70..08dbe2d 100644 --- a/code/iof30interface.cpp +++ b/code/iof30interface.cpp @@ -1075,7 +1075,7 @@ void IOF30Interface::readEntryList(gdioutput &gdi, xmlobject &xo, bool removeNon for (int leg = 0; leg < allT[k]->getNumRunners(); leg++) { pRunner r = allT[k]->getRunner(leg); if (r && r->getCourseId() > 0) { - pair key(allT[k]->getId(), leg); + pair key(allT[k]->getId(), leg); teamLegToFixedCourse[key] = r->getCourseId(); } } @@ -1344,7 +1344,7 @@ void IOF30Interface::readEntryList(gdioutput &gdi, xmlobject &xo, bool removeNon for (int leg = 0; leg < allT[k]->getNumRunners(); leg++) { pRunner r = allT[k]->getRunner(leg); if (r) { - pair key(allT[k]->getId(), leg); + pair key(allT[k]->getId(), leg); auto res = teamLegToFixedCourse.find(key); if (res == teamLegToFixedCourse.end()) { r->setCourseId(0); diff --git a/code/listeditor.h b/code/listeditor.h index 2fc4c87..6901767 100644 --- a/code/listeditor.h +++ b/code/listeditor.h @@ -65,7 +65,7 @@ private: int lineIx, int ix) const; - void ListEditor::editDlgStart(gdioutput& gdi, int id, const char* title, int& x1, int& y1, int& boxY); + void editDlgStart(gdioutput& gdi, int id, const char* title, int& x1, int& y1, int& boxY); void editListPost(gdioutput &gdi, const MetaListPost &mlp, int id); void editImage(gdioutput& gdi, const MetaListPost& mlp, int id); diff --git a/code/oEvent.h b/code/oEvent.h index 5633481..98d239f 100644 --- a/code/oEvent.h +++ b/code/oEvent.h @@ -1433,7 +1433,7 @@ public: /** Do some operation and disable (global) reevaluate/update */ template - void noReevaluateOperation(OP& operation) { + void noReevaluateOperation(const OP& operation) { bool origState = disableRecalculate; disableRecalculate = true; try { diff --git a/code/oListInfo.cpp b/code/oListInfo.cpp index aba9074..0e675a5 100644 --- a/code/oListInfo.cpp +++ b/code/oListInfo.cpp @@ -5263,7 +5263,7 @@ void oListInfo::setupLinks() const { void oListInfo::shrinkSize() { - auto& scale = [](int& format) -> double { + auto scale = [](int& format) -> double { int highFormat = format & ~0xFF; format &= 0xFF; diff --git a/code/zip.cpp b/code/zip.cpp index c57a284..8c11377 100644 --- a/code/zip.cpp +++ b/code/zip.cpp @@ -147,7 +147,9 @@ wstring do_extract_currentfile(unzFile uf, const wstring &baseDir, const char* p if (err!=UNZ_OK) throw std::exception(zipError); - fout = fopen64(write_filename.c_str(),L"wb"); + //fout = fopen64(write_filename.c_str(),L"wb"); + // fopen64 maps to fopen (const char parameters); need to be _wfopen (const wchars) + errno_t err = _wfopen_s(&fout, write_filename.c_str(), L"wb"); // some zipfile doesn't contain directory alone before file if ((fout==NULL) && createSubdir && @@ -156,7 +158,8 @@ wstring do_extract_currentfile(unzFile uf, const wstring &baseDir, const char* p *(filename_withoutpath-1)='\0'; makedir(write_filename.c_str()); *(filename_withoutpath-1)=c; - fout=fopen64(write_filename.c_str(),L"wb"); + //fout=fopen64(write_filename.c_str(),L"wb"); + err = _wfopen_s(&fout, write_filename.c_str(), L"wb"); } if (fout==NULL) { @@ -273,7 +276,9 @@ int check_exist_file(const wchar_t* filename) { FILE* ftestexist; int ret = 1; - ftestexist = fopen64(filename,L"rb"); + //ftestexist = fopen64(filename,L"rb"); + errno_t err = _wfopen_s(&ftestexist, filename, L"rb"); + if (ftestexist==NULL) ret = 0; else @@ -324,7 +329,9 @@ int isLargeFile(const wchar_t* filename) { int largeFile = 0; ZPOS64_T pos = 0; - FILE* pFile = fopen64(filename, L"rb"); + //FILE* pFile = fopen64(filename, L"rb"); + FILE* pFile = NULL; + errno_t err = _wfopen_s(&pFile, filename, L"rb"); if (pFile != NULL) { fseeko64(pFile, 0, SEEK_END); @@ -423,8 +430,9 @@ int zip(const wchar_t *zipfilename, const char *password, const vector throw meosException(eb); } else { - fin = fopen64(wfn.c_str(),L"rb"); - if (fin==NULL) { + //fin = fopen64(wfn.c_str(),L"rb"); + errno_t err = _wfopen_s(&fin, wfn.c_str(), L"rb"); + if (fin==NULL) { swprintf_s(eb, L"Error opening %s for reading",filenameinzip); throw meosException(eb); }