Use C++11 nullptr instead of 0 or NULL (#2234)

This improves type-safety.
This commit is contained in:
Andrew Gaul
2023-07-27 21:56:58 +09:00
committed by GitHub
parent 0ece204393
commit a4a2841c05
46 changed files with 537 additions and 538 deletions

View File

@ -65,7 +65,7 @@ struct curl_slist* curl_slist_sort_insert(struct curl_slist* list, const char* k
std::string strval = value ? trim(std::string(value)) : "";
std::string strnew = key + std::string(": ") + strval;
char* data;
if(NULL == (data = strdup(strnew.c_str()))){
if(nullptr == (data = strdup(strnew.c_str()))){
return list;
}
@ -88,7 +88,7 @@ struct curl_slist* curl_slist_sort_insert(struct curl_slist* list, const char* k
}
struct curl_slist* new_item;
if(NULL == (new_item = static_cast<struct curl_slist*>(malloc(sizeof(*new_item))))){
if(nullptr == (new_item = static_cast<struct curl_slist*>(malloc(sizeof(*new_item))))){
free(data);
return list;
}
@ -303,7 +303,7 @@ bool make_md5_from_binary(const char* pstr, size_t length, std::string& md5)
return false;
}
FILE* fp;
if(NULL == (fp = tmpfile())){
if(nullptr == (fp = tmpfile())){
S3FS_PRN_ERR("Could not make tmpfile.");
return false;
}