[Project64] Use AUTO_PTR instead of std::auto_ptr

This commit is contained in:
zilmar 2016-10-09 20:44:31 +11:00
parent 97f1d8302d
commit e1633bbada
4 changed files with 480 additions and 482 deletions

View File

@ -47,6 +47,7 @@
#include <Common/path.h> #include <Common/path.h>
#include <png/png.h> #include <png/png.h>
#include <memory> #include <memory>
#include <Common/SmartPointer.h>
#include "Config.h" #include "Config.h"
#include "Util.h" #include "Util.h"
@ -281,7 +282,7 @@ void ConfigWrapper()
#else #else
g_settings->wrpResolution, g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic g_settings->wrpResolution, g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic
#endif #endif
); );
} }
void UseUnregisteredSetting(int /*SettingID*/) void UseUnregisteredSetting(int /*SettingID*/)
@ -1093,7 +1094,6 @@ void ReleaseGfx()
rdp.window_changed = TRUE; rdp.window_changed = TRUE;
} }
#ifdef _WIN32 #ifdef _WIN32
CriticalSection * g_ProcessDListCS = NULL; CriticalSection * g_ProcessDListCS = NULL;
@ -1417,7 +1417,7 @@ int CALL InitiateGFX(GFX_INFO Gfx_Info)
#else #else
g_settings->wrpResolution, g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic g_settings->wrpResolution, g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic
#endif #endif
); );
grGlideInit(); grGlideInit();
grSstSelect(0); grSstSelect(0);
@ -2127,7 +2127,7 @@ void newSwapBuffers()
info.size = sizeof(GrLfbInfo_t); info.size = sizeof(GrLfbInfo_t);
if (grLfbLock(GR_LFB_READ_ONLY, GR_BUFFER_BACKBUFFER, GR_LFBWRITEMODE_565, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) if (grLfbLock(GR_LFB_READ_ONLY, GR_BUFFER_BACKBUFFER, GR_LFBWRITEMODE_565, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info))
{ {
std::auto_ptr<uint8_t> ssimg_buffer(new uint8_t[image_width * image_height * 3]); AUTO_PTR<uint8_t> ssimg_buffer(new uint8_t[image_width * image_height * 3]);
uint8_t * ssimg = ssimg_buffer.get(); uint8_t * ssimg = ssimg_buffer.get();
int sspos = 0; int sspos = 0;
uint32_t offset_src = info.strideInBytes * offset_y; uint32_t offset_src = info.strideInBytes * offset_y;

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@
#include "N64DiskClass.h" #include "N64DiskClass.h"
#include "SystemGlobals.h" #include "SystemGlobals.h"
#include <Common/Platform.h> #include <Common/Platform.h>
#include <Common/SmartPointer.h>
#include <Common/MemoryManagement.h> #include <Common/MemoryManagement.h>
#include <Project64-core/N64System/Mips/RegisterClass.h> #include <Project64-core/N64System/Mips/RegisterClass.h>
#include <memory> #include <memory>
@ -122,7 +123,7 @@ bool CN64Disk::IsValidDiskImage(uint8_t Test[4])
bool CN64Disk::AllocateDiskImage(uint32_t DiskFileSize) bool CN64Disk::AllocateDiskImage(uint32_t DiskFileSize)
{ {
WriteTrace(TraceN64System, TraceDebug, "Allocating memory for disk"); WriteTrace(TraceN64System, TraceDebug, "Allocating memory for disk");
std::auto_ptr<uint8_t> ImageBase(new uint8_t[DiskFileSize + 0x1000]); AUTO_PTR<uint8_t> ImageBase(new uint8_t[DiskFileSize + 0x1000]);
if (ImageBase.get() == NULL) if (ImageBase.get() == NULL)
{ {
SetError(MSG_MEM_ALLOC_ERROR); SetError(MSG_MEM_ALLOC_ERROR);
@ -493,7 +494,7 @@ void CN64Disk::ConvertDiskFormatBack()
//SDK DISK RAM //SDK DISK RAM
WriteTrace(TraceN64System, TraceDebug, "Allocating memory for disk SDK format"); WriteTrace(TraceN64System, TraceDebug, "Allocating memory for disk SDK format");
std::auto_ptr<uint8_t> ImageBase(new uint8_t[SDKFormatSize + 0x1000]); AUTO_PTR<uint8_t> ImageBase(new uint8_t[SDKFormatSize + 0x1000]);
if (ImageBase.get() == NULL) if (ImageBase.get() == NULL)
{ {
SetError(MSG_MEM_ALLOC_ERROR); SetError(MSG_MEM_ALLOC_ERROR);

View File

@ -15,6 +15,7 @@
#include <Common/md5.h> #include <Common/md5.h>
#include <Common/Platform.h> #include <Common/Platform.h>
#include <Common/MemoryManagement.h> #include <Common/MemoryManagement.h>
#include <Common/SmartPointer.h>
#include <memory> #include <memory>
#ifdef _WIN32 #ifdef _WIN32
@ -38,7 +39,7 @@ CN64Rom::~CN64Rom()
bool CN64Rom::AllocateRomImage(uint32_t RomFileSize) bool CN64Rom::AllocateRomImage(uint32_t RomFileSize)
{ {
WriteTrace(TraceN64System, TraceDebug, "Allocating memory for rom"); WriteTrace(TraceN64System, TraceDebug, "Allocating memory for rom");
std::auto_ptr<uint8_t> ImageBase(new uint8_t[RomFileSize + 0x1000]); AUTO_PTR<uint8_t> ImageBase(new uint8_t[RomFileSize + 0x1000]);
if (ImageBase.get() == NULL) if (ImageBase.get() == NULL)
{ {
SetError(MSG_MEM_ALLOC_ERROR); SetError(MSG_MEM_ALLOC_ERROR);