Browse Source

Replace MemSet with memset.

Darryl Pogue 13 years ago committed by Adam Johnson
parent
commit
f4ff65ccbc
  1. 4
      Sources/Plasma/Apps/plClient/winmain.cpp
  2. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp
  3. 2
      Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp
  4. 4
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
  5. 2
      Sources/Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp
  6. 2
      Sources/Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp
  7. 4
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h
  8. 4
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp

4
Sources/Plasma/Apps/plClient/winmain.cpp

@ -1218,7 +1218,7 @@ BOOL CALLBACK UruLoginDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SaveUserPass (pLoginParam, password);
MemSet(&pLoginParam->authError, 0, sizeof(pLoginParam->authError));
memset(&pLoginParam->authError, 0, sizeof(pLoginParam->authError));
bool cancelled = AuthenticateNetClientComm(&pLoginParam->authError, hwndDlg);
if (IS_NET_SUCCESS(pLoginParam->authError) && !cancelled)
@ -1547,7 +1547,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
bool needExit = false;
LoginDialogParam loginParam;
MemSet(&loginParam, 0, sizeof(loginParam));
memset(&loginParam, 0, sizeof(loginParam));
LoadUserPass(&loginParam);
if (!doIntroDialogs && loginParam.remember) {

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp

@ -1928,7 +1928,7 @@ void pfGUIMultiLineEditCtrl::DeleteLinesFromTop(int numLines)
uint32_t newBufferStart = curChar + 1; // +1 so we eat the newline as well
uint32_t newBufferLen = bufferLen - newBufferStart;
MemCopy(buffer, buffer + newBufferStart, newBufferLen * sizeof(uint16_t)); // copy all bytes after the newline to the beginning
MemSet(buffer + newBufferLen, 0, (bufferLen - newBufferLen) * sizeof(uint16_t)); // fill out the rest of the buffer with null chars
memset(buffer + newBufferLen, 0, (bufferLen - newBufferLen) * sizeof(uint16_t)); // fill out the rest of the buffer with null chars
bufferLen = newBufferLen;
break;
}

2
Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp

@ -116,7 +116,7 @@ ITicTacToe::ITicTacToe (pfGmTicTacToe * gameCli)
: gameCli(gameCli)
{
// Fill the board with space chars
MemSet(board, ' ', sizeof(board));
memset(board, ' ', sizeof(board));
}
//============================================================================

4
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp

@ -679,10 +679,10 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSendFriendInvite, args, "Params: emailAddress,
}
wchar_t emailAddr[kMaxEmailAddressLength];
MemSet(emailAddr, 0, sizeof(emailAddr));
memset(emailAddr, 0, sizeof(emailAddr));
wchar_t toName[kMaxPlayerNameLength];
MemSet(toName, 0, sizeof(toName));
memset(toName, 0, sizeof(toName));
// Check and see if the email address is ok
int origStrLen = 0;

2
Sources/Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp

@ -190,7 +190,7 @@ void IcmpStartup () {
IcmpCreateFile = (FIcmpCreateFile)GetProcAddress(g_lib, "IcmpCreateFile");
IcmpSendEcho = (FIcmpSendEcho)GetProcAddress(g_lib, "IcmpSendEcho");
}
MemSet(s_payload, (uint8_t)((uintptr_t)&s_payload >> 4), arrsize(s_payload));
memset(s_payload, (uint8_t)((uintptr_t)&s_payload >> 4), arrsize(s_payload));
}
//============================================================================

2
Sources/Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp

@ -605,7 +605,7 @@ static void StartAuthTcpTest (
void * param
) {
if (0 == AtomicSet(&s_authProtocolRegistered, 1)) {
MemSet(
memset(
s_payload,
(uint8_t)((uintptr_t)&s_payload >> 4),
sizeof(s_payload)

4
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h

@ -217,7 +217,7 @@ T * TBuffer<T>::Detach () {
template<class T>
void TBuffer<T>::Fill (uint8_t value) {
if (m_data)
MemSet(m_data, value, Bytes());
memset(m_data, value, Bytes());
}
//===========================================================================
@ -610,7 +610,7 @@ T * TFArray<T,C>::Detach () {
template<class T, class C>
void TFArray<T,C>::Fill (uint8_t value) {
C::Destruct(m_data, m_count);
MemSet(m_data, value, m_count * sizeof(T));
memset(m_data, value, m_count * sizeof(T));
C::Construct(m_data, m_count);
}

4
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp

@ -81,7 +81,7 @@ void * CBaseSpareList::Alloc (unsigned objectSize, const char typeName[]) {
// initialize memory to a freaky value in debug mode
#ifdef HS_DEBUGGING
MemSet(object, (uint8_t) ((unsigned) object >> 4), objectSize);
memset(object, (uint8_t) ((unsigned) object >> 4), objectSize);
#endif
return object;
@ -91,7 +91,7 @@ void * CBaseSpareList::Alloc (unsigned objectSize, const char typeName[]) {
void CBaseSpareList::Free (void * object, unsigned objectSize) {
// initialize memory to a freaky value in debug mode
#ifdef HS_DEBUGGING
MemSet(object, (uint8_t) ((unsigned) object >> 4), objectSize);
memset(object, (uint8_t) ((unsigned) object >> 4), objectSize);
#endif
// link memory block onto head of spare list

Loading…
Cancel
Save