Skip to content

Commit

Permalink
A few more POSIX -> ISO C++ names (prepending underscore).
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlin-mike authored and Xottab-DUTY committed Aug 5, 2017
1 parent 6e27c40 commit 563c5a4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/xrCore/Animation/Motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ bool CSMotion::Load(IReader& F)
string64 temp_buf;
for (BoneMotionIt bm_it = bone_mots.begin(); bm_it != bone_mots.end(); bm_it++)
{
bm_it->SetName(itoa(int(bm_it - bone_mots.begin()), temp_buf, 10));
bm_it->SetName(_itoa(int(bm_it - bone_mots.begin()), temp_buf, 10));
bm_it->m_Flags.assign((u8)F.r_u32());
for (int ch = 0; ch < ctMaxChannel; ch++)
{
Expand Down
6 changes: 3 additions & 3 deletions src/xrCore/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void FileCompress(const char* fn, const char* sign, void* data, u32 size)
MARK M;
mk_mark(M, sign);

int H = open(fn, O_BINARY | O_CREAT | O_WRONLY | O_TRUNC, S_IREAD | S_IWRITE);
int H = _open(fn, O_BINARY | O_CREAT | O_WRONLY | O_TRUNC, S_IREAD | S_IWRITE);
R_ASSERT2(H > 0, fn);
_write(H, &M, 8);
_writeLZ(H, data, size);
Expand All @@ -169,7 +169,7 @@ void* FileDecompress(const char* fn, const char* sign, u32* size)
MARK M, F;
mk_mark(M, sign);

int H = open(fn, O_BINARY | O_RDONLY);
int H = _open(fn, O_BINARY | O_RDONLY);
R_ASSERT2(H > 0, fn);
_read(H, &F, 8);
if (strncmp(M, F, 8) != 0)
Expand All @@ -181,7 +181,7 @@ void* FileDecompress(const char* fn, const char* sign, u32* size)

void* ptr = 0;
u32 SZ;
SZ = _readLZ(H, ptr, filelength(H) - 8);
SZ = _readLZ(H, ptr, _filelength(H) - 8);
_close(H);
if (size)
*size = SZ;
Expand Down
10 changes: 5 additions & 5 deletions src/xrCore/LocatorAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void CLocatorAPI::LoadArchive(archive& A, LPCSTR entrypoint)
if (A.header)
{
shared_str read_path = A.header->r_string("header", "entry_point");
if (0 == stricmp(read_path.c_str(), "gamedata"))
if (0 == _stricmp(read_path.c_str(), "gamedata"))
{
read_path = "$fs_root$";
PathPairIt P = pathes.find(read_path.c_str());
Expand Down Expand Up @@ -1445,7 +1445,7 @@ BOOL CLocatorAPI::dir_delete(LPCSTR initial, LPCSTR nm, BOOL remove_files)
// const char* entry_begin = entry.name+base_len;
if (!remove_files)
return FALSE;
unlink(entry.name);
_unlink(entry.name);
m_files.erase(cur_item);
}
else
Expand Down Expand Up @@ -1480,7 +1480,7 @@ void CLocatorAPI::file_delete(LPCSTR path, LPCSTR nm)
if (I != m_files.end())
{
// remove file
unlink(I->name);
_unlink(I->name);
char* str = LPSTR(I->name);
xr_free(str);
m_files.erase(I);
Expand Down Expand Up @@ -1515,7 +1515,7 @@ void CLocatorAPI::file_rename(LPCSTR src, LPCSTR dest, bool bOwerwrite)
{
if (!bOwerwrite)
return;
unlink(D->name);
_unlink(D->name);
char* str = LPSTR(D->name);
xr_free(str);
m_files.erase(D);
Expand Down Expand Up @@ -1691,7 +1691,7 @@ BOOL CLocatorAPI::can_write_to_folder(LPCSTR path)
else
{
fclose(hf);
unlink(temp);
_unlink(temp);
return TRUE;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrCore/Xr_ini.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ int CInifile::r_token(LPCSTR S, LPCSTR L, const xr_token* token_list) const
{
LPCSTR C = r_string(S, L);
for (int i = 0; token_list[i].name; i++)
if (!stricmp(C, token_list[i].name))
if (!_stricmp(C, token_list[i].name))
return token_list[i].id;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrCore/xr_trims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ LPSTR _GetItems(LPCSTR src, int idx_start, int idx_end, LPSTR dst, char separato
u32 _ParseItem(LPCSTR src, xr_token* token_list)
{
for (int i = 0; token_list[i].name; i++)
if (!stricmp(src, token_list[i].name))
if (!_stricmp(src, token_list[i].name))
return token_list[i].id;
return u32(-1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/xrCore/xrstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct str_container_impl
u32 crc = crc32(value->value, value->dwLength);
string32 crc_str;
R_ASSERT3(crc == value->dwCRC, "CorePanic: read-only memory corruption (shared_strings)",
itoa(value->dwCRC, crc_str, 16));
_itoa(value->dwCRC, crc_str, 16));
R_ASSERT3(value->dwLength == xr_strlen(value->value),
"CorePanic: read-only memory corruption (shared_strings, internal structures)", value->value);
value = value->next;
Expand Down Expand Up @@ -392,8 +392,8 @@ void str_container::verify()
str_value* sv = *it;
u32 crc = crc32(sv->value, sv->dwLength);
string32 crc_str;
R_ASSERT3(
crc == sv->dwCRC, "CorePanic: read-only memory corruption (shared_strings)", itoa(sv->dwCRC, crc_str, 16));
R_ASSERT3(crc == sv->dwCRC,
"CorePanic: read-only memory corruption (shared_strings)", _itoa(sv->dwCRC, crc_str, 16));
R_ASSERT3(sv->dwLength == xr_strlen(sv->value),
"CorePanic: read-only memory corruption (shared_strings, internal structures)", sv->value);
}
Expand Down

0 comments on commit 563c5a4

Please sign in to comment.