diff --git a/Code/GraphMol/FilterCatalog/Filters.cpp b/Code/GraphMol/FilterCatalog/Filters.cpp index df61a5664a7..aa002426b61 100644 --- a/Code/GraphMol/FilterCatalog/Filters.cpp +++ b/Code/GraphMol/FilterCatalog/Filters.cpp @@ -532,7 +532,7 @@ const FilterData_t *GetFilterData(FilterCatalogParams::FilterCatalogs catalog) { case FilterCatalogParams::CHEMBL_LINT: return CHEMBL_LINT; default: - return 0; + return nullptr; } } @@ -599,7 +599,7 @@ const FilterProperty_t *GetFilterProperties( case FilterCatalogParams::CHEMBL_LINT: return CHEMBL_LINT_PROPS; default: - return 0; + return nullptr; } } } // namespace RDKit diff --git a/Code/GraphMol/NontetrahedralStereo.cpp b/Code/GraphMol/NontetrahedralStereo.cpp index 8df1cbc0ec7..97c48911994 100644 --- a/Code/GraphMol/NontetrahedralStereo.cpp +++ b/Code/GraphMol/NontetrahedralStereo.cpp @@ -443,7 +443,7 @@ Bond *getTrigonalBipyramidalAxialBond(const Atom *cen, int axial) { unsigned int perm = 0; cen->getPropIfPresent(RDKit::common_properties::_chiralPermutation, perm); - if (perm == 0 || perm > 20) return 0; + if (perm == 0 || perm > 20) return nullptr; unsigned int idx = (axial != -1) ? trigonalbipyramidal_axial[perm][0] : trigonalbipyramidal_axial[perm][1]; diff --git a/Code/GraphMol/SmilesParse/lex.yysmarts.cpp.cmake b/Code/GraphMol/SmilesParse/lex.yysmarts.cpp.cmake index 60389c0f4fb..bec2ec0a604 100644 --- a/Code/GraphMol/SmilesParse/lex.yysmarts.cpp.cmake +++ b/Code/GraphMol/SmilesParse/lex.yysmarts.cpp.cmake @@ -2152,7 +2152,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; + b->yy_ch_buf = nullptr; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -2497,7 +2497,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf , yyscanner ); @@ -2571,7 +2571,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (new_buffer == NULL) + if (new_buffer == nullptr) return; yyensure_buffer_stack(yyscanner); @@ -2606,7 +2606,7 @@ void yypop_buffer_state (yyscan_t yyscanner) return; yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; + YY_CURRENT_BUFFER_LVALUE = nullptr; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; @@ -2677,7 +2677,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann 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 ); if ( ! b ) @@ -2686,7 +2686,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann 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_input_file = nullptr; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -2985,14 +2985,14 @@ void yyset_lval (YYSTYPE * yylval_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; } @@ -3016,14 +3016,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; } @@ -3044,24 +3044,24 @@ static int yy_init_globals (yyscan_t yyscanner) * 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 @@ -3078,17 +3078,17 @@ 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; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ @@ -3096,7 +3096,7 @@ int yylex_destroy (yyscan_t yyscanner) /* Destroy the main struct (reentrant only). */ yyfree ( yyscanner , yyscanner ); - yyscanner = NULL; + yyscanner = nullptr; return 0; } diff --git a/Code/GraphMol/SmilesParse/lex.yysmiles.cpp.cmake b/Code/GraphMol/SmilesParse/lex.yysmiles.cpp.cmake index 674b250d21e..990e76bbf43 100644 --- a/Code/GraphMol/SmilesParse/lex.yysmiles.cpp.cmake +++ b/Code/GraphMol/SmilesParse/lex.yysmiles.cpp.cmake @@ -2215,7 +2215,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; + b->yy_ch_buf = nullptr; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -2560,7 +2560,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf , yyscanner ); @@ -2634,7 +2634,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (new_buffer == NULL) + if (new_buffer == nullptr) return; yyensure_buffer_stack(yyscanner); @@ -2669,7 +2669,7 @@ void yypop_buffer_state (yyscan_t yyscanner) return; yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; + YY_CURRENT_BUFFER_LVALUE = nullptr; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; @@ -2740,7 +2740,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann 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 ); if ( ! b ) @@ -2749,7 +2749,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann 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_input_file = nullptr; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -3007,14 +3007,14 @@ void yyset_lval (YYSTYPE * yylval_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; } @@ -3038,14 +3038,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; } @@ -3066,24 +3066,24 @@ static int yy_init_globals (yyscan_t yyscanner) * 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 @@ -3100,17 +3100,17 @@ 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; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ @@ -3118,7 +3118,7 @@ int yylex_destroy (yyscan_t yyscanner) /* Destroy the main struct (reentrant only). */ yyfree ( yyscanner , yyscanner ); - yyscanner = NULL; + yyscanner = nullptr; return 0; } diff --git a/Code/JavaWrappers/MorganFingerprints.h b/Code/JavaWrappers/MorganFingerprints.h index 5af5401b9c3..faef95e6c17 100644 --- a/Code/JavaWrappers/MorganFingerprints.h +++ b/Code/JavaWrappers/MorganFingerprints.h @@ -14,8 +14,8 @@ RDKit::SparseIntVect *getFeatureFingerprint( RDKit::MorganFingerprints::getFeatureInvariants(mol, *invars); RDKit::SparseIntVect *res = RDKit::MorganFingerprints::getFingerprint( - mol, static_cast(radius), invars, 0, useChirality, - useBondTypes, useCounts, false, 0); + mol, static_cast(radius), invars, nullptr, useChirality, + useBondTypes, useCounts, false, nullptr); delete invars; return res; } diff --git a/Code/RDGeneral/LocaleSwitcher.cpp b/Code/RDGeneral/LocaleSwitcher.cpp index 581f5d4a450..23a9ebd1f28 100644 --- a/Code/RDGeneral/LocaleSwitcher.cpp +++ b/Code/RDGeneral/LocaleSwitcher.cpp @@ -123,7 +123,7 @@ class LocaleSwitcherImpl { // set locale for this thread if (!recurseLocale(CurrentState)) { - auto loc = newlocale(LC_ALL_MASK, "C", (locale_t)0); + auto loc = newlocale(LC_ALL_MASK, "C", (locale_t) nullptr); old_loc = uselocale(loc); recurseLocale(SwitchLocale); switched = true; diff --git a/Code/SimDivPickers/LeaderPicker.h b/Code/SimDivPickers/LeaderPicker.h index 78f98467809..76afa99dddb 100644 --- a/Code/SimDivPickers/LeaderPicker.h +++ b/Code/SimDivPickers/LeaderPicker.h @@ -216,14 +216,14 @@ struct LeaderPickerState { // InitializeThreads if (nt > 1) { nthreads = nt; - pthread_barrier_init(&wait, NULL, nthreads + 1); - pthread_barrier_init(&done, NULL, nthreads + 1); + pthread_barrier_init(&wait, nullptr, nthreads + 1); + pthread_barrier_init(&done, nullptr, nthreads + 1); threads.resize(nt); for (unsigned int i = 0; i < nthreads; i++) { threads[i].id = i; threads[i].stat = this; - pthread_create(&threads[i].tid, NULL, LeaderPickerWork, + pthread_create(&threads[i].tid, nullptr, LeaderPickerWork, (void *)&threads[i]); } } else { @@ -236,7 +236,7 @@ struct LeaderPickerState { thread_op = 1; pthread_barrier_wait(&wait); for (unsigned int i = 0; i < nthreads; i++) { - pthread_join(threads[i].tid, 0); + pthread_join(threads[i].tid, nullptr); } pthread_barrier_destroy(&wait); pthread_barrier_destroy(&done); @@ -339,7 +339,7 @@ void *LeaderPickerWork(void *arg) { for (;;) { pthread_barrier_wait(&stat->wait); if (stat->thread_op) { - return (void *)0; + return (void *)nullptr; } stat->compact_job(thread->id); pthread_barrier_wait(&stat->done);