Skip to content

Commit 50e8312

Browse files
committed
Remove DE_NULL from the repo
This change replaces DE_NULL and (X *)DE_NULL with nullptr with the following sed command: git ls-files | grep -v -e framework/delibs/debase/deDefs.h \ -e framework/delibs/debase/deDefs_kc_cts.h \ | xargs -P 8 -d '\n' sed -b -i 's|\<DE_NULL\>|nullptr|g; s|([^()]*)nullptr|nullptr|g' The definition of DE_NULL in framework/delibs/debase/deDefs.h is kept for now to avoid unnecessary pain when DE_NULL is reintroduced by merges from branches. Eventually this should be deleted with new branches being based on this change and DE_NULL not getting copy-pasted around all the time. Exceptions: * In modules/gles31/functional/es31fShaderImageLoadStoreTests.cpp, the casts of nullptr are retained due to a limitation with ?: and inherited types. * In external/vulkancts/modules/vulkan/compute/vktComputeCooperativeMatrixTests.cpp, there is a cast of nullptr to resolve a function overload. * In external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderTextureFunctionTests.cpp and external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderDerivateTests.cpp, there is a cast of nullptr to resolve a constructor overload. * In external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp, there is a cast to vk::pt::Win32LPCWSTR. Components: Framework, Vulkan, OpenGL VK-GL-CTS issue: 4652 Change-Id: Ia9f3ccc251b0dbf51ccd40f267cec144d4efca7a
1 parent cef2dca commit 50e8312

File tree

1,112 files changed

+16808
-17225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,112 files changed

+16808
-17225
lines changed

doc/testspecs/VK/apitests.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ tcu::TestStatus createSamplerTest (Context& context)
6868
const struct VkSamplerCreateInfo samplerInfo =
6969
{
7070
VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, // VkStructureType sType;
71-
DE_NULL, // const void* pNext;
71+
nullptr, // const void* pNext;
7272
VK_TEX_FILTER_NEAREST, // VkTexFilter magFilter;
7373
VK_TEX_FILTER_NEAREST, // VkTexFilter minFilter;
7474
VK_TEX_MIPMAP_MODE_BASE, // VkTexMipmapMode mipMode;

execserver/tools/xsMain.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int main(int argc, const char *const *argv)
6060
xs::PosixTestProcess testProcess;
6161

6262
// Set line buffered mode to stdout so executor gets any log messages in a timely manner.
63-
setvbuf(stdout, DE_NULL, _IOLBF, 4 * 1024);
63+
setvbuf(stdout, nullptr, _IOLBF, 4 * 1024);
6464
#endif
6565

6666
// Parse command line.

execserver/tools/xsTest.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void TestExecutor::runCases(const std::vector<TestCase *> &testCases)
252252
class FilePrinter : public de::Thread
253253
{
254254
public:
255-
FilePrinter(void) : m_curFile(DE_NULL)
255+
FilePrinter(void) : m_curFile(nullptr)
256256
{
257257
}
258258

@@ -271,7 +271,7 @@ class FilePrinter : public de::Thread
271271
while (deFile_read(m_curFile, &buf[0], (int64_t)sizeof(buf), &numRead) == DE_FILERESULT_SUCCESS)
272272
fwrite(&buf[0], 1, (size_t)numRead, stdout);
273273

274-
m_curFile = DE_NULL;
274+
m_curFile = nullptr;
275275
}
276276

277277
private:
@@ -283,7 +283,7 @@ bool TestExecutor::runCase(TestCase *testCase)
283283
printf("%s\n", testCase->getName());
284284

285285
bool success = false;
286-
deProcess *serverProc = DE_NULL;
286+
deProcess *serverProc = nullptr;
287287
FilePrinter stdoutPrinter;
288288
FilePrinter stderrPrinter;
289289

@@ -295,7 +295,7 @@ bool TestExecutor::runCase(TestCase *testCase)
295295
serverProc = deProcess_create();
296296
XS_CHECK(serverProc);
297297

298-
if (!deProcess_start(serverProc, cmdLine.c_str(), DE_NULL))
298+
if (!deProcess_start(serverProc, cmdLine.c_str(), nullptr))
299299
{
300300
string errMsg = deProcess_getLastError(serverProc);
301301
deProcess_destroy(serverProc);
@@ -972,18 +972,18 @@ void testProcFile (void)
972972
deDeleteFile("test.txt");
973973
deFile* file = deFile_create("test.txt", DE_FILEMODE_CREATE|DE_FILEMODE_WRITE);
974974
const char test[] = "Hello";
975-
XS_CHECK(deFile_write(file, test, sizeof(test), DE_NULL) == DE_FILERESULT_SUCCESS);
975+
XS_CHECK(deFile_write(file, test, sizeof(test), nullptr) == DE_FILERESULT_SUCCESS);
976976
deFile_destroy(file);
977977

978978
/* Read. */
979979
char buf[10] = { 0 };
980980
file = deFile_create("test.txt", DE_FILEMODE_OPEN|DE_FILEMODE_READ);
981-
XS_CHECK(deFile_read(file, buf, sizeof(test), DE_NULL) == DE_FILERESULT_SUCCESS);
981+
XS_CHECK(deFile_read(file, buf, sizeof(test), nullptr) == DE_FILERESULT_SUCCESS);
982982
printf("buf: %s\n", buf);
983983
deFile_destroy(file);
984984

985985
/* Process test. */
986-
deProcess* proc = deProcess_create("ls -lah /Users/pyry", DE_NULL);
986+
deProcess* proc = deProcess_create("ls -lah /Users/pyry", nullptr);
987987
deFile* out = deProcess_getStdOut(proc);
988988

989989
int64_t numRead = 0;

execserver/xsExecutionServer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ inline bool MessageBuilder::isComplete(void) const
4848

4949
const uint8_t *MessageBuilder::getMessageData(void) const
5050
{
51-
return m_buffer.size() > MESSAGE_HEADER_SIZE ? &m_buffer[MESSAGE_HEADER_SIZE] : DE_NULL;
51+
return m_buffer.size() > MESSAGE_HEADER_SIZE ? &m_buffer[MESSAGE_HEADER_SIZE] : nullptr;
5252
}
5353

5454
size_t MessageBuilder::getMessageDataSize(void) const
@@ -140,7 +140,7 @@ void ExecutionServer::connectionDone(ConnectionHandler *handler)
140140
ExecutionRequestHandler::ExecutionRequestHandler(ExecutionServer *server, de::Socket *socket)
141141
: ConnectionHandler(server, socket)
142142
, m_execServer(server)
143-
, m_testDriver(DE_NULL)
143+
, m_testDriver(nullptr)
144144
, m_bufferIn(RECV_BUFFER_SIZE)
145145
, m_bufferOut(SEND_BUFFER_SIZE)
146146
, m_run(false)
@@ -186,7 +186,7 @@ void ExecutionRequestHandler::handle(void)
186186
{
187187
}
188188
m_execServer->releaseTestDriver(m_testDriver);
189-
m_testDriver = DE_NULL;
189+
m_testDriver = nullptr;
190190
}
191191

192192
// Close connection.

execserver/xsPosixFileReader.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace xs
3030
namespace posix
3131
{
3232

33-
FileReader::FileReader(int blockSize, int numBlocks) : m_file(DE_NULL), m_buf(blockSize, numBlocks), m_isRunning(false)
33+
FileReader::FileReader(int blockSize, int numBlocks) : m_file(nullptr), m_buf(blockSize, numBlocks), m_isRunning(false)
3434
{
3535
}
3636

@@ -50,7 +50,7 @@ void FileReader::start(const char *filename)
5050
if (!deFile_setFlags(m_file, DE_FILE_NONBLOCKING))
5151
{
5252
deFile_destroy(m_file);
53-
m_file = DE_NULL;
53+
m_file = nullptr;
5454
XS_FAIL("Failed to set non-blocking mode");
5555
}
5656
#endif
@@ -105,7 +105,7 @@ void FileReader::stop(void)
105105

106106
// Destroy file.
107107
deFile_destroy(m_file);
108-
m_file = DE_NULL;
108+
m_file = nullptr;
109109

110110
// Reset buffer.
111111
m_buf.clear();

execserver/xsPosixTestProcess.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace xs
3737
namespace posix
3838
{
3939

40-
CaseListWriter::CaseListWriter(void) : m_file(DE_NULL), m_run(false)
40+
CaseListWriter::CaseListWriter(void) : m_file(nullptr), m_run(false)
4141
{
4242
}
4343

@@ -90,10 +90,10 @@ void CaseListWriter::stop(void)
9090
// Join thread.
9191
join();
9292

93-
m_file = DE_NULL;
93+
m_file = nullptr;
9494
}
9595

96-
PipeReader::PipeReader(ThreadedByteBuffer *dst) : m_file(DE_NULL), m_buf(dst)
96+
PipeReader::PipeReader(ThreadedByteBuffer *dst) : m_file(nullptr), m_buf(dst)
9797
{
9898
}
9999

@@ -158,13 +158,13 @@ void PipeReader::stop(void)
158158
// Join thread.
159159
join();
160160

161-
m_file = DE_NULL;
161+
m_file = nullptr;
162162
}
163163

164164
} // namespace posix
165165

166166
PosixTestProcess::PosixTestProcess(void)
167-
: m_process(DE_NULL)
167+
: m_process(nullptr)
168168
, m_processStartTime(0)
169169
, m_infoBuffer(INFO_BUFFER_BLOCK_SIZE, INFO_BUFFER_NUM_BLOCKS)
170170
, m_stdOutReader(&m_infoBuffer)
@@ -209,12 +209,12 @@ void PosixTestProcess::start(const char *name, const char *params, const char *w
209209

210210
try
211211
{
212-
m_process->start(cmdLine.c_str(), strlen(workingDir) > 0 ? workingDir : DE_NULL);
212+
m_process->start(cmdLine.c_str(), strlen(workingDir) > 0 ? workingDir : nullptr);
213213
}
214214
catch (const de::ProcessError &e)
215215
{
216216
delete m_process;
217-
m_process = DE_NULL;
217+
m_process = nullptr;
218218
throw TestProcessException(e.what());
219219
}
220220

@@ -286,7 +286,7 @@ void PosixTestProcess::cleanup(void)
286286
}
287287

288288
delete m_process;
289-
m_process = DE_NULL;
289+
m_process = nullptr;
290290
}
291291
}
292292

execserver/xsTcpServer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ TcpServer::TcpServer(deSocketFamily family, int port) : m_socket()
4444

4545
void TcpServer::runServer(void)
4646
{
47-
de::Socket *clientSocket = DE_NULL;
47+
de::Socket *clientSocket = nullptr;
4848
de::SocketAddress clientAddr;
4949

50-
while ((clientSocket = m_socket.accept(clientAddr)) != DE_NULL)
50+
while ((clientSocket = m_socket.accept(clientAddr)) != nullptr)
5151
{
52-
ConnectionHandler *handler = DE_NULL;
52+
ConnectionHandler *handler = nullptr;
5353

5454
try
5555
{

execserver/xsWin32TestProcess.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static std::string formatErrMsg(DWORD error, const char *msg)
5858
#endif
5959

6060
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
61-
error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&msgBuf, 0, DE_NULL) > 0)
61+
error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&msgBuf, 0, nullptr) > 0)
6262
str << msg << ", error " << error << ": " << msgBuf;
6363
else
6464
str << msg << ", error " << error;
@@ -354,8 +354,8 @@ void TestLogReader::start(const char *filename)
354354
{
355355
DE_ASSERT(m_logFile == INVALID_HANDLE_VALUE && !m_reader.isStarted());
356356

357-
m_logFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, DE_NULL,
358-
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, DE_NULL);
357+
m_logFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr,
358+
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, nullptr);
359359

360360
if (m_logFile == INVALID_HANDLE_VALUE)
361361
throw Error(GetLastError(), "Failed to open log file");
@@ -463,7 +463,7 @@ static void createPipeWithOverlappedIO(HANDLE *readHandleOut, HANDLE *writeHandl
463463
0, /* No sharing. */
464464
securityAttr, OPEN_EXISTING, /* Assume existing object. */
465465
FILE_ATTRIBUTE_NORMAL | writeMode, /* Open mode / flags. */
466-
DE_NULL /* Template file. */);
466+
nullptr /* Template file. */);
467467

468468
if (writeHandle == INVALID_HANDLE_VALUE)
469469
{
@@ -507,7 +507,7 @@ void Process::start(const char *commandLine, const char *workingDirectory)
507507
// Security attributes for inheriting handle.
508508
securityAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
509509
securityAttr.bInheritHandle = TRUE;
510-
securityAttr.lpSecurityDescriptor = DE_NULL;
510+
securityAttr.lpSecurityDescriptor = nullptr;
511511

512512
createPipeWithOverlappedIO(&stdInRead, &stdInWrite, 0, FILE_FLAG_OVERLAPPED, &securityAttr);
513513
createPipeWithOverlappedIO(&stdOutRead, &stdOutWrite, FILE_FLAG_OVERLAPPED, 0, &securityAttr);
@@ -525,7 +525,7 @@ void Process::start(const char *commandLine, const char *workingDirectory)
525525
startInfo.hStdInput = stdInRead;
526526
startInfo.dwFlags |= STARTF_USESTDHANDLES;
527527

528-
if (!CreateProcess(DE_NULL, (LPTSTR)commandLine, DE_NULL, DE_NULL, TRUE /* inherit handles */, 0, DE_NULL,
528+
if (!CreateProcess(nullptr, (LPTSTR)commandLine, nullptr, nullptr, TRUE /* inherit handles */, 0, nullptr,
529529
workingDirectory, &startInfo, &m_procInfo))
530530
throw Error(GetLastError(), "CreateProcess() failed");
531531
}
@@ -621,7 +621,7 @@ void Process::kill(void)
621621
} // namespace win32
622622

623623
Win32TestProcess::Win32TestProcess(void)
624-
: m_process(DE_NULL)
624+
: m_process(nullptr)
625625
, m_processStartTime(0)
626626
, m_infoBuffer(INFO_BUFFER_BLOCK_SIZE, INFO_BUFFER_NUM_BLOCKS)
627627
, m_stdOutReader(&m_infoBuffer)
@@ -677,12 +677,12 @@ void Win32TestProcess::start(const char *name, const char *params, const char *w
677677

678678
try
679679
{
680-
m_process->start(cmdLine.c_str(), strlen(workingDir) > 0 ? workingDir : DE_NULL);
680+
m_process->start(cmdLine.c_str(), strlen(workingDir) > 0 ? workingDir : nullptr);
681681
}
682682
catch (const std::exception &e)
683683
{
684684
delete m_process;
685-
m_process = DE_NULL;
685+
m_process = nullptr;
686686
throw TestProcessException(e.what());
687687
}
688688

@@ -742,7 +742,7 @@ void Win32TestProcess::cleanup(void)
742742
}
743743

744744
delete m_process;
745-
m_process = DE_NULL;
745+
m_process = nullptr;
746746
}
747747
}
748748

executor/tools/xeBatchResultToXml.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static void writeTestCaseListNode(const xe::TestNode *testNode, const ShortTestR
298298

299299
const xe::TestCase *testCase = static_cast<const xe::TestCase *>(testNode);
300300
ShortTestResultMap::const_iterator resultPos = resultMap.find(testCase);
301-
const xe::TestCaseResultHeader *result = resultPos != resultMap.end() ? resultPos->second : DE_NULL;
301+
const xe::TestCaseResultHeader *result = resultPos != resultMap.end() ? resultPos->second : nullptr;
302302

303303
DE_ASSERT(result);
304304

executor/tools/xeCommandLineExecutor.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ void registerOptions(de::cmdline::Parser &parser)
9898
<< Option<TestSet>("t", "testset", "Comma-separated list of include filters.", parseCommaSeparatedList)
9999
<< Option<ExcludeSet>("e", "exclude", "Comma-separated list of exclude filters.", parseCommaSeparatedList,
100100
"")
101-
<< Option<ContinueFile>(DE_NULL, "continue",
101+
<< Option<ContinueFile>(nullptr, "continue",
102102
"Continue execution by initializing results from existing test log.")
103103
<< Option<TestLogFile>("o", "out", "Output test log filename.", "TestLog.qpa")
104104
<< Option<InfoLogFile>("i", "info", "Output info log filename.", "InfoLog.txt")
105-
<< Option<Summary>(DE_NULL, "summary", "Print summary after running tests.", s_yesNo, "yes")
105+
<< Option<Summary>(nullptr, "summary", "Print summary after running tests.", s_yesNo, "yes")
106106
<< Option<BinaryName>("b", "binaryname", "Test binary path. Relative to working directory.", "<Unused>")
107107
<< Option<WorkingDir>("wd", "workdir", "Working directory for the test execution.", ".")
108-
<< Option<CmdLineArgs>(DE_NULL, "cmdline", "Additional command line arguments for the test binary.", "");
108+
<< Option<CmdLineArgs>(nullptr, "cmdline", "Additional command line arguments for the test binary.", "");
109109
}
110110

111111
} // namespace opt
@@ -459,7 +459,7 @@ xe::CommLink *createCommLink(const CommandLine &cmdLine)
459459
xe::LocalTcpIpLink *link = new xe::LocalTcpIpLink();
460460
try
461461
{
462-
link->start(cmdLine.serverBinOrAddress.c_str(), DE_NULL, cmdLine.port);
462+
link->start(cmdLine.serverBinOrAddress.c_str(), nullptr, cmdLine.port);
463463
return link;
464464
}
465465
catch (...)
@@ -500,13 +500,13 @@ xe::CommLink *createCommLink(const CommandLine &cmdLine)
500500
else
501501
{
502502
DE_ASSERT(false);
503-
return DE_NULL;
503+
return nullptr;
504504
}
505505
}
506506

507507
#if (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_ANDROID)
508508

509-
static xe::BatchExecutor *s_executor = DE_NULL;
509+
static xe::BatchExecutor *s_executor = nullptr;
510510

511511
void signalHandler(int, siginfo_t *, void *)
512512
{
@@ -523,7 +523,7 @@ void setupSignalHandler(xe::BatchExecutor *executor)
523523
sa.sa_flags = SA_SIGINFO | SA_RESTART;
524524
sigfillset(&sa.sa_mask);
525525

526-
sigaction(SIGINT, &sa, DE_NULL);
526+
sigaction(SIGINT, &sa, nullptr);
527527
}
528528

529529
void resetSignalHandler(void)
@@ -534,13 +534,13 @@ void resetSignalHandler(void)
534534
sa.sa_flags = SA_RESTART;
535535
sigfillset(&sa.sa_mask);
536536

537-
sigaction(SIGINT, &sa, DE_NULL);
538-
s_executor = DE_NULL;
537+
sigaction(SIGINT, &sa, nullptr);
538+
s_executor = nullptr;
539539
}
540540

541541
#elif (DE_OS == DE_OS_WIN32)
542542

543-
static xe::BatchExecutor *s_executor = DE_NULL;
543+
static xe::BatchExecutor *s_executor = nullptr;
544544

545545
void signalHandler(int)
546546
{
@@ -557,7 +557,7 @@ void setupSignalHandler(xe::BatchExecutor *executor)
557557
void resetSignalHandler(void)
558558
{
559559
signal(SIGINT, SIG_DFL);
560-
s_executor = DE_NULL;
560+
s_executor = nullptr;
561561
}
562562

563563
#else

0 commit comments

Comments
 (0)