clang-modernize -use-nullptr

and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
This commit is contained in:
Tillmann Karras 2014-03-09 21:14:26 +01:00
parent f28116b7da
commit d802d39281
292 changed files with 1526 additions and 1526 deletions

View file

@ -68,7 +68,7 @@ bool AVIDump::CreateFile()
AVIFileInit();
NOTICE_LOG(VIDEO, "Opening AVI file (%s) for dumping", movie_file_name);
// TODO: Make this work with AVIFileOpenW without it throwing REGDB_E_CLASSNOTREG
HRESULT hr = AVIFileOpenA(&m_file, movie_file_name, OF_WRITE | OF_CREATE, NULL);
HRESULT hr = AVIFileOpenA(&m_file, movie_file_name, OF_WRITE | OF_CREATE, nullptr);
if (FAILED(hr))
{
if (hr == AVIERR_BADFORMAT) NOTICE_LOG(VIDEO, "The file couldn't be read, indicating a corrupt file or an unrecognized format.");
@ -99,7 +99,7 @@ bool AVIDump::CreateFile()
}
}
if (FAILED(AVIMakeCompressedStream(&m_streamCompressed, m_stream, &m_options, NULL)))
if (FAILED(AVIMakeCompressedStream(&m_streamCompressed, m_stream, &m_options, nullptr)))
{
NOTICE_LOG(VIDEO, "AVIMakeCompressedStream failed");
Stop();
@ -121,19 +121,19 @@ void AVIDump::CloseFile()
if (m_streamCompressed)
{
AVIStreamClose(m_streamCompressed);
m_streamCompressed = NULL;
m_streamCompressed = nullptr;
}
if (m_stream)
{
AVIStreamClose(m_stream);
m_stream = NULL;
m_stream = nullptr;
}
if (m_file)
{
AVIFileRelease(m_file);
m_file = NULL;
m_file = nullptr;
}
AVIFileExit();
@ -160,7 +160,7 @@ void AVIDump::AddFrame(const u8* data, int w, int h)
m_bitmap.biHeight = h;
}
AVIStreamWrite(m_streamCompressed, ++m_frameCount, 1, const_cast<u8*>(data), m_bitmap.biSizeImage, AVIIF_KEYFRAME, NULL, &m_byteBuffer);
AVIStreamWrite(m_streamCompressed, ++m_frameCount, 1, const_cast<u8*>(data), m_bitmap.biSizeImage, AVIIF_KEYFRAME, nullptr, &m_byteBuffer);
m_totalBytes += m_byteBuffer;
// Close the recording if the file is more than 2gb
// VfW can't properly save files over 2gb in size, but can keep writing to them up to 4gb.
@ -215,11 +215,11 @@ extern "C" {
#include <libavutil/mathematics.h>
}
AVFormatContext *s_FormatContext = NULL;
AVStream *s_Stream = NULL;
AVFrame *s_BGRFrame = NULL, *s_YUVFrame = NULL;
uint8_t *s_YUVBuffer = NULL;
uint8_t *s_OutBuffer = NULL;
AVFormatContext *s_FormatContext = nullptr;
AVStream *s_Stream = nullptr;
AVFrame *s_BGRFrame = nullptr, *s_YUVFrame = nullptr;
uint8_t *s_YUVBuffer = nullptr;
uint8_t *s_OutBuffer = nullptr;
int s_width;
int s_height;
int s_size;
@ -245,14 +245,14 @@ bool AVIDump::Start(int w, int h)
bool AVIDump::CreateFile()
{
AVCodec *codec = NULL;
AVCodec *codec = nullptr;
s_FormatContext = avformat_alloc_context();
snprintf(s_FormatContext->filename, sizeof(s_FormatContext->filename), "%s",
(File::GetUserPath(D_DUMPFRAMES_IDX) + "framedump0.avi").c_str());
File::CreateFullPath(s_FormatContext->filename);
if (!(s_FormatContext->oformat = av_guess_format("avi", NULL, NULL)) ||
if (!(s_FormatContext->oformat = av_guess_format("avi", nullptr, nullptr)) ||
!(s_Stream = avformat_new_stream(s_FormatContext, codec)))
{
CloseFile();
@ -270,7 +270,7 @@ bool AVIDump::CreateFile()
s_Stream->codec->pix_fmt = g_Config.bUseFFV1 ? PIX_FMT_BGRA : PIX_FMT_YUV420P;
if (!(codec = avcodec_find_encoder(s_Stream->codec->codec_id)) ||
(avcodec_open2(s_Stream->codec, codec, NULL) < 0))
(avcodec_open2(s_Stream->codec, codec, nullptr) < 0))
{
CloseFile();
return false;
@ -294,7 +294,7 @@ bool AVIDump::CreateFile()
return false;
}
avformat_write_header(s_FormatContext, NULL);
avformat_write_header(s_FormatContext, nullptr);
return true;
}
@ -307,7 +307,7 @@ void AVIDump::AddFrame(const u8* data, int width, int height)
// width and height
struct SwsContext *s_SwsContext;
if ((s_SwsContext = sws_getContext(width, height, PIX_FMT_BGR24, s_width, s_height,
s_Stream->codec->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL)))
s_Stream->codec->pix_fmt, SWS_BICUBIC, nullptr, nullptr, nullptr)))
{
sws_scale(s_SwsContext, s_BGRFrame->data, s_BGRFrame->linesize, 0,
height, s_YUVFrame->data, s_YUVFrame->linesize);
@ -334,7 +334,7 @@ void AVIDump::AddFrame(const u8* data, int width, int height)
av_interleaved_write_frame(s_FormatContext, &pkt);
// Encode delayed frames
outsize = avcodec_encode_video(s_Stream->codec, s_OutBuffer, s_size, NULL);
outsize = avcodec_encode_video(s_Stream->codec, s_OutBuffer, s_size, nullptr);
}
}
@ -352,31 +352,31 @@ void AVIDump::CloseFile()
if (s_Stream->codec)
avcodec_close(s_Stream->codec);
av_free(s_Stream);
s_Stream = NULL;
s_Stream = nullptr;
}
if (s_YUVBuffer)
delete[] s_YUVBuffer;
s_YUVBuffer = NULL;
s_YUVBuffer = nullptr;
if (s_OutBuffer)
delete[] s_OutBuffer;
s_OutBuffer = NULL;
s_OutBuffer = nullptr;
if (s_BGRFrame)
av_free(s_BGRFrame);
s_BGRFrame = NULL;
s_BGRFrame = nullptr;
if (s_YUVFrame)
av_free(s_YUVFrame);
s_YUVFrame = NULL;
s_YUVFrame = nullptr;
if (s_FormatContext)
{
if (s_FormatContext->pb)
avio_close(s_FormatContext->pb);
av_free(s_FormatContext);
s_FormatContext = NULL;
s_FormatContext = nullptr;
}
}

View file

@ -268,7 +268,7 @@ void BPWritten(const BPCmd& bp)
u32 tlutTMemAddr = (bp.newvalue & 0x3FF) << 9;
u32 tlutXferCount = (bp.newvalue & 0x1FFC00) >> 5;
u8 *ptr = 0;
u8 *ptr = nullptr;
// TODO - figure out a cleaner way.
if (GetConfig(CONFIG_ISWII))

View file

@ -15,7 +15,7 @@
//void UpdateFPSDisplay(const char *text);
extern NativeVertexFormat *g_nativeVertexFmt;
GFXDebuggerBase *g_pdebugger = NULL;
GFXDebuggerBase *g_pdebugger = nullptr;
volatile bool GFXDebuggerPauseFlag = false; // if true, the GFX thread will be spin locked until it's false again
volatile PauseEvent GFXDebuggerToPauseAtNext = NOT_PAUSE; // Event which will trigger spin locking the GFX thread
volatile int GFXDebuggerEventToPauseCount = 0; // Number of events to wait for until GFX thread will be paused
@ -27,14 +27,14 @@ void GFXDebuggerUpdateScreen()
if (D3D::bFrameInProgress)
{
D3D::dev->SetRenderTarget(0, D3D::GetBackBufferSurface());
D3D::dev->SetDepthStencilSurface(NULL);
D3D::dev->SetDepthStencilSurface(nullptr);
D3D::dev->StretchRect(FramebufferManager::GetEFBColorRTSurface(), NULL,
D3D::GetBackBufferSurface(), NULL,
D3D::dev->StretchRect(FramebufferManager::GetEFBColorRTSurface(), nullptr,
D3D::GetBackBufferSurface(), nullptr,
D3DTEXF_LINEAR);
D3D::dev->EndScene();
D3D::dev->Present(NULL, NULL, NULL, NULL);
D3D::dev->Present(nullptr, nullptr, nullptr, nullptr);
D3D::dev->SetRenderTarget(0, FramebufferManager::GetEFBColorRTSurface());
D3D::dev->SetDepthStencilSurface(FramebufferManager::GetEFBDepthRTSurface());
@ -43,7 +43,7 @@ void GFXDebuggerUpdateScreen()
else
{
D3D::dev->EndScene();
D3D::dev->Present(NULL, NULL, NULL, NULL);
D3D::dev->Present(nullptr, nullptr, nullptr, nullptr);
D3D::dev->BeginScene();
}*/
}

View file

@ -15,9 +15,9 @@
namespace EmuWindow
{
HWND m_hWnd = NULL;
HWND m_hParent = NULL;
HINSTANCE m_hInstance = NULL;
HWND m_hWnd = nullptr;
HWND m_hParent = nullptr;
HINSTANCE m_hInstance = nullptr;
WNDCLASSEX wndClass;
const TCHAR m_szClassName[] = _T("DolphinEmuWnd");
int g_winstyle;
@ -81,7 +81,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
case WM_CLOSE:
// When the user closes the window, we post an event to the main window to call Stop()
// Which then handles all the necessary steps to Shutdown the core
if (m_hParent == NULL)
if (m_hParent == nullptr)
{
// Stop the game
//PostMessage(m_hParent, WM_USER, WM_USER_STOP, 0);
@ -126,12 +126,12 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = 0;
wndClass.hInstance = hInstance;
wndClass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wndClass.hCursor = NULL;
wndClass.hIcon = LoadIcon( nullptr, IDI_APPLICATION );
wndClass.hCursor = nullptr;
wndClass.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH );
wndClass.lpszMenuName = NULL;
wndClass.lpszMenuName = nullptr;
wndClass.lpszClassName = m_szClassName;
wndClass.hIconSm = LoadIcon( NULL, IDI_APPLICATION );
wndClass.hIconSm = LoadIcon( nullptr, IDI_APPLICATION );
m_hInstance = hInstance;
RegisterClassEx( &wndClass );
@ -139,7 +139,7 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
m_hParent = parent;
m_hWnd = CreateWindow(m_szClassName, title, (g_ActiveConfig.backend_info.bSupports3DVision && g_ActiveConfig.b3DVision) ? WS_EX_TOPMOST | WS_POPUP : WS_CHILD,
0, 0, width, height, m_hParent, NULL, hInstance, NULL);
0, 0, width, height, m_hParent, nullptr, hInstance, nullptr);
return m_hWnd;
}

View file

@ -70,7 +70,7 @@ void Fifo_Shutdown()
{
if (GpuRunningState) PanicAlert("Fifo shutting down while active");
FreeMemoryPages(videoBuffer, FIFO_SIZE);
videoBuffer = NULL;
videoBuffer = nullptr;
}
u8* GetVideoBufferStartPtr()

View file

@ -14,7 +14,7 @@ unsigned int FramebufferManagerBase::s_last_xfb_height = 1;
FramebufferManagerBase::FramebufferManagerBase()
{
m_realXFBSource = NULL;
m_realXFBSource = nullptr;
// can't hurt
memset(m_overlappingXFBArray, 0, sizeof(m_overlappingXFBArray));
@ -34,7 +34,7 @@ FramebufferManagerBase::~FramebufferManagerBase()
const XFBSourceBase* const* FramebufferManagerBase::GetXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount)
{
if (!g_ActiveConfig.bUseXFB)
return NULL;
return nullptr;
if (g_ActiveConfig.bUseRealXFB)
return GetRealXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount);
@ -77,7 +77,7 @@ const XFBSourceBase* const* FramebufferManagerBase::GetVirtualXFBSource(u32 xfbA
xfbCount = 0;
if (m_virtualXFBList.empty()) // no Virtual XFBs available
return NULL;
return nullptr;
u32 srcLower = xfbAddr;
u32 srcUpper = xfbAddr + 2 * fbWidth * fbHeight;
@ -143,7 +143,7 @@ void FramebufferManagerBase::CopyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHe
if (vxfb->xfbSource && (vxfb->xfbSource->texWidth != target_width || vxfb->xfbSource->texHeight != target_height))
{
//delete vxfb->xfbSource;
//vxfb->xfbSource = NULL;
//vxfb->xfbSource = nullptr;
}
if (!vxfb->xfbSource)

View file

@ -58,7 +58,7 @@ public:
protected:
struct VirtualXFB
{
VirtualXFB() : xfbSource(NULL) {}
VirtualXFB() : xfbSource(nullptr) {}
// Address and size in GameCube RAM
u32 xfbAddr;

View file

@ -70,7 +70,7 @@ void Init(const char *gameCode)
for (auto& rFilename : rFilenames)
{
std::string FileName;
SplitPath(rFilename, NULL, &FileName, NULL);
SplitPath(rFilename, nullptr, &FileName, nullptr);
if (FileName.substr(0, strlen(code)).compare(code) == 0 && textureMap.find(FileName) == textureMap.end())
textureMap.insert(std::map<std::string, std::string>::value_type(FileName, rFilename));
@ -95,7 +95,7 @@ PC_TexFormat GetHiresTex(const char *fileName, unsigned int *pWidth, unsigned in
int channels;
u8 *temp = SOIL_load_image(textureMap[key].c_str(), &width, &height, &channels, SOIL_LOAD_RGBA);
if (temp == NULL)
if (temp == nullptr)
{
ERROR_LOG(VIDEO, "Custom texture %s failed to load", textureMap[key].c_str());
return PC_TEX_FMT_NONE;

View file

@ -35,8 +35,8 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid
char title[] = "Dolphin Screenshot";
char title_key[] = "Title";
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
png_structp png_ptr = nullptr;
png_infop info_ptr = nullptr;
// Open file for writing (binary mode)
File::IOFile fp(filename, "wb");
@ -46,8 +46,8 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid
}
// Initialize write structure
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) {
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (png_ptr == nullptr) {
PanicAlert("Screenshot failed: Could not allocate write struct\n");
goto finalise;
@ -55,7 +55,7 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid
// Initialize info structure
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
if (info_ptr == nullptr) {
PanicAlert("Screenshot failed: Could not allocate info struct\n");
goto finalise;
}
@ -96,13 +96,13 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid
}
// End write
png_write_end(png_ptr, NULL);
png_write_end(png_ptr, nullptr);
success = true;
finalise:
if (info_ptr != NULL) png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
if (png_ptr != NULL) png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
if (info_ptr != nullptr) png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
if (png_ptr != nullptr) png_destroy_write_struct(&png_ptr, (png_infopp)nullptr);
return success;
}

View file

@ -33,7 +33,7 @@ void IndexGenerator::Init()
primitive_table[3] = IndexGenerator::AddStrip<false>;
primitive_table[4] = IndexGenerator::AddFan<false>;
}
primitive_table[1] = NULL;
primitive_table[1] = nullptr;
primitive_table[5] = &IndexGenerator::AddLineList;
primitive_table[6] = &IndexGenerator::AddLineStrip;
primitive_table[7] = &IndexGenerator::AddPoints;

View file

@ -31,7 +31,7 @@
#include "VideoCommon/XFMemory.h"
u8* g_pVideoData = 0;
u8* g_pVideoData = nullptr;
bool g_bRecordFifoData = false;
#if _M_SSE >= 0x301
@ -85,7 +85,7 @@ void InterpretDisplayList(u32 address, u32 size)
u8* startAddress = Memory::GetPointer(address);
// Avoid the crash if Memory::GetPointer failed ..
if (startAddress != 0)
if (startAddress != nullptr)
{
g_pVideoData = startAddress;

View file

@ -1,7 +1,7 @@
#include "VideoCommon/PerfQueryBase.h"
#include "VideoCommon/VideoConfig.h"
PerfQueryBase* g_perf_query = 0;
PerfQueryBase* g_perf_query = nullptr;
bool PerfQueryBase::ShouldEmulate()
{

View file

@ -224,17 +224,17 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
{
// Non-uid template parameters will write to the dummy data (=> gets optimized out)
pixel_shader_uid_data dummy_data;
pixel_shader_uid_data& uid_data = (&out.template GetUidData<pixel_shader_uid_data>() != NULL)
pixel_shader_uid_data& uid_data = (&out.template GetUidData<pixel_shader_uid_data>() != nullptr)
? out.template GetUidData<pixel_shader_uid_data>() : dummy_data;
out.SetBuffer(text);
const bool is_writing_shadercode = (out.GetBuffer() != NULL);
const bool is_writing_shadercode = (out.GetBuffer() != nullptr);
#ifndef ANDROID
locale_t locale;
locale_t old_locale;
if (is_writing_shadercode)
{
locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
locale = newlocale(LC_NUMERIC_MASK, "C", nullptr); // New locale for compilation
old_locale = uselocale(locale); // Apply the locale for this thread
}
#endif
@ -1177,7 +1177,7 @@ static inline void WriteFog(T& out, pixel_shader_uid_data& uid_data)
}
else
{
if (bpmem.fog.c_proj_fsel.fsel != 2 && out.GetBuffer() != NULL)
if (bpmem.fog.c_proj_fsel.fsel != 2 && out.GetBuffer() != nullptr)
WARN_LOG(VIDEO, "Unknown Fog Type! %08x", bpmem.fog.c_proj_fsel.fsel);
}

View file

@ -42,7 +42,7 @@
int frameCount;
int OSDChoice, OSDTime;
Renderer *g_renderer = NULL;
Renderer *g_renderer = nullptr;
std::mutex Renderer::s_criticalScreenshot;
std::string Renderer::s_sScreenshotName;

View file

@ -36,7 +36,7 @@ public:
* @note When implementing this method in a child class, you likely want to return the argument of the last SetBuffer call here
* @note SetBuffer() should be called before using GetBuffer().
*/
const char* GetBuffer() { return NULL; }
const char* GetBuffer() { return nullptr; }
/*
* Can be used to give the object a place to write to. This should be called before using Write().
@ -51,10 +51,10 @@ public:
/*
* Returns a pointer to an internally stored object of the uid_data type.
* @warning since most child classes use the default implementation you shouldn't access this directly without adding precautions against NULL access (e.g. via adding a dummy structure, cf. the vertex/pixel shader generators)
* @warning since most child classes use the default implementation you shouldn't access this directly without adding precautions against nullptr access (e.g. via adding a dummy structure, cf. the vertex/pixel shader generators)
*/
template<class uid_data>
uid_data& GetUidData() { return *(uid_data*)NULL; }
uid_data& GetUidData() { return *(uid_data*)nullptr; }
};
/**
@ -106,7 +106,7 @@ private:
class ShaderCode : public ShaderGeneratorInterface
{
public:
ShaderCode() : buf(NULL), write_ptr(NULL)
ShaderCode() : buf(nullptr), write_ptr(nullptr)
{
}

View file

@ -25,7 +25,7 @@ enum
TextureCache *g_texture_cache;
GC_ALIGNED16(u8 *TextureCache::temp) = NULL;
GC_ALIGNED16(u8 *TextureCache::temp) = nullptr;
unsigned int TextureCache::temp_size;
TextureCache::TexCache TextureCache::textures;
@ -72,7 +72,7 @@ TextureCache::~TextureCache()
{
Invalidate();
FreeAlignedMemory(temp);
temp = NULL;
temp = nullptr;
}
void TextureCache::OnConfigChanged(VideoConfig& config)
@ -334,7 +334,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
unsigned int const tlutaddr, int const tlutfmt, bool const use_mipmaps, unsigned int maxlevel, bool const from_tmem)
{
if (0 == address)
return NULL;
return nullptr;
// TexelSizeInNibbles(format) * width * height / 16;
const unsigned int bsw = TexDecoder_GetBlockWidthInTexels(texformat) - 1;
@ -431,7 +431,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
{
// delete the texture and make a new one
delete entry;
entry = NULL;
entry = nullptr;
}
}
@ -452,7 +452,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
if(entry)
{
delete entry;
entry = NULL;
entry = nullptr;
}
}
using_custom_texture = true;
@ -480,7 +480,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
texLevels = (use_native_mips || using_custom_lods) ? texLevels : 1; // TODO: Should be forced to 1 for non-pow2 textures (e.g. efb copies with automatically adjusted IR)
// create the entry/texture
if (NULL == entry)
if (nullptr == entry)
{
textures[texID] = entry = g_texture_cache->CreateTexture(width, height, expandedWidth, texLevels, pcfmt);
@ -522,8 +522,8 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
{
src_data += texture_size;
const u8* ptr_even = NULL;
const u8* ptr_odd = NULL;
const u8* ptr_even = nullptr;
const u8* ptr_odd = nullptr;
if (from_tmem)
{
ptr_even = &texMem[bpmem.tex[stage/4].texImage1[stage%4].tmem_even * TMEM_LINE_SIZE + texture_size];
@ -862,11 +862,11 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
{
// remove it and recreate it as a render target
delete entry;
entry = NULL;
entry = nullptr;
}
}
if (NULL == entry)
if (nullptr == entry)
{
// create the texture
textures[dstAddr] = entry = g_texture_cache->CreateRenderTargetTexture(scaled_tex_w, scaled_tex_h);

View file

@ -604,7 +604,7 @@ void WriteZ24Encoder(char*& p, API_TYPE ApiType)
const char *GenerateEncodingShader(u32 format,API_TYPE ApiType)
{
#ifndef ANDROID
locale_t locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
locale_t locale = newlocale(LC_NUMERIC_MASK, "C", nullptr); // New locale for compilation
locale_t old_locale = uselocale(locale); // Apply the locale for this thread
#endif
text[sizeof(text) - 1] = 0x7C; // canary

View file

@ -464,10 +464,10 @@ void LOADERDECL TexMtx_Write_Float4()
VertexLoader::VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr)
{
m_compiledCode = NULL;
m_compiledCode = nullptr;
m_numLoadedVertices = 0;
m_VertexSize = 0;
m_NativeFmt = 0;
m_NativeFmt = nullptr;
loop_counter = 0;
VertexLoader_Normal::Init();
VertexLoader_Position::Init();
@ -594,7 +594,7 @@ void VertexLoader::CompileVertexTranslator()
TPipelineFunction pFunc = VertexLoader_Normal::GetFunction(m_VtxDesc.Normal,
m_VtxAttr.NormalFormat, m_VtxAttr.NormalElements, m_VtxAttr.NormalIndex3);
if (pFunc == 0)
if (pFunc == nullptr)
{
Host_SysMessage(
StringFromFormat("VertexLoader_Normal::GetFunction(%i %i %i %i) returned zero!",
@ -829,7 +829,7 @@ void VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const
m_numLoadedVertices += count;
// Flush if our vertex format is different from the currently set.
if (g_nativeVertexFmt != NULL && g_nativeVertexFmt != m_NativeFmt)
if (g_nativeVertexFmt != nullptr && g_nativeVertexFmt != m_NativeFmt)
{
// We really must flush here. It's possible that the native representations
// of the two vtx formats are the same, but we have no way to easily check that

View file

@ -44,7 +44,7 @@ void Init()
{
MarkAllDirty();
for (VertexLoader*& vertexLoader : g_VertexLoaders)
vertexLoader = NULL;
vertexLoader = nullptr;
RecomputeCachedArraybases();
}

View file

@ -123,11 +123,11 @@ void LOADERDECL Pos_ReadIndex_Float_SSSE3()
static TPipelineFunction tableReadPosition[4][8][2] = {
{
{NULL, NULL,},
{NULL, NULL,},
{NULL, NULL,},
{NULL, NULL,},
{NULL, NULL,},
{nullptr, nullptr,},
{nullptr, nullptr,},
{nullptr, nullptr,},
{nullptr, nullptr,},
{nullptr, nullptr,},
},
{
{Pos_ReadDirect<u8, 2>, Pos_ReadDirect<u8, 3>,},

View file

@ -132,11 +132,11 @@ void LOADERDECL TexCoord_ReadIndex_Float2_SSSE3()
static TPipelineFunction tableReadTexCoord[4][8][2] = {
{
{NULL, NULL,},
{NULL, NULL,},
{NULL, NULL,},
{NULL, NULL,},
{NULL, NULL,},
{nullptr, nullptr,},
{nullptr, nullptr,},
{nullptr, nullptr,},
{nullptr, nullptr,},
{nullptr, nullptr,},
},
{
{TexCoord_ReadDirect<u8, 1>, TexCoord_ReadDirect<u8, 2>,},

View file

@ -60,17 +60,17 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
{
// Non-uid template parameters will write to the dummy data (=> gets optimized out)
vertex_shader_uid_data dummy_data;
vertex_shader_uid_data& uid_data = (&out.template GetUidData<vertex_shader_uid_data>() != NULL)
vertex_shader_uid_data& uid_data = (&out.template GetUidData<vertex_shader_uid_data>() != nullptr)
? out.template GetUidData<vertex_shader_uid_data>() : dummy_data;
out.SetBuffer(text);
const bool is_writing_shadercode = (out.GetBuffer() != NULL);
const bool is_writing_shadercode = (out.GetBuffer() != nullptr);
#ifndef ANDROID
locale_t locale;
locale_t old_locale;
if (is_writing_shadercode)
{
locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation
locale = newlocale(LC_NUMERIC_MASK, "C", nullptr); // New locale for compilation
old_locale = uselocale(locale); // Apply the locale for this thread
}
#endif

View file

@ -12,8 +12,8 @@
#include "VideoCommon/VideoBackendBase.h"
std::vector<VideoBackend*> g_available_video_backends;
VideoBackend* g_video_backend = NULL;
static VideoBackend* s_default_backend = NULL;
VideoBackend* g_video_backend = nullptr;
static VideoBackend* s_default_backend = nullptr;
#ifdef _WIN32
#include <windows.h>
@ -36,7 +36,7 @@ static bool IsGteVista()
void VideoBackend::PopulateList()
{
VideoBackend* backends[4] = { NULL };
VideoBackend* backends[4] = { nullptr };
// OGL > D3D11 > SW
#if !defined(USE_GLES) || USE_GLES3
@ -69,7 +69,7 @@ void VideoBackend::ClearList()
void VideoBackend::ActivateBackend(const std::string& name)
{
if (name.length() == 0) // If NULL, set it to the default backend (expected behavior)
if (name.length() == 0) // If nullptr, set it to the default backend (expected behavior)
g_video_backend = s_default_backend;
for (VideoBackend* backend : g_available_video_backends)