diff options
author | Underground78 <underground78@users.sourceforge.net> | 2013-05-07 23:51:09 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2013-05-09 16:57:30 +0400 |
commit | 2acb3c5749326e59f6f2c6f48692a32dc7e705f5 (patch) | |
tree | 4b6985d401ea648b1562c3b4a6bb868e61c5105d /src/filters/parser/BaseSplitter | |
parent | ae3db48090dc9837fbb439503075521e356dcfa7 (diff) |
Use nullptr instead of NULL whenever possible.
Microsoft recommends to avoid using NULL or zero (0) as a null pointer constant since nullptr is less vulnerable to misuse and works better in most situations.
Also fix some cases where NULL was used instead of 0 or FALSE.
Diffstat (limited to 'src/filters/parser/BaseSplitter')
-rw-r--r-- | src/filters/parser/BaseSplitter/AsyncReader.cpp | 16 | ||||
-rw-r--r-- | src/filters/parser/BaseSplitter/BaseSplitter.cpp | 32 | ||||
-rw-r--r-- | src/filters/parser/BaseSplitter/MultiFiles.cpp | 10 |
3 files changed, 29 insertions, 29 deletions
diff --git a/src/filters/parser/BaseSplitter/AsyncReader.cpp b/src/filters/parser/BaseSplitter/AsyncReader.cpp index 73af2b46b..3d4ae990c 100644 --- a/src/filters/parser/BaseSplitter/AsyncReader.cpp +++ b/src/filters/parser/BaseSplitter/AsyncReader.cpp @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -31,9 +31,9 @@ //
CAsyncFileReader::CAsyncFileReader(CString fn, HRESULT& hr)
- : CUnknown(NAME("CAsyncFileReader"), NULL, &hr)
+ : CUnknown(NAME("CAsyncFileReader"), nullptr, &hr)
, m_len((ULONGLONG) - 1)
- , m_hBreakEvent(NULL)
+ , m_hBreakEvent(nullptr)
, m_lOsError(0)
{
hr = Open(fn, modeRead | shareDenyNone | typeBinary | osSequentialScan) ? S_OK : E_FAIL;
@@ -43,9 +43,9 @@ CAsyncFileReader::CAsyncFileReader(CString fn, HRESULT& hr) }
CAsyncFileReader::CAsyncFileReader(CAtlList<CHdmvClipInfo::PlaylistItem>& Items, HRESULT& hr)
- : CUnknown(NAME("CAsyncFileReader"), NULL, &hr)
+ : CUnknown(NAME("CAsyncFileReader"), nullptr, &hr)
, m_len((ULONGLONG) - 1)
- , m_hBreakEvent(NULL)
+ , m_hBreakEvent(nullptr)
, m_lOsError(0)
{
hr = OpenFiles(Items, modeRead | shareDenyNone | typeBinary | osSequentialScan) ? S_OK : E_FAIL;
@@ -177,14 +177,14 @@ STDMETHODIMP CAsyncUrlReader::Length(LONGLONG* pTotal, LONGLONG* pAvailable) if (pTotal) {
*pTotal = 0;
}
- return __super::Length(NULL, pAvailable);
+ return __super::Length(nullptr, pAvailable);
}
// CAMThread
DWORD CAsyncUrlReader::ThreadProc()
{
- AfxSocketInit(NULL);
+ AfxSocketInit(nullptr);
DWORD cmd = GetRequest();
if (cmd != CMD_INIT) {
@@ -234,7 +234,7 @@ DWORD CAsyncUrlReader::ThreadProc() //
- m_hThread = NULL;
+ m_hThread = nullptr;
return S_OK;
}
diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.cpp b/src/filters/parser/BaseSplitter/BaseSplitter.cpp index e2b298fed..eac63a4b1 100644 --- a/src/filters/parser/BaseSplitter/BaseSplitter.cpp +++ b/src/filters/parser/BaseSplitter/BaseSplitter.cpp @@ -106,7 +106,7 @@ CBaseSplitterInputPin::~CBaseSplitterInputPin() HRESULT CBaseSplitterInputPin::GetAsyncReader(IAsyncReader** ppAsyncReader)
{
CheckPointer(ppAsyncReader, E_POINTER);
- *ppAsyncReader = NULL;
+ *ppAsyncReader = nullptr;
CheckPointer(m_pAsyncReader, VFW_E_NOT_CONNECTED);
(*ppAsyncReader = m_pAsyncReader)->AddRef();
return S_OK;
@@ -447,7 +447,7 @@ DWORD CBaseSplitterOutputPin::ThreadProc() bool iHaaliRenderConnect = false;
CComPtr<IPin> pPinTo = this, pTmp;
while (pPinTo && SUCCEEDED(pPinTo->ConnectedTo(&pTmp)) && (pPinTo = pTmp)) {
- pTmp = NULL;
+ pTmp = nullptr;
CComPtr<IBaseFilter> pBF = GetFilterFromPin(pPinTo);
if (GetCLSID(pBF) == CLSID_DXR) { // Haali Renderer
iHaaliRenderConnect = true;
@@ -465,7 +465,7 @@ DWORD CBaseSplitterOutputPin::ThreadProc() DWORD cmd;
if (CheckRequest(&cmd)) {
- m_hThread = NULL;
+ m_hThread = nullptr;
cmd = GetRequest();
Reply(S_OK);
ASSERT(cmd == CMD_EXIT);
@@ -559,7 +559,7 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p) do {
CComPtr<IMediaSample> pSample;
- if (S_OK != (hr = GetDeliveryBuffer(&pSample, NULL, NULL, 0))) {
+ if (S_OK != (hr = GetDeliveryBuffer(&pSample, nullptr, nullptr, 0))) {
break;
}
@@ -590,7 +590,7 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p) if (S_OK != (hr = m_pAllocator->Commit())) {
break;
}
- if (S_OK != (hr = GetDeliveryBuffer(&pSample, NULL, NULL, 0))) {
+ if (S_OK != (hr = GetDeliveryBuffer(&pSample, nullptr, nullptr, 0))) {
break;
}
}
@@ -615,7 +615,7 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p) ASSERT(!p->bSyncPoint || fTimeValid);
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
if (S_OK != (hr = pSample->GetPointer(&pData)) || !pData) {
break;
}
@@ -623,10 +623,10 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p) if (S_OK != (hr = pSample->SetActualDataLength(nBytes))) {
break;
}
- if (S_OK != (hr = pSample->SetTime(fTimeValid ? &p->rtStart : NULL, fTimeValid ? &p->rtStop : NULL))) {
+ if (S_OK != (hr = pSample->SetTime(fTimeValid ? &p->rtStart : nullptr, fTimeValid ? &p->rtStop : nullptr))) {
break;
}
- if (S_OK != (hr = pSample->SetMediaTime(NULL, NULL))) {
+ if (S_OK != (hr = pSample->SetMediaTime(nullptr, nullptr))) {
break;
}
if (S_OK != (hr = pSample->SetDiscontinuity(p->bDiscontinuity))) {
@@ -650,7 +650,7 @@ void CBaseSplitterOutputPin::MakeISCRHappy() {
CComPtr<IPin> pPinTo = this, pTmp;
while (pPinTo && SUCCEEDED(pPinTo->ConnectedTo(&pTmp)) && (pPinTo = pTmp)) {
- pTmp = NULL;
+ pTmp = nullptr;
CComPtr<IBaseFilter> pBF = GetFilterFromPin(pPinTo);
@@ -800,7 +800,7 @@ STDMETHODIMP CBaseSplitterFilter::NonDelegatingQueryInterface(REFIID riid, void* {
CheckPointer(ppv, E_POINTER);
- *ppv = NULL;
+ *ppv = nullptr;
if (m_pInput && riid == __uuidof(IFileSourceFilter)) {
return E_NOINTERFACE;
@@ -826,7 +826,7 @@ CBaseSplitterOutputPin* CBaseSplitterFilter::GetOutputPin(DWORD TrackNum) {
CAutoLock cAutoLock(&m_csPinMap);
- CBaseSplitterOutputPin* pPin = NULL;
+ CBaseSplitterOutputPin* pPin = nullptr;
m_pPinMap.Lookup(TrackNum, pPin);
return pPin;
}
@@ -953,7 +953,7 @@ DWORD CBaseSplitterFilter::ThreadProc() for (;;) {
DWORD cmd = GetRequest();
if (cmd == CMD_EXIT) {
- CAMThread::m_hThread = NULL;
+ CAMThread::m_hThread = nullptr;
}
Reply(S_OK);
if (cmd == CMD_EXIT) {
@@ -967,7 +967,7 @@ DWORD CBaseSplitterFilter::ThreadProc() for (DWORD cmd = (DWORD) - 1; ; cmd = GetRequest()) {
if (cmd == CMD_EXIT) {
- m_hThread = NULL;
+ m_hThread = nullptr;
Reply(S_OK);
return 0;
}
@@ -1008,7 +1008,7 @@ DWORD CBaseSplitterFilter::ThreadProc() ASSERT(0); // we should only exit via CMD_EXIT
- m_hThread = NULL;
+ m_hThread = nullptr;
return 0;
}
@@ -1177,7 +1177,7 @@ CBasePin* CBaseSplitterFilter::GetPin(int n) return m_pInput;
}
- return NULL;
+ return nullptr;
}
STDMETHODIMP CBaseSplitterFilter::Stop()
@@ -1567,7 +1567,7 @@ STDMETHODIMP CBaseSplitterFilter::GetMarkerTime(long MarkerNum, double* pMarkerT STDMETHODIMP CBaseSplitterFilter::GetMarkerName(long MarkerNum, BSTR* pbstrMarkerName)
{
- return ChapGet((int)MarkerNum - 1, NULL, pbstrMarkerName);
+ return ChapGet((int)MarkerNum - 1, nullptr, pbstrMarkerName);
}
// IKeyFrameInfo
diff --git a/src/filters/parser/BaseSplitter/MultiFiles.cpp b/src/filters/parser/BaseSplitter/MultiFiles.cpp index 23e4b7146..1e263c150 100644 --- a/src/filters/parser/BaseSplitter/MultiFiles.cpp +++ b/src/filters/parser/BaseSplitter/MultiFiles.cpp @@ -1,5 +1,5 @@ /*
- * (C) 2009-2012 see Authors.txt
+ * (C) 2009-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -29,7 +29,7 @@ CMultiFiles::CMultiFiles() : m_hFile(INVALID_HANDLE_VALUE)
, m_llTotalLength(0)
, m_nCurPart(-1)
- , m_pCurrentPTSOffset(NULL)
+ , m_pCurrentPTSOffset(nullptr)
{
}
@@ -141,7 +141,7 @@ UINT CMultiFiles::Read(void* lpBuf, UINT nCount) {
DWORD dwRead;
do {
- if (!ReadFile(m_hFile, lpBuf, nCount, &dwRead, NULL)) {
+ if (!ReadFile(m_hFile, lpBuf, nCount, &dwRead, nullptr)) {
break;
}
@@ -175,11 +175,11 @@ BOOL CMultiFiles::OpenPart(int nPart) ClosePart();
fn = m_strFiles.GetAt(nPart);
- m_hFile = CreateFile(fn, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
+ m_hFile = CreateFile(fn, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr);
if (m_hFile != INVALID_HANDLE_VALUE) {
m_nCurPart = nPart;
- if (m_pCurrentPTSOffset != NULL) {
+ if (m_pCurrentPTSOffset != nullptr) {
*m_pCurrentPTSOffset = m_rtPtsOffsets[nPart];
}
}
|