Commit adcf0ae6 by Luc Ferron Committed by Commit Bot

Replace all NULL with nullptr

Bug: angleproject:1695 Change-Id: Ide0591ffdad5815385a4d805b320a32533bcc03a Reviewed-on: https://chromium-review.googlesource.com/883681Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@google.com>
parent 7e9b13b5
......@@ -424,7 +424,7 @@ struct yy_buffer_state
*/
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
: nullptr)
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
......@@ -3568,14 +3568,14 @@ void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
*/
int yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
if (ptr_yy_globals == nullptr){
errno = EINVAL;
return 1;
}
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), nullptr );
if (*ptr_yy_globals == NULL){
if (*ptr_yy_globals == nullptr){
errno = ENOMEM;
return 1;
}
......@@ -3600,14 +3600,14 @@ int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
if (ptr_yy_globals == nullptr){
errno = EINVAL;
return 1;
}
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
if (*ptr_yy_globals == NULL){
if (*ptr_yy_globals == nullptr){
errno = ENOMEM;
return 1;
}
......@@ -3632,17 +3632,17 @@ static int yy_init_globals (yyscan_t yyscanner)
yyg->yy_buffer_stack = NULL;
yyg->yy_buffer_stack = nullptr;
yyg->yy_buffer_stack_top = 0;
yyg->yy_buffer_stack_max = 0;
yyg->yy_c_buf_p = NULL;
yyg->yy_c_buf_p = nullptr;
yyg->yy_init = 0;
yyg->yy_start = 0;
yyg->yy_start_stack_ptr = 0;
yyg->yy_start_stack_depth = 0;
yyg->yy_start_stack = NULL;
yyg->yy_start_stack = nullptr;
......@@ -3654,8 +3654,8 @@ static int yy_init_globals (yyscan_t yyscanner)
yyin = stdin;
yyout = stdout;
#else
yyin = NULL;
yyout = NULL;
yyin = nullptr;
yyout = nullptr;
#endif
/* For future reference: Set errno on error, since we are called by
......@@ -3673,18 +3673,18 @@ int yylex_destroy (yyscan_t yyscanner)
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
YY_CURRENT_BUFFER_LVALUE = nullptr;
yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
yyg->yy_buffer_stack = nullptr;
/* Destroy the start condition stack. */
yyfree( yyg->yy_start_stack , yyscanner );
yyg->yy_start_stack = NULL;
yyg->yy_start_stack = nullptr;
......@@ -3695,7 +3695,7 @@ int yylex_destroy (yyscan_t yyscanner)
/* Destroy the main struct (reentrant only). */
yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
yyscanner = nullptr;
return 0;
}
......@@ -4006,7 +4006,7 @@ int yuvcscstandardext_constant(TParseContext *context)
}
int glslang_initialize(TParseContext* context) {
yyscan_t scanner = NULL;
yyscan_t scanner = nullptr;
if (yylex_init_extra(context, &scanner))
return 1;
......@@ -4016,9 +4016,9 @@ int glslang_initialize(TParseContext* context) {
int glslang_finalize(TParseContext* context) {
yyscan_t scanner = context->getScanner();
if (scanner == NULL) return 0;
if (scanner == nullptr) return 0;
context->setScanner(NULL);
context->setScanner(nullptr);
yylex_destroy(scanner);
return 0;
......@@ -4026,7 +4026,7 @@ int glslang_finalize(TParseContext* context) {
int glslang_scan(size_t count, const char* const string[], const int length[],
TParseContext* context) {
yyrestart(NULL, context->getScanner());
yyrestart(nullptr, context->getScanner());
yyset_column(0, context->getScanner());
yyset_lineno(1, context->getScanner());
......
......@@ -3203,7 +3203,7 @@ yyreduce:
{
ES3_OR_NEWER((yyvsp[-3].lex).string->c_str(), (yylsp[-4]), "interface blocks");
(yyval.interm.intermNode) = context->addInterfaceBlock(*(yyvsp[-4].interm.typeQualifierBuilder), (yylsp[-3]), *(yyvsp[-3].lex).string, (yyvsp[-2].interm.fieldList), NULL, (yyloc), NULL, (yyloc));
(yyval.interm.intermNode) = context->addInterfaceBlock(*(yyvsp[-4].interm.typeQualifierBuilder), (yylsp[-3]), *(yyvsp[-3].lex).string, (yyvsp[-2].interm.fieldList), nullptr, (yyloc), nullptr, (yyloc));
}
break;
......@@ -3212,7 +3212,7 @@ yyreduce:
{
ES3_OR_NEWER((yyvsp[-4].lex).string->c_str(), (yylsp[-5]), "interface blocks");
(yyval.interm.intermNode) = context->addInterfaceBlock(*(yyvsp[-5].interm.typeQualifierBuilder), (yylsp[-4]), *(yyvsp[-4].lex).string, (yyvsp[-3].interm.fieldList), (yyvsp[-1].lex).string, (yylsp[-1]), NULL, (yyloc));
(yyval.interm.intermNode) = context->addInterfaceBlock(*(yyvsp[-5].interm.typeQualifierBuilder), (yylsp[-4]), *(yyvsp[-4].lex).string, (yyvsp[-3].interm.fieldList), (yyvsp[-1].lex).string, (yylsp[-1]), nullptr, (yyloc));
}
break;
......
......@@ -3006,7 +3006,7 @@ TextureStorage *Renderer9::createTextureStorage2DMultisample(GLenum internalform
// 2D multisampled textures are not supported by the D3D9 backend.
UNREACHABLE();
return NULL;
return nullptr;
}
bool Renderer9::getLUID(LUID *adapterLuid) const
......
......@@ -2922,7 +2922,7 @@ bool ValidateFramebufferTextureBase(Context *context,
{
gl::Texture *tex = context->getTexture(texture);
if (tex == NULL)
if (tex == nullptr)
{
context->handleError(InvalidOperation());
return false;
......
......@@ -223,26 +223,26 @@ class MultiviewRenderTestBase : public MultiviewDrawTest
int textureWidth = viewWidth * numViews;
glBindTexture(GL_TEXTURE_2D, mColorTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, textureWidth, height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, NULL);
GL_UNSIGNED_BYTE, nullptr);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glBindTexture(GL_TEXTURE_2D, mDepthTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, textureWidth, height, 0,
GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
GL_DEPTH_COMPONENT, GL_FLOAT, nullptr);
glBindTexture(GL_TEXTURE_2D, 0);
break;
}
case GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE:
glBindTexture(GL_TEXTURE_2D_ARRAY, mColorTexture);
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA8, viewWidth, height, numLayers, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glBindTexture(GL_TEXTURE_2D_ARRAY, mDepthTexture);
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_DEPTH_COMPONENT32F, viewWidth, height,
numLayers, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
numLayers, 0, GL_DEPTH_COMPONENT, GL_FLOAT, nullptr);
glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
break;
default:
......@@ -483,7 +483,7 @@ class MultiviewRenderPrimitiveTest : public MultiviewRenderTest
glBufferData(GL_ARRAY_BUFFER, vertexData.size() * sizeof(Vector2), vertexData.data(),
GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, NULL);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
}
void checkGreenChannel(const GLubyte expectedGreenChannelData[])
......@@ -1703,7 +1703,7 @@ TEST_P(MultiviewSideBySideRenderTest, NoLeakingFragments)
glBufferData(GL_ARRAY_BUFFER, vertexDataInClipSpace.size() * sizeof(Vector2),
vertexDataInClipSpace.data(), GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, NULL);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
// Test rendering points.
{
......
......@@ -182,11 +182,11 @@ void MultiviewBenchmark::initializeBenchmark()
glBindTexture(GL_TEXTURE_2D, mColorTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, params->windowWidth, params->windowHeight, 0, GL_RGBA,
GL_UNSIGNED_BYTE, NULL);
GL_UNSIGNED_BYTE, nullptr);
glBindTexture(GL_TEXTURE_2D, mDepthTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, params->windowWidth, params->windowHeight,
0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
0, GL_DEPTH_COMPONENT, GL_FLOAT, nullptr);
glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
......
......@@ -272,7 +272,7 @@ TEST_F(LocationTest, LineOverflowRegular)
{
const char *str = "#line 0x7FFFFFFF\n\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
ASSERT_TRUE(mPreprocessor.init(1, &str, nullptr));
using testing::_;
// Error reported about EOF.
......@@ -287,7 +287,7 @@ TEST_F(LocationTest, LineOverflowInComment)
{
const char *str = "#line 0x7FFFFFFF\n/*\n*/";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
ASSERT_TRUE(mPreprocessor.init(1, &str, nullptr));
using testing::_;
// Error reported about EOF.
......@@ -303,7 +303,7 @@ TEST_F(LocationTest, LineOverflowInContinuationN)
{
const char *str = "#line 0x7FFFFFFF\n \\\n\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
ASSERT_TRUE(mPreprocessor.init(1, &str, nullptr));
using testing::_;
// Error reported about EOF.
......@@ -319,7 +319,7 @@ TEST_F(LocationTest, LineOverflowInContinuationRN)
{
const char *str = "#line 0x7FFFFFFF\n \\\r\n\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
ASSERT_TRUE(mPreprocessor.init(1, &str, nullptr));
using testing::_;
// Error reported about EOF.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment