more adaption for x64

This commit is contained in:
Zero Fanker 2024-04-11 19:51:38 -04:00
parent 3e334ca731
commit 9235ac60c1
16 changed files with 214 additions and 234 deletions

View file

@ -217,9 +217,9 @@ BOOL CIniFile::SaveFile(const std::string& Filename) const
}
int CIniFileSection::FindValue(CString val) const noexcept
int64_t CIniFileSection::FindValue(CString val) const noexcept
{
for (auto idx = 0;
for (size_t idx = 0;
idx < this->value_pairs.size();
++idx) {
if (this->value_pairs[idx].second == val) {
@ -229,7 +229,7 @@ int CIniFileSection::FindValue(CString val) const noexcept
return -1;
}
int CIniFileSection::FindIndex(const CString& key) const noexcept
int64_t CIniFileSection::FindIndex(const CString& key) const noexcept
{
auto const it = this->value_pos.find(key);
if (it != this->value_pos.end()) {

View file

@ -67,8 +67,8 @@ public:
ASSERT(index < value_pairs.size());
return this->value_pairs[index];
}
int FindIndex(const CString& key) const noexcept;
int FindValue(CString val) const noexcept;
int64_t FindIndex(const CString& key) const noexcept;
int64_t FindValue(CString val) const noexcept;
const CString& operator[](const CString& key) const {
return this->GetString(key);
@ -203,7 +203,7 @@ public:
}
private:
map<CString, int, SortDummy> value_pos{};
map<CString, int64_t, SortDummy> value_pos{};
vector<std::pair<CString, CString>> value_pairs{};// sequenced
mutable bool isRegistry{false};
};

View file

@ -44,10 +44,11 @@ CString InputBox(const char* Sentence, const char* Caption)
CInputBox inp;
inp.SetCaption(Caption);
inp.SetSentence(Sentence);
char* res=(char*) inp.DoModal();
CString cstr=res;
return cstr;
if (inp.DoModal()) {
return inp.GetResult();
}
return "";
}
CInputBox::CInputBox(CWnd* pParent /*=NULL*/)
@ -75,22 +76,22 @@ END_MESSAGE_MAP()
void CInputBox::OnOK()
void CInputBox::OnOK()
{
CString text;
GetDlgItem(IDC_VAL)->GetWindowText(text);
if(text.GetLength()==0){EndDialog(NULL);};
if (text.GetLength() == 0)
EndDialog(false);
char* str;
str=new(char[text.GetLength()]);
strcpy(str, (LPCTSTR)text);
EndDialog((int)str);
m_Result = text;
EndDialog(true);
}
void CInputBox::OnCancel()
{
EndDialog(NULL);
EndDialog(false);
}
void CInputBox::SetCaption(CString Caption)

View file

@ -47,7 +47,7 @@ public:
enum { IDD = IDD_INPUTBOX };
//}}AFX_DATA
const CString& GetResult() const { return m_Result; }
// Überschreibungen
// Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen
//{{AFX_VIRTUAL(CInputBox)
@ -68,6 +68,7 @@ protected:
private:
CString m_Text;
CString m_Caption;
CString m_Result;
};
//{{AFX_INSERT_LOCATION}}

View file

@ -278,7 +278,9 @@ void CMapData::CalcMapRect()
m_maprect.right = atoi(custr);
cucomma = strchr(&msize[cupos], ','); // we check again... could be there is a new ini format
if (cucomma == NULL) cucomma = (char*)((int)msize + strlen(msize));
if (cucomma == NULL) {
cucomma = msize + strlen(msize);
}
memcpy_s(custr, custr_size, &msize[cupos], (cucomma - msize) - cupos + 1);
custr[((cucomma - msize)) - cupos] = 0;
cupos = cucomma - msize + 1;
@ -321,7 +323,9 @@ void CMapData::CalcMapRect()
cucomma = strchr(&msize[cupos], ','); // we check again... could be there is a new ini format
if (cucomma == NULL) cucomma = (char*)((int)msize + strlen(msize));
if (cucomma == NULL) {
cucomma = msize + strlen(msize);
}
memcpy_s(custr, custr_size, &msize[cupos], (cucomma - msize) - cupos + 1);
custr[((cucomma - msize)) - cupos] = 0;
cupos = cucomma - msize + 1;
@ -1092,7 +1096,7 @@ void CMapData::Pack(BOOL bCreatePreview, BOOL bCompression)
BYTE* hexpacked = NULL; // must be freed!
errstream << "Values allocated. Pointer: " << (int)values << endl;
errstream << "Values allocated. Pointer: " << std::hex << values << endl;
errstream.flush();

View file

@ -4,7 +4,7 @@
<Import Project="$(MSBuildThisFileDirectory)/Common.props" />
</ImportGroup>
<PropertyGroup>
<XccVcpkgDirTriplet>$(XccDir)\vcpkg_installed\x86-windows\x86-windows</XccVcpkgDirTriplet>
<XccVcpkgDirTriplet>$(XccDir)\vcpkg_installed\$(Platform)-windows\$(Platform)-windows</XccVcpkgDirTriplet>
<XccVcpkgDir>$(XccVcpkgDirTriplet)\debug</XccVcpkgDir>
</PropertyGroup>
<PropertyGroup Label="UserMacros" />

View file

@ -4,7 +4,7 @@
<Import Project="$(MSBuildThisFileDirectory)/Common.props" />
</ImportGroup>
<PropertyGroup>
<XccVcpkgDirTriplet>$(XccDir)\vcpkg_installed\x86-windows\x86-windows</XccVcpkgDirTriplet>
<XccVcpkgDirTriplet>$(XccDir)\vcpkg_installed\$(Platform)-windows\$(Platform)-windows</XccVcpkgDirTriplet>
<XccVcpkgDir>$(XccVcpkgDirTriplet)</XccVcpkgDir>
</PropertyGroup>
<PropertyGroup Label="UserMacros" />