Change ZeroMemory to memset

This commit is contained in:
OV2 2012-01-23 18:12:47 +01:00
parent dce8f6a1ff
commit faee2859b5
16 changed files with 132 additions and 133 deletions

View File

@ -368,7 +368,7 @@ bool8 S9xSaveCheatFile (const char *filename)
for (uint32 i = 0; i < Cheat.num_cheats; i++)
{
ZeroMemory(data, 28);
memset(data, 0, 28);
if (i == 0)
{

View File

@ -427,7 +427,7 @@ string ConfigFile::GetString(const char *key, string def){
char *ConfigFile::GetString(const char *key, char *out, uint32 outlen){
if(!Exists(key)) return NULL;
ZeroMemory(out, outlen);
memset(out, 0, outlen);
string o=Get(key);
if(outlen>0){
outlen--;

View File

@ -624,7 +624,7 @@ void S9xUnmapAllControls (void)
if (!(superscope.crosshair.set & 4))
superscope.crosshair.bg = 1;
ZeroMemory(pseudobuttons, sizeof(pseudobuttons));
memset(pseudobuttons, 0, sizeof(pseudobuttons));
turbo_time = 1;
}
@ -1241,7 +1241,7 @@ s9xcommand_t S9xGetCommandT (const char *name)
int i, j;
const char *s;
ZeroMemory(&cmd, sizeof(cmd));
memset(&cmd, 0, sizeof(cmd));
cmd.type = S9xBadMapping;
cmd.multi_press = 0;
cmd.button_norpt = 0;
@ -3450,7 +3450,7 @@ void S9xGetControllerCrosshair (enum crosscontrols ctl, int8 *idx, const char **
void S9xControlPreSaveState (struct SControlSnapshot *s)
{
ZeroMemory(s, sizeof(*s));
memset(s, 0, sizeof(*s));
s->ver = 3;
for (int j = 0; j < 2; j++)

View File

@ -274,7 +274,7 @@ void S9xReset (void)
memset(Memory.RAM, 0x55, 0x20000);
memset(Memory.VRAM, 0x00, 0x10000);
ZeroMemory(Memory.FillRAM, 0x8000);
memset(Memory.FillRAM, 0, 0x8000);
if (Settings.BS)
S9xResetBSX();
@ -308,7 +308,7 @@ void S9xSoftReset (void)
{
S9xResetSaveTimer(FALSE);
ZeroMemory(Memory.FillRAM, 0x8000);
memset(Memory.FillRAM, 0, 0x8000);
if (Settings.BS)
S9xResetBSX();

14
gfx.cpp
View File

@ -216,7 +216,7 @@ static uint16 get_crosshair_color (uint8);
bool8 S9xGraphicsInit (void)
{
S9xInitTileRenderer();
ZeroMemory(BlackColourMap, 256 * sizeof(uint16));
memset(BlackColourMap, 0, 256 * sizeof(uint16));
#ifdef GFX_MULTI_FORMAT
if (GFX.BuildPixel == NULL)
@ -246,7 +246,7 @@ bool8 S9xGraphicsInit (void)
}
// Lookup table for color addition
ZeroMemory(GFX.X2, 0x10000 * sizeof(uint16));
memset(GFX.X2, 0, 0x10000 * sizeof(uint16));
for (uint32 r = 0; r <= MAX_RED; r++)
{
uint32 r2 = r << 1;
@ -272,7 +272,7 @@ bool8 S9xGraphicsInit (void)
}
// Lookup table for 1/2 color subtraction
ZeroMemory(GFX.ZERO, 0x10000 * sizeof(uint16));
memset(GFX.ZERO, 0, 0x10000 * sizeof(uint16));
for (uint32 r = 0; r <= MAX_RED; r++)
{
uint32 r2 = r;
@ -387,8 +387,8 @@ void S9xStartScreenRefresh (void)
PPU.RecomputeClipWindows = TRUE;
IPPU.PreviousLine = IPPU.CurrentLine = 0;
ZeroMemory(GFX.ZBuffer, GFX.ScreenSize);
ZeroMemory(GFX.SubZBuffer, GFX.ScreenSize);
memset(GFX.ZBuffer, 0, GFX.ScreenSize);
memset(GFX.SubZBuffer, 0, GFX.ScreenSize);
}
if (++IPPU.FrameCount % Memory.ROMFramesPerSecond == 0)
@ -810,7 +810,7 @@ static void SetupOBJ (void)
if (!PPU.OAMPriorityRotation || !(PPU.OAMFlip & PPU.OAMAddr & 1)) // normal case
{
uint8 LineOBJ[SNES_HEIGHT_EXTENDED];
ZeroMemory(LineOBJ, sizeof(LineOBJ));
memset(LineOBJ, 0, sizeof(LineOBJ));
for (int i = 0; i < SNES_HEIGHT_EXTENDED; i++)
{
@ -887,7 +887,7 @@ static void SetupOBJ (void)
{
// First, find out which sprites are on which lines
uint8 OBJOnLine[SNES_HEIGHT_EXTENDED][128];
ZeroMemory(OBJOnLine, sizeof(OBJOnLine));
memset(OBJOnLine, 0, sizeof(OBJOnLine));
for (S = 0; S < 128; S++)
{

View File

@ -424,7 +424,7 @@ s9xcommand_t S9xGetPortCommandT (const char *name)
{
s9xcommand_t cmd;
ZeroMemory(&cmd, sizeof(cmd));
memset(&cmd, 0, sizeof(cmd));
cmd.type = S9xBadMapping;
return (cmd);

View File

@ -1101,26 +1101,26 @@ bool8 CMemory::Init (void)
return (FALSE);
}
ZeroMemory(RAM, 0x20000);
ZeroMemory(SRAM, 0x20000);
ZeroMemory(VRAM, 0x10000);
ZeroMemory(ROM, MAX_ROM_SIZE + 0x200 + 0x8000);
memset(RAM, 0, 0x20000);
memset(SRAM, 0, 0x20000);
memset(VRAM, 0, 0x10000);
memset(ROM, 0, MAX_ROM_SIZE + 0x200 + 0x8000);
ZeroMemory(IPPU.TileCache[TILE_2BIT], MAX_2BIT_TILES * 64);
ZeroMemory(IPPU.TileCache[TILE_4BIT], MAX_4BIT_TILES * 64);
ZeroMemory(IPPU.TileCache[TILE_8BIT], MAX_8BIT_TILES * 64);
ZeroMemory(IPPU.TileCache[TILE_2BIT_EVEN], MAX_2BIT_TILES * 64);
ZeroMemory(IPPU.TileCache[TILE_2BIT_ODD], MAX_2BIT_TILES * 64);
ZeroMemory(IPPU.TileCache[TILE_4BIT_EVEN], MAX_4BIT_TILES * 64);
ZeroMemory(IPPU.TileCache[TILE_4BIT_ODD], MAX_4BIT_TILES * 64);
memset(IPPU.TileCache[TILE_2BIT], 0, MAX_2BIT_TILES * 64);
memset(IPPU.TileCache[TILE_4BIT], 0, MAX_4BIT_TILES * 64);
memset(IPPU.TileCache[TILE_8BIT], 0, MAX_8BIT_TILES * 64);
memset(IPPU.TileCache[TILE_2BIT_EVEN], 0, MAX_2BIT_TILES * 64);
memset(IPPU.TileCache[TILE_2BIT_ODD], 0, MAX_2BIT_TILES * 64);
memset(IPPU.TileCache[TILE_4BIT_EVEN], 0, MAX_4BIT_TILES * 64);
memset(IPPU.TileCache[TILE_4BIT_ODD], 0, MAX_4BIT_TILES * 64);
ZeroMemory(IPPU.TileCached[TILE_2BIT], MAX_2BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_4BIT], MAX_4BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_8BIT], MAX_8BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_2BIT_EVEN], MAX_2BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_2BIT_ODD], MAX_2BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_4BIT_EVEN], MAX_4BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_4BIT_ODD], MAX_4BIT_TILES);
memset(IPPU.TileCached[TILE_2BIT], 0, MAX_2BIT_TILES);
memset(IPPU.TileCached[TILE_4BIT], 0, MAX_4BIT_TILES);
memset(IPPU.TileCached[TILE_8BIT], 0, MAX_8BIT_TILES);
memset(IPPU.TileCached[TILE_2BIT_EVEN], 0, MAX_2BIT_TILES);
memset(IPPU.TileCached[TILE_2BIT_ODD], 0, MAX_2BIT_TILES);
memset(IPPU.TileCached[TILE_4BIT_EVEN], 0, MAX_4BIT_TILES);
memset(IPPU.TileCached[TILE_4BIT_ODD], 0, MAX_4BIT_TILES);
// FillRAM uses first 32K of ROM image area, otherwise space just
// wasted. Might be read by the SuperFX code.
@ -1518,8 +1518,8 @@ bool8 CMemory::LoadROM (const char *filename)
if (!filename || !*filename)
return (FALSE);
ZeroMemory(ROM, MAX_ROM_SIZE);
ZeroMemory(&Multi, sizeof(Multi));
memset(ROM, 0, MAX_ROM_SIZE);
memset(&Multi, 0, sizeof(Multi));
again:
Settings.DisplayColor = BUILD_PIXEL(31, 31, 31);
@ -1732,7 +1732,7 @@ again:
LastRomFilename[PATH_MAX] = 0;
}
ZeroMemory(&SNESGameFixes, sizeof(SNESGameFixes));
memset(&SNESGameFixes, 0, sizeof(SNESGameFixes));
SNESGameFixes.SRAMInitialValue = 0x60;
S9xLoadCheatFile(S9xGetFilename(".cht", CHEAT_DIR));
@ -1751,8 +1751,8 @@ bool8 CMemory::LoadMultiCart (const char *cartA, const char *cartB)
{
bool8 r = TRUE;
ZeroMemory(ROM, MAX_ROM_SIZE);
ZeroMemory(&Multi, sizeof(Multi));
memset(ROM, 0, MAX_ROM_SIZE);
memset(&Multi, 0, sizeof(Multi));
Settings.DisplayColor = BUILD_PIXEL(31, 31, 31);
SET_UI_COLOR(255, 255, 255);
@ -1809,11 +1809,11 @@ bool8 CMemory::LoadMultiCart (const char *cartA, const char *cartB)
if (!r)
{
ZeroMemory(&Multi, sizeof(Multi));
memset(&Multi, 0, sizeof(Multi));
return (FALSE);
}
ZeroMemory(&SNESGameFixes, sizeof(SNESGameFixes));
memset(&SNESGameFixes, 0, sizeof(SNESGameFixes));
SNESGameFixes.SRAMInitialValue = 0x60;
S9xLoadCheatFile(S9xGetFilename(".cht", CHEAT_DIR));

View File

@ -412,14 +412,14 @@ static void reset_controllers (void)
MovieSetJoypad(i, 0);
uint8 clearedMouse[MOUSE_DATA_SIZE];
ZeroMemory(clearedMouse, MOUSE_DATA_SIZE);
memset(clearedMouse, 0, MOUSE_DATA_SIZE);
clearedMouse[4] = 1;
uint8 clearedScope[SCOPE_DATA_SIZE];
ZeroMemory(clearedScope, SCOPE_DATA_SIZE);
memset(clearedScope, 0, SCOPE_DATA_SIZE);
uint8 clearedJustifier[JUSTIFIER_DATA_SIZE];
ZeroMemory(clearedJustifier, JUSTIFIER_DATA_SIZE);
memset(clearedJustifier, 0, JUSTIFIER_DATA_SIZE);
for (int p = 0; p < 2; p++)
{
@ -614,7 +614,7 @@ static void write_movie_header (FILE *fd, SMovie *movie)
{
uint8 buf[SMV_HEADER_SIZE], *ptr = buf;
ZeroMemory(buf, sizeof(buf));
memset(buf, 0, sizeof(buf));
Write32(SMV_MAGIC, ptr);
Write32(SMV_VERSION, ptr);
@ -963,7 +963,7 @@ int S9xMovieGetInfo (const char *filename, struct MovieInfo *info)
flush_movie();
ZeroMemory(info, sizeof(*info));
memset(info, 0, sizeof(*info));
if (!(fd = fopen(filename, "rb")))
return (FILE_NOT_FOUND);
@ -1092,7 +1092,7 @@ void S9xMovieUpdateOnReset (void)
void S9xMovieInit (void)
{
ZeroMemory(&Movie, sizeof(Movie));
memset(&Movie, 0, sizeof(Movie));
Movie.State = MOVIE_STATE_NONE;
}

1
port.h
View File

@ -296,7 +296,6 @@ typedef unsigned long long uint64;
#endif
#ifndef __WIN32__
#define ZeroMemory(a, b) memset((a), 0, (b))
void _splitpath (const char *, char *, char *, char *, char *);
void _makepath (char *, const char *, const char *, const char *, const char *);
#define S9xDisplayString DisplayStringFromBottom

24
ppu.cpp
View File

@ -1872,7 +1872,7 @@ void S9xSoftResetPPU (void)
PPU.OAMReadFlip = 0;
PPU.OAMTileAddress = 0;
PPU.OAMWriteRegister = 0;
ZeroMemory(PPU.OAMData, 512 + 32);
memset(PPU.OAMData, 0, 512 + 32);
PPU.FirstSprite = 0;
PPU.LastSprite = 127;
@ -1947,13 +1947,13 @@ void S9xSoftResetPPU (void)
IPPU.ColorsChanged = TRUE;
IPPU.OBJChanged = TRUE;
IPPU.DirectColourMapsNeedRebuild = TRUE;
ZeroMemory(IPPU.TileCached[TILE_2BIT], MAX_2BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_4BIT], MAX_4BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_8BIT], MAX_8BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_2BIT_EVEN], MAX_2BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_2BIT_ODD], MAX_2BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_4BIT_EVEN], MAX_4BIT_TILES);
ZeroMemory(IPPU.TileCached[TILE_4BIT_ODD], MAX_4BIT_TILES);
memset(IPPU.TileCached[TILE_2BIT], 0, MAX_2BIT_TILES);
memset(IPPU.TileCached[TILE_4BIT], 0, MAX_4BIT_TILES);
memset(IPPU.TileCached[TILE_8BIT], 0, MAX_8BIT_TILES);
memset(IPPU.TileCached[TILE_2BIT_EVEN], 0, MAX_2BIT_TILES);
memset(IPPU.TileCached[TILE_2BIT_ODD], 0, MAX_2BIT_TILES);
memset(IPPU.TileCached[TILE_4BIT_EVEN], 0, MAX_4BIT_TILES);
memset(IPPU.TileCached[TILE_4BIT_ODD], 0, MAX_4BIT_TILES);
IPPU.VRAMReadBuffer = 0; // XXX: FIXME: anything better?
IPPU.Interlace = FALSE;
IPPU.InterlaceOBJ = FALSE;
@ -1978,11 +1978,11 @@ void S9xSoftResetPPU (void)
for (int c = 0; c < 0x8000; c += 0x100)
memset(&Memory.FillRAM[c], c >> 8, 0x100);
ZeroMemory(&Memory.FillRAM[0x2100], 0x100);
ZeroMemory(&Memory.FillRAM[0x4200], 0x100);
ZeroMemory(&Memory.FillRAM[0x4000], 0x100);
memset(&Memory.FillRAM[0x2100], 0, 0x100);
memset(&Memory.FillRAM[0x4200], 0, 0x100);
memset(&Memory.FillRAM[0x4000], 0, 0x100);
// For BS Suttehakkun 2...
ZeroMemory(&Memory.FillRAM[0x1000], 0x1000);
memset(&Memory.FillRAM[0x1000], 0, 0x1000);
Memory.FillRAM[0x4201] = Memory.FillRAM[0x4213] = 0xff;
}

View File

@ -2061,7 +2061,7 @@ static int UnfreezeBlock (STREAM stream, const char *name, uint8 *block, int siz
len = size;
}
ZeroMemory(block, size);
memset(block, 0, size);
if (READ_STREAM(block, len, stream) != len)
{

View File

@ -1555,7 +1555,7 @@ int main (int argc, char **argv)
snprintf(default_dir, PATH_MAX + 1, "%s%s%s", getenv("HOME"), SLASH_STR, ".snes9x");
s9x_base_dir = default_dir;
ZeroMemory(&Settings, sizeof(Settings));
memset(&Settings, 0, sizeof(Settings));
Settings.MouseMaster = TRUE;
Settings.SuperScopeMaster = TRUE;
Settings.JustifierMaster = TRUE;
@ -1594,7 +1594,7 @@ int main (int argc, char **argv)
unixSettings.SoundBufferSize = 100;
unixSettings.SoundFragmentSize = 2048;
ZeroMemory(&so, sizeof(so));
memset(&so, 0, sizeof(so));
CPU.Flags = 0;

View File

@ -262,7 +262,7 @@ bool CDirect3D::Initialize(HWND hWnd)
return false;
}
ZeroMemory(&dPresentParams, sizeof(dPresentParams));
memset(&dPresentParams, 0, sizeof(dPresentParams));
dPresentParams.hDeviceWindow = hWnd;
dPresentParams.Windowed = true;
dPresentParams.BackBufferCount = GUI.DoubleBuffered?2:1;

View File

@ -554,7 +554,7 @@ void CDirectDraw::Render(SSurface Src)
if(!dDinitialized) return;
ZeroMemory(&caps,sizeof(DDSCAPS));
memset(&caps, 0,sizeof(DDSCAPS));
caps.dwCaps = DDSCAPS_BACKBUFFER;
if (lpDDSPrimary2->GetAttachedSurface (&caps, &pDDSurface) != DD_OK ||
@ -676,7 +676,7 @@ void CDirectDraw::Render(SSurface Src)
lpDDSurface2->Unlock (Dst.Surface);
ZeroMemory(&caps,sizeof(DDSCAPS));
memset(&caps, 0,sizeof(DDSCAPS));
caps.dwCaps = DDSCAPS_BACKBUFFER;
if (lpDDSPrimary2->GetAttachedSurface (&caps, &pDDSurface) != DD_OK ||

View File

@ -596,7 +596,7 @@ void COpenGL::EnumModes(std::vector<dMode> *modeVector)
if (!(dd.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) && (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE))
{
DEVMODE dm;
ZeroMemory(&dm, sizeof(dm));
memset(&dm, 0, sizeof(dm));
dm.dmSize = sizeof(dm);
iMode = 0;
while(EnumDisplaySettings(dd.DeviceName,iMode,&dm)) {

View File

@ -1400,7 +1400,7 @@ static bool DoOpenRomDialog(TCHAR filename [_MAX_PATH], bool noCustomDlg = false
strcat0(lpfilterptr, FILE_INFO_ANY_FILE_TYPE);
strcat0(lpfilterptr, TEXT("\0*.*\0\0"));
ZeroMemory((LPVOID)&ofn, sizeof(OPENFILENAME));
memset((LPVOID)&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GUI.hWnd;
ofn.lpstrFilter = lpfilter;
@ -1523,7 +1523,7 @@ LRESULT CALLBACK WinProc(
szFileName[0] = TEXT('\0');
ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) );
memset( (LPVOID)&ofn, 0, sizeof(OPENFILENAME) );
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GUI.hWnd;
ofn.lpstrFilter = FILE_INFO_AVI_FILE_TYPE TEXT("\0*.avi\0") FILE_INFO_ANY_FILE_TYPE TEXT("\0*.*\0\0");
@ -2564,7 +2564,7 @@ LRESULT CALLBACK WinProc(
BOOL WinInit( HINSTANCE hInstance)
{
WNDCLASSEX wndclass;
ZeroMemory(&wndclass, sizeof(wndclass));
memset(&wndclass, 0, sizeof(wndclass));
wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
@ -3568,7 +3568,7 @@ static void CheckMenuStates ()
MENUITEMINFO mii;
unsigned int i;
ZeroMemory( &mii, sizeof( mii));
memset( &mii, 0, sizeof( mii));
mii.cbSize = sizeof( mii);
mii.fMask = MIIM_STATE;
@ -3818,7 +3818,7 @@ static void CheckMenuStates ()
mii.fState = !Settings.StopEmulation ? MFS_ENABLED : MFS_DISABLED;
SetMenuItemInfo (GUI.hMenu, ID_FILE_AVI_RECORDING, FALSE, &mii);
ZeroMemory(&mii, sizeof(mii));
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
@ -4955,7 +4955,7 @@ INT_PTR CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
LPMALLOC lpm=NULL;
LPITEMIDLIST iidl=NULL;
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(BROWSEINFO));
memset(&bi, 0, sizeof(BROWSEINFO));
TCHAR path[MAX_PATH];
_tfullpath(path, paths[which], MAX_PATH);
TCHAR title[]=SETTINGS_TITLE_SELECTFOLDER;
@ -5283,7 +5283,7 @@ void GetPathFromTree( HWND hDlg, UINT tree, TCHAR* selected, HTREEITEM hItem)
TVITEM tv;
TCHAR temp[MAX_PATH];
temp[0]=('\0');
ZeroMemory(&tv, sizeof(TVITEM));
memset(&tv, 0, sizeof(TVITEM));
HTREEITEM hTreeTemp=hItem;
if(tv.iImage==7)
@ -5292,7 +5292,7 @@ void GetPathFromTree( HWND hDlg, UINT tree, TCHAR* selected, HTREEITEM hItem)
tv.hItem=hTreeTemp;
tv.iImage=6;
TreeView_SetItem(GetDlgItem(hDlg, tree),&tv);
ZeroMemory(&tv, sizeof(TVITEM));
memset(&tv, 0, sizeof(TVITEM));
}
tv.mask=TVIF_HANDLE|TVIF_TEXT;
@ -5350,7 +5350,7 @@ void ExpandDir(TCHAR * selected, HTREEITEM hParent, HWND hDlg)
{
TCHAR temp[MAX_PATH];
WIN32_FIND_DATA wfd;
ZeroMemory(&wfd, sizeof(WIN32_FIND_DATA));
memset(&wfd, 0, sizeof(WIN32_FIND_DATA));
lstrcat(selected, TEXT("\\*"));
HANDLE hFind=FindFirstFile(selected,&wfd);
selected[(lstrlen(selected)-1)]=TEXT('\0');
@ -5363,7 +5363,7 @@ void ExpandDir(TCHAR * selected, HTREEITEM hParent, HWND hDlg)
{
//skip these, add the rest.
TV_INSERTSTRUCT tvis;
ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT));
memset(&tvis, 0, sizeof(TV_INSERTSTRUCT));
tvis.hParent=hParent;
tvis.hInsertAfter=TVI_SORT;
tvis.item.mask = TVIF_STATE | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
@ -5381,7 +5381,7 @@ void ExpandDir(TCHAR * selected, HTREEITEM hParent, HWND hDlg)
bool subdir=false;
WIN32_FIND_DATA wfd2;
ZeroMemory(&wfd2, sizeof(WIN32_FIND_DATA));
memset(&wfd2, 0, sizeof(WIN32_FIND_DATA));
HANDLE hFind2=FindFirstFile(temp,&wfd2);
do
{
@ -5398,7 +5398,7 @@ void ExpandDir(TCHAR * selected, HTREEITEM hParent, HWND hDlg)
if(subdir)
{
TV_INSERTSTRUCT tvis;
ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT));
memset(&tvis, 0, sizeof(TV_INSERTSTRUCT));
tvis.hParent=hNewTree;
tvis.hInsertAfter=TVI_SORT;
TreeView_InsertItem(GetDlgItem(hDlg, IDC_ROM_DIR),&tvis);
@ -5426,7 +5426,7 @@ void ListFilesFromFolder(HWND hDlg, RomDataList** prdl)
TCHAR temp[MAX_PATH];
TCHAR selected[MAX_PATH]; // directory path
temp[0]='\0';
ZeroMemory(&tv, sizeof(TVITEM));
memset(&tv, 0, sizeof(TVITEM));
HTREEITEM hTreeItem=TreeView_GetSelection(GetDlgItem(hDlg, IDC_ROM_DIR));
GetPathFromTree(hDlg, IDC_ROM_DIR, selected, hTreeItem);
@ -5438,7 +5438,7 @@ void ListFilesFromFolder(HWND hDlg, RomDataList** prdl)
//Add items here.
WIN32_FIND_DATA wfd;
ZeroMemory(&wfd, sizeof(WIN32_FIND_DATA));
memset(&wfd, 0, sizeof(WIN32_FIND_DATA));
lstrcat(selected, TEXT("\\*"));
@ -5451,7 +5451,7 @@ void ListFilesFromFolder(HWND hDlg, RomDataList** prdl)
if(ExtensionIsValid(wfd.cFileName))
{
RomDataList* newitem=new RomDataList;
ZeroMemory(newitem, sizeof(RomDataList));
memset(newitem, 0, sizeof(RomDataList));
newitem->fname=new TCHAR[1+lstrlen(wfd.cFileName)];
lstrcpy(newitem->fname, wfd.cFileName);
@ -5595,7 +5595,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
RECT listRect;
WNDCLASSEX wcex;
TCHAR tempclassname[]=TEXT("S9xSplitter");
ZeroMemory(&wcex, sizeof(WNDCLASSEX));
memset(&wcex, 0, sizeof(WNDCLASSEX));
wcex.cbSize=sizeof(WNDCLASSEX);
wcex.hInstance=g_hInst;
wcex.lpfnWndProc=DlgChildSplitProc;
@ -5617,7 +5617,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
LVCOLUMN col;
static const LPTSTR temp1 = ROM_COLUMN_FILENAME;
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH;
col.fmt=LVCFMT_LEFT;
col.iOrder=0;
@ -5628,7 +5628,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
ListView_InsertColumn(romList, 0, &col);
static const LPTSTR temp2 = ROM_COLUMN_DESCRIPTION;
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
col.fmt=LVCFMT_LEFT;
col.iOrder=1;
@ -5641,7 +5641,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
static const LPTSTR temp3 = ROM_COLUMN_SIZE;
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
col.fmt=LVCFMT_LEFT;
col.iOrder=2;
@ -5729,7 +5729,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
driveName[2]='\0';
TVINSERTSTRUCT tvis;
ZeroMemory(&tvis, sizeof(TVINSERTSTRUCT));
memset(&tvis, 0, sizeof(TVINSERTSTRUCT));
tvis.hParent=NULL;
tvis.hInsertAfter=TVI_ROOT;
@ -5760,7 +5760,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
if(driveType==DRIVE_REMOVABLE || driveType == DRIVE_CDROM || driveType == DRIVE_UNKNOWN)
{
TV_INSERTSTRUCT tvis;
ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT));
memset(&tvis, 0, sizeof(TV_INSERTSTRUCT));
tvis.hParent=hTwee;
tvis.hInsertAfter=TVI_SORT;
TreeView_InsertItem(dirList,&tvis);
@ -5769,7 +5769,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
else
{
WIN32_FIND_DATA wfd2;
ZeroMemory(&wfd2, sizeof(WIN32_FIND_DATA));
memset(&wfd2, 0, sizeof(WIN32_FIND_DATA));
HANDLE hFind2=FindFirstFile(temp,&wfd2);
do
{
@ -5786,7 +5786,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
if(subdir)
{
TV_INSERTSTRUCT tvis;
ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT));
memset(&tvis, 0, sizeof(TV_INSERTSTRUCT));
tvis.hParent=hTwee;
tvis.hInsertAfter=TVI_SORT;
TreeView_InsertItem(dirList,&tvis);
@ -5816,7 +5816,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
temp2 = temp3;
TVITEM tvi;
ZeroMemory(&tvi, sizeof(TVITEM));
memset(&tvi, 0, sizeof(TVITEM));
tvi.mask=TVIF_TEXT;
tvi.pszText=blah;
tvi.cchTextMax=MAX_PATH;
@ -5872,7 +5872,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
if(Memory.ROMFilename[0]!='\0')
{
LVFINDINFO lvfi;
ZeroMemory(&lvfi, sizeof(LVFINDINFO));
memset(&lvfi, 0, sizeof(LVFINDINFO));
TCHAR filename[_MAX_PATH];
TCHAR *tmp, *tmp2;
lstrcpy(filename,_tFromChar(Memory.ROMFilename));
@ -5995,7 +5995,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
case IDOK:
{
LVITEM lvi;
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
//get selections
int list_index = selectionMarkOverride == -1 ? ListView_GetSelectionMark(romList) : selectionMarkOverride;
if(list_index!=-1 && (int)SendMessage(romList, LVM_GETNEXTITEM, (WPARAM)-1, LVNI_SELECTED)!=-1)
@ -6013,7 +6013,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
HTREEITEM hTreeTemp=TreeView_GetSelection(dirList);
TVITEM tv;
ZeroMemory(&tv, sizeof(TVITEM));
memset(&tv, 0, sizeof(TVITEM));
tv.mask=TVIF_HANDLE|TVIF_TEXT;
tv.hItem=hTreeTemp;
@ -6309,7 +6309,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
else
{
TVITEM tv;
ZeroMemory(&tv, sizeof(TVITEM));
memset(&tv, 0, sizeof(TVITEM));
HTREEITEM hTreeTemp=nmTv->itemNew.hItem;
if(tv.iImage==6)
@ -6322,7 +6322,7 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
TV_INSERTSTRUCT tvis;
ZeroMemory(&tvis, sizeof(TV_INSERTSTRUCT));
memset(&tvis, 0, sizeof(TV_INSERTSTRUCT));
tvis.hParent=nmTv->itemNew.hItem;
tvis.hInsertAfter=TVI_SORT;
TreeView_InsertItem(dirList,&tvis);
@ -6696,7 +6696,7 @@ void LoadExts(void)
ExtList* curr;
valid_ext=new ExtList;
curr=valid_ext;
ZeroMemory(curr, sizeof(ExtList));
memset(curr, 0, sizeof(ExtList));
ifstream in;
#if (((defined(_MSC_VER) && _MSC_VER >= 1300)) || defined(__MINGW32__))
@ -6728,7 +6728,7 @@ void LoadExts(void)
{
curr->next=new ExtList;
curr=curr->next;
ZeroMemory(curr, sizeof(ExtList));
memset(curr, 0, sizeof(ExtList));
if(_strnicmp(buffer+strlen(buffer)-1, "Y", 1)==0)
curr->compressed=true;
if(strlen(buffer)>1)
@ -7232,7 +7232,7 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case IDC_SHADER_HLSL_BROWSE:
GetDlgItemText(hDlg,IDC_SHADER_HLSL_FILE,openFileName,MAX_PATH);
ZeroMemory((LPVOID)&ofn, sizeof(OPENFILENAME));
memset((LPVOID)&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
@ -7251,7 +7251,7 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case IDC_SHADER_GLSL_BROWSE:
GetDlgItemText(hDlg,IDC_SHADER_GLSL_FILE,openFileName,MAX_PATH);
ZeroMemory((LPVOID)&ofn, sizeof(OPENFILENAME));
memset((LPVOID)&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
@ -8108,7 +8108,7 @@ int* index;
DWORD* state;
}CheatTracker;
#define ITEM_QUERY(a, b, c, d, e) ZeroMemory(&a, sizeof(LV_ITEM)); \
#define ITEM_QUERY(a, b, c, d, e) memset(&a, 0, sizeof(LV_ITEM)); \
a.iItem= ListView_GetSelectionMark(GetDlgItem(hDlg, b)); \
a.iSubItem=c; \
a.mask=LVIF_TEXT; \
@ -8138,7 +8138,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
LVCOLUMN col;
TCHAR temp[32];
lstrcpy(temp,SEARCH_COLUMN_ADDRESS);
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH;
col.fmt=LVCFMT_LEFT;
col.iOrder=0;
@ -8149,7 +8149,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
ListView_InsertColumn(GetDlgItem(hDlg,IDC_CHEAT_LIST), 0, &col);
lstrcpy(temp,SEARCH_COLUMN_VALUE);
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
col.fmt=LVCFMT_LEFT;
col.iOrder=1;
@ -8161,7 +8161,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
ListView_InsertColumn(GetDlgItem(hDlg,IDC_CHEAT_LIST), 1, &col);
lstrcpy(temp,SEARCH_COLUMN_DESCRIPTION);
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
col.fmt=LVCFMT_LEFT;
col.iOrder=2;
@ -8182,7 +8182,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
int curr_idx=-1;
_stprintf(buffer, TEXT("%06X"), Cheat.c[counter].address);
LVITEM lvi;
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.mask=LVIF_TEXT;
lvi.pszText=buffer;
lvi.cchTextMax=7;
@ -8199,7 +8199,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
ct.state[counter]=Untouched;
_stprintf(buffer, TEXT("%02X"), Cheat.c[counter].byte);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=curr_idx;
lvi.iSubItem=1;
lvi.mask=LVIF_TEXT;
@ -8208,7 +8208,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(hDlg,IDC_CHEAT_LIST, LVM_SETITEM, 0, (LPARAM)&lvi);
lstrcpy(buffer,_tFromChar(Cheat.c[counter].name));
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=curr_idx;
lvi.iSubItem=2;
lvi.mask=LVIF_TEXT;
@ -8336,7 +8336,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
int curr_idx=-1;
_stprintf(buffer, TEXT("%06X"), addy);
LVITEM lvi;
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.mask=LVIF_TEXT;
lvi.pszText=buffer;
lvi.cchTextMax=6;
@ -8352,7 +8352,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
_stprintf(buffer, TEXT("%02X"), byte[j]);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=curr_idx;
lvi.iSubItem=1;
lvi.mask=LVIF_TEXT;
@ -8363,7 +8363,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
GetDlgItemText(hDlg, IDC_CHEAT_DESCRIPTION, tempDesc, 23);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=curr_idx;
lvi.iSubItem=2;
lvi.mask=LVIF_TEXT;
@ -8387,7 +8387,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
int curr_idx=-1;
LVITEM lvi;
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.mask=LVIF_TEXT;
lvi.pszText=buffer;
lvi.cchTextMax=6;
@ -8402,7 +8402,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
_stprintf(buffer2, TEXT("%02X"), byte);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=curr_idx;
lvi.iSubItem=1;
lvi.mask=LVIF_TEXT;
@ -8412,7 +8412,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
GetDlgItemText(hDlg, IDC_CHEAT_DESCRIPTION, tempDesc, 23);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=curr_idx;
lvi.iSubItem=2;
lvi.mask=LVIF_TEXT;
@ -8465,7 +8465,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
// int curr_idx=-1;
_stprintf(buffer, TEXT("%06X"), addy);
LVITEM lvi;
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.mask=LVIF_TEXT;
lvi.pszText=buffer;
lvi.cchTextMax=6;
@ -8473,7 +8473,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
ListView_SetItem(GetDlgItem(hDlg,IDC_CHEAT_LIST), &lvi);
_stprintf(buffer, TEXT("%02X"), byte[j]);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=sel_idx;
lvi.iSubItem=1;
lvi.mask=LVIF_TEXT;
@ -8483,7 +8483,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
GetDlgItemText(hDlg, IDC_CHEAT_DESCRIPTION, temp, 23);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=sel_idx;
lvi.iSubItem=2;
lvi.mask=LVIF_TEXT;
@ -8511,7 +8511,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
// int curr_idx=-1;
LVITEM lvi;
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.mask=LVIF_TEXT;
lvi.pszText=buffer;
lvi.cchTextMax=6;
@ -8529,7 +8529,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
_stprintf(buffer, TEXT("%02X"), byte);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=sel_idx;
lvi.iSubItem=1;
lvi.mask=LVIF_TEXT;
@ -8539,7 +8539,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
GetDlgItemText(hDlg, IDC_CHEAT_DESCRIPTION, temp, 23);
ZeroMemory(&lvi, sizeof(LVITEM));
memset(&lvi, 0, sizeof(LVITEM));
lvi.iItem=sel_idx;
lvi.iSubItem=2;
lvi.mask=LVIF_TEXT;
@ -8794,7 +8794,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
TCHAR buf[25];
LV_ITEM lvi;
ZeroMemory(&lvi, sizeof(LV_ITEM));
memset(&lvi, 0, sizeof(LV_ITEM));
lvi.iItem= k;
lvi.mask=LVIF_TEXT;
lvi.pszText=buf;
@ -8805,7 +8805,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
ScanAddress(lvi.pszText, scanned);
Cheat.c[l].address = scanned;
ZeroMemory(&lvi, sizeof(LV_ITEM));
memset(&lvi, 0, sizeof(LV_ITEM));
lvi.iItem= k;
lvi.iSubItem=1;
lvi.mask=LVIF_TEXT;
@ -8817,7 +8817,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
_stscanf(lvi.pszText, TEXT("%02X"), &scanned);
Cheat.c[l].byte = (uint8)(scanned & 0xff);
ZeroMemory(&lvi, sizeof(LV_ITEM));
memset(&lvi, 0, sizeof(LV_ITEM));
lvi.iItem= k;
lvi.iSubItem=2;
lvi.mask=LVIF_TEXT;
@ -8843,7 +8843,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
bool8 enabled;
TCHAR buf[25];
LV_ITEM lvi;
ZeroMemory(&lvi, sizeof(LV_ITEM));
memset(&lvi, 0, sizeof(LV_ITEM));
lvi.iItem= k;
lvi.mask=LVIF_TEXT;
lvi.pszText=buf;
@ -8854,7 +8854,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
ScanAddress(lvi.pszText, scanned);
address = scanned;
ZeroMemory(&lvi, sizeof(LV_ITEM));
memset(&lvi, 0, sizeof(LV_ITEM));
lvi.iItem= k;
lvi.iSubItem=1;
lvi.mask=LVIF_TEXT;
@ -8870,7 +8870,7 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
S9xAddCheat(enabled,true,address,byte);
ZeroMemory(&lvi, sizeof(LV_ITEM));
memset(&lvi, 0, sizeof(LV_ITEM));
lvi.iItem= k;
lvi.iSubItem=2;
lvi.mask=LVIF_TEXT;
@ -9080,7 +9080,7 @@ INT_PTR CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
LVCOLUMN col;
TCHAR temp[32];
lstrcpy(temp,TEXT("Address"));
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH;
col.fmt=LVCFMT_LEFT;
col.iOrder=0;
@ -9091,7 +9091,7 @@ INT_PTR CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
ListView_InsertColumn(GetDlgItem(hDlg,IDC_ADDYS), 0, &col);
lstrcpy(temp,TEXT("Curr. Value"));
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
col.fmt=LVCFMT_LEFT;
col.iOrder=1;
@ -9103,7 +9103,7 @@ INT_PTR CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
ListView_InsertColumn(GetDlgItem(hDlg,IDC_ADDYS), 1, &col);
lstrcpy(temp,TEXT("Prev. Value"));
ZeroMemory(&col, sizeof(LVCOLUMN));
memset(&col, 0, sizeof(LVCOLUMN));
col.mask=LVCF_FMT|LVCF_ORDER|LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
col.fmt=LVCFMT_LEFT;
col.iOrder=2;
@ -9495,7 +9495,7 @@ INT_PTR CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
// int idx=-1;
LVITEM lvi;
static TCHAR buf[12]; // the following code assumes this variable is static, I think
ZeroMemory(&cht, sizeof(struct SCheat));
memset(&cht, 0, sizeof(struct SCheat));
//retrieve and convert to SCheat
@ -9652,7 +9652,7 @@ INT_PTR CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
lstrcpy(szFileName, TEXT("watches"));
_tfullpath(szPathName, S9xGetDirectoryT(CHEAT_DIR), MAX_PATH);
ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) );
memset( (LPVOID)&ofn, 0, sizeof(OPENFILENAME) );
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GUI.hWnd;
ofn.lpstrFilter = FILE_INFO_TXT_FILE_TYPE TEXT("\0*.txt\0") FILE_INFO_ANY_FILE_TYPE TEXT("\0*.*\0\0");
@ -9711,7 +9711,7 @@ INT_PTR CALLBACK DlgCheatSearch(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
lstrcpy(szFileName, TEXT("watches"));
_tfullpath(szPathName, S9xGetDirectoryT(CHEAT_DIR), MAX_PATH);
ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) );
memset( (LPVOID)&ofn, 0, sizeof(OPENFILENAME) );
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GUI.hWnd;
ofn.lpstrFilter = FILE_INFO_TXT_FILE_TYPE TEXT("\0*.txt\0") FILE_INFO_ANY_FILE_TYPE TEXT("\0*.*\0\0");
@ -10002,7 +10002,7 @@ INT_PTR CALLBACK DlgCheatSearchAdd(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
TCHAR buf[23];
int temp=new_cheat->size;
S9xCheatDataSize tmp = S9X_8_BITS;
ZeroMemory(new_cheat, sizeof(struct SCheat));
memset(new_cheat, 0, sizeof(struct SCheat));
new_cheat->size=temp;
GetDlgItemText(hDlg, IDC_NC_ADDRESS, buf, 7);
ScanAddress(buf, new_cheat->address);
@ -10321,7 +10321,7 @@ INT_PTR CALLBACK DlgOpenMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
szFileName[0] = TEXT('\0');
ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) );
memset( (LPVOID)&ofn, 0, sizeof(OPENFILENAME) );
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
ofn.lpstrFilter = MOVIE_FILETYPE_DESCRIPTION TEXT("\0*.smv\0") FILE_INFO_ANY_FILE_TYPE TEXT("\0*.*\0\0");
@ -10468,7 +10468,7 @@ INT_PTR CALLBACK DlgCreateMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
szFileName[0] = TEXT('\0');
ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) );
memset( (LPVOID)&ofn, 0, sizeof(OPENFILENAME) );
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
ofn.lpstrFilter = MOVIE_FILETYPE_DESCRIPTION TEXT("\0*.smv\0") FILE_INFO_ANY_FILE_TYPE TEXT("\0*.*\0\0");