fix one more clang-tidy issue

This commit is contained in:
Bharat Nallan Chakravarthy 2023-09-04 17:06:37 -07:00
parent 2efa7a51ff
commit 4bf96522d5
2 changed files with 6 additions and 3 deletions

View File

@ -22,8 +22,11 @@ if (USE_GPERF)
BYPRODUCTS "${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.gperf"
)
add_custom_target(generate-tldlookup ${GPERF} tldLookup.gperf --output-file=tldLookup.generated.cpp && clang-format -i tldLookup.generated.cpp
# for clang-tidy, since string.h is deprecated
&& sed -i 's/\#include <string.h>/\#include <cstring>/g' tldLookup.generated.cpp
# apply these clang-tidy fixes to the file generated by gperf:
# - use cstring since string.h is deprecated
# - return nullptr instead of 0
&& sed -i -e 's/\#include <string.h>/\#include <cstring>/g' tldLookup.generated.cpp -e 's/return 0\;/return nullptr\;/g' tldLookup.generated.cpp
SOURCES tldLookup.gperf
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# BYPRODUCTS "${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.generated.cpp"

View File

@ -110733,6 +110733,6 @@ const char * TopLevelDomainLookupHash::isValid(const char * str, size_t len)
return s;
}
}
return 0;
return nullptr;
}
#line 5060 "tldLookup.gperf"