Replace all NULL with nullptr

Bug: angleproject:1695

Change-Id: Ide0591ffdad5815385a4d805b320a32533bcc03a
Reviewed-on: https://chromium-review.googlesource.com/883681
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Luc Ferron <lucferron@google.com>
diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
index d8a9b9a..f2ac6c4 100644
--- a/src/compiler/preprocessor/Tokenizer.cpp
+++ b/src/compiler/preprocessor/Tokenizer.cpp
@@ -49,253 +49,210 @@
 #define yy_create_buffer pp_create_buffer
 #endif
 
-    
 #ifdef yy_delete_buffer
 #define pp_delete_buffer_ALREADY_DEFINED
 #else
 #define yy_delete_buffer pp_delete_buffer
 #endif
 
-    
 #ifdef yy_scan_buffer
 #define pp_scan_buffer_ALREADY_DEFINED
 #else
 #define yy_scan_buffer pp_scan_buffer
 #endif
 
-    
 #ifdef yy_scan_string
 #define pp_scan_string_ALREADY_DEFINED
 #else
 #define yy_scan_string pp_scan_string
 #endif
 
-    
 #ifdef yy_scan_bytes
 #define pp_scan_bytes_ALREADY_DEFINED
 #else
 #define yy_scan_bytes pp_scan_bytes
 #endif
 
-    
 #ifdef yy_init_buffer
 #define pp_init_buffer_ALREADY_DEFINED
 #else
 #define yy_init_buffer pp_init_buffer
 #endif
 
-    
 #ifdef yy_flush_buffer
 #define pp_flush_buffer_ALREADY_DEFINED
 #else
 #define yy_flush_buffer pp_flush_buffer
 #endif
 
-    
 #ifdef yy_load_buffer_state
 #define pp_load_buffer_state_ALREADY_DEFINED
 #else
 #define yy_load_buffer_state pp_load_buffer_state
 #endif
 
-    
 #ifdef yy_switch_to_buffer
 #define pp_switch_to_buffer_ALREADY_DEFINED
 #else
 #define yy_switch_to_buffer pp_switch_to_buffer
 #endif
 
-    
 #ifdef yypush_buffer_state
 #define pppush_buffer_state_ALREADY_DEFINED
 #else
 #define yypush_buffer_state pppush_buffer_state
 #endif
 
-    
 #ifdef yypop_buffer_state
 #define pppop_buffer_state_ALREADY_DEFINED
 #else
 #define yypop_buffer_state pppop_buffer_state
 #endif
 
-    
 #ifdef yyensure_buffer_stack
 #define ppensure_buffer_stack_ALREADY_DEFINED
 #else
 #define yyensure_buffer_stack ppensure_buffer_stack
 #endif
 
-    
 #ifdef yylex
 #define pplex_ALREADY_DEFINED
 #else
 #define yylex pplex
 #endif
 
-    
 #ifdef yyrestart
 #define pprestart_ALREADY_DEFINED
 #else
 #define yyrestart pprestart
 #endif
 
-    
 #ifdef yylex_init
 #define pplex_init_ALREADY_DEFINED
 #else
 #define yylex_init pplex_init
 #endif
 
-    
 #ifdef yylex_init_extra
 #define pplex_init_extra_ALREADY_DEFINED
 #else
 #define yylex_init_extra pplex_init_extra
 #endif
 
-    
 #ifdef yylex_destroy
 #define pplex_destroy_ALREADY_DEFINED
 #else
 #define yylex_destroy pplex_destroy
 #endif
 
-    
 #ifdef yyget_debug
 #define ppget_debug_ALREADY_DEFINED
 #else
 #define yyget_debug ppget_debug
 #endif
 
-    
 #ifdef yyset_debug
 #define ppset_debug_ALREADY_DEFINED
 #else
 #define yyset_debug ppset_debug
 #endif
 
-    
 #ifdef yyget_extra
 #define ppget_extra_ALREADY_DEFINED
 #else
 #define yyget_extra ppget_extra
 #endif
 
-    
 #ifdef yyset_extra
 #define ppset_extra_ALREADY_DEFINED
 #else
 #define yyset_extra ppset_extra
 #endif
 
-    
 #ifdef yyget_in
 #define ppget_in_ALREADY_DEFINED
 #else
 #define yyget_in ppget_in
 #endif
 
-    
 #ifdef yyset_in
 #define ppset_in_ALREADY_DEFINED
 #else
 #define yyset_in ppset_in
 #endif
 
-    
 #ifdef yyget_out
 #define ppget_out_ALREADY_DEFINED
 #else
 #define yyget_out ppget_out
 #endif
 
-    
 #ifdef yyset_out
 #define ppset_out_ALREADY_DEFINED
 #else
 #define yyset_out ppset_out
 #endif
 
-    
 #ifdef yyget_leng
 #define ppget_leng_ALREADY_DEFINED
 #else
 #define yyget_leng ppget_leng
 #endif
 
-    
 #ifdef yyget_text
 #define ppget_text_ALREADY_DEFINED
 #else
 #define yyget_text ppget_text
 #endif
 
-    
 #ifdef yyget_lineno
 #define ppget_lineno_ALREADY_DEFINED
 #else
 #define yyget_lineno ppget_lineno
 #endif
 
-    
 #ifdef yyset_lineno
 #define ppset_lineno_ALREADY_DEFINED
 #else
 #define yyset_lineno ppset_lineno
 #endif
 
-    
-        
 #ifdef yyget_column
 #define ppget_column_ALREADY_DEFINED
 #else
 #define yyget_column ppget_column
 #endif
 
-        
 #ifdef yyset_column
 #define ppset_column_ALREADY_DEFINED
 #else
 #define yyset_column ppset_column
 #endif
 
-    
-    
 #ifdef yywrap
 #define ppwrap_ALREADY_DEFINED
 #else
 #define yywrap ppwrap
 #endif
 
-
-
-
-    
 #ifdef yyget_lval
 #define ppget_lval_ALREADY_DEFINED
 #else
 #define yyget_lval ppget_lval
 #endif
 
-    
 #ifdef yyset_lval
 #define ppset_lval_ALREADY_DEFINED
 #else
 #define yyset_lval ppset_lval
 #endif
 
-
-
-
-    
 #ifdef yyget_lloc
 #define ppget_lloc_ALREADY_DEFINED
 #else
 #define yyget_lloc ppget_lloc
 #endif
 
-    
 #ifdef yyset_lloc
 #define ppset_lloc_ALREADY_DEFINED
 #else
@@ -311,14 +268,12 @@
 #define yyalloc ppalloc
 #endif
 
-    
 #ifdef yyrealloc
 #define pprealloc_ALREADY_DEFINED
 #else
 #define yyrealloc pprealloc
 #endif
 
-    
 #ifdef yyfree
 #define ppfree_ALREADY_DEFINED
 #else
@@ -353,7 +308,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -370,7 +325,7 @@
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -535,10 +490,10 @@
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
-    
+
     #define YY_LESS_LINENO(n)
     #define YY_LINENO_REWIND_TO(ptr)
-    
+
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
@@ -1020,19 +975,11 @@
 
 static int yy_init_globals ( yyscan_t yyscanner );
 
-
-
-
-    
     /* This must go here because YYSTYPE and YYLTYPE are included
      * from bison output in section 1.*/
     #    define yylval yyg->yylval_r
-    
 
-    
     #    define yylloc yyg->yylloc_r
-    
-
 
 int yylex_init (yyscan_t* scanner);
 
@@ -1113,15 +1060,9 @@
 
 void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
 
-
-    
        YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
-    
 
-    
         void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
-    
-
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -1136,7 +1077,7 @@
 #endif
 
 #ifndef YY_NO_UNPUT
-    
+
 #endif
 
 
@@ -1255,22 +1196,6 @@
 #ifndef YY_DECL
 #define YY_DECL_IS_OURS 1
 
-
-
-
-
-
-        
-    
-    
-
-
-
-    
-    
-    
-
-
 extern int yylex \
                (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
 
@@ -2200,8 +2125,8 @@
     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
-    
-	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
+
+        b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
@@ -2267,12 +2192,9 @@
         b->yy_bs_column = 0;
     }
 
-
-    
         b->yy_is_interactive = 0;
-    
 
-	errno = oerrno;
+        errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
@@ -2312,18 +2234,18 @@
 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-	if (new_buffer == NULL)
-		return;
+    if (new_buffer == nullptr)
+        return;
 
-	yyensure_buffer_stack(yyscanner);
+    yyensure_buffer_stack(yyscanner);
 
-	/* This block is copied from yy_switch_to_buffer. */
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*yyg->yy_c_buf_p = yyg->yy_hold_char;
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+    /* This block is copied from yy_switch_to_buffer. */
+    if (YY_CURRENT_BUFFER)
+    {
+        /* Flush out information for old buffer. */
+        *yyg->yy_c_buf_p                     = yyg->yy_hold_char;
+        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
 
 	/* Only push if top exists. Otherwise, replace top. */
@@ -2348,8 +2270,8 @@
 		return;
 
 	yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
-	YY_CURRENT_BUFFER_LVALUE = NULL;
-	if (yyg->yy_buffer_stack_top > 0)
+        YY_CURRENT_BUFFER_LVALUE = nullptr;
+        if (yyg->yy_buffer_stack_top > 0)
 		--yyg->yy_buffer_stack_top;
 
 	if (YY_CURRENT_BUFFER) {
@@ -2420,22 +2342,22 @@
 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
-    
-	if ( size < 2 ||
+
+        if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
 		/* They forgot to leave room for the EOB's. */
-		return NULL;
+                return nullptr;
 
-	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
+        b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
 
 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
 	b->yy_buf_pos = b->yy_ch_buf = base;
 	b->yy_is_our_buffer = 0;
-	b->yy_input_file = NULL;
-	b->yy_n_chars = b->yy_buf_size;
+        b->yy_input_file             = nullptr;
+        b->yy_n_chars = b->yy_buf_size;
 	b->yy_is_interactive = 0;
 	b->yy_at_bol = 1;
 	b->yy_fill_buffer = 0;
@@ -2459,8 +2381,8 @@
  */
 YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
 {
-    
-	return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
+
+        return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
 }
 
 
@@ -2479,8 +2401,8 @@
 	char *buf;
 	yy_size_t n;
 	int i;
-    
-	/* Get memory for full buffer, including space for trailing EOB's. */
+
+        /* Get memory for full buffer, including space for trailing EOB's. */
 	n = (yy_size_t) (_yybytes_len + 2);
 	buf = (char *) yyalloc( n , yyscanner );
 	if ( ! buf )
@@ -2565,10 +2487,9 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    
         if (! YY_CURRENT_BUFFER)
             return 0;
-    
+
     return yylineno;
 }
 
@@ -2582,10 +2503,9 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    
         if (! YY_CURRENT_BUFFER)
             return 0;
-    
+
     return yycolumn;
 }
 
@@ -2656,11 +2576,10 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
            YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
-    
+
     yylineno = _line_number;
 }
 
@@ -2675,11 +2594,10 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
            YY_FATAL_ERROR( "yyset_column called with no buffer" );
-    
+
     yycolumn = _column_no;
 }
 
@@ -2742,26 +2660,17 @@
     yylval = yylval_param;
 }
 
-
-
-    
 YYLTYPE *yyget_lloc  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yylloc;
 }
-    
 
-    
 void yyset_lloc (YYLTYPE *  yylloc_param , yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     yylloc = yylloc_param;
 }
-    
-
-
-
 
 /* User-visible API */
 
@@ -2771,14 +2680,16 @@
  */
 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;
     }
@@ -2803,14 +2714,16 @@
 
     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;
     }
@@ -2832,31 +2745,25 @@
      * This function is called from yylex_destroy(), so don't allocate here.
      */
 
-
-    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;
 
 /* Defined in main.c */
 #ifdef YY_STDINIT
     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
@@ -2874,30 +2781,26 @@
     /* Pop the buffer stack, destroying each element. */
 	while(YY_CURRENT_BUFFER){
 		yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
-		yypop_buffer_state(yyscanner);
+                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. */
+        /* Destroy the start condition stack. */
         yyfree( yyg->yy_start_stack , yyscanner );
-        yyg->yy_start_stack = NULL;
+        yyg->yy_start_stack = nullptr;
 
+        /* Reset the globals. This is important in a non-reentrant scanner so the next time
+         * yylex() is called, initialization will occur. */
+        yy_init_globals(yyscanner);
 
-
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * yylex() is called, initialization will occur. */
-    yy_init_globals( yyscanner);
-
-    /* Destroy the main struct (reentrant only). */
-    yyfree ( yyscanner , yyscanner );
-    yyscanner = NULL;
-    return 0;
+        /* Destroy the main struct (reentrant only). */
+        yyfree(yyscanner, yyscanner);
+        yyscanner = nullptr;
+        return 0;
 }