build: have clang-tidy check for NULL in libtransmission (#1945)

This commit is contained in:
Charles Kerr 2021-10-13 18:12:51 -05:00 committed by GitHub
parent 5947329a51
commit 65a3a7d042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,7 @@
---
# Many of these checks are disabled only because the code hasn't been
# cleaned up yet. Pull requests welcomed.
Checks: >
modernize-use-nullptr,
modernize-use-override

View File

@ -1140,7 +1140,7 @@ static void sessionSetImpl(void* vdata)
tr_sessionSetScriptEnabled(session, TR_SCRIPT_ON_TORRENT_ADDED, boolVal);
}
if (tr_variantDictFindStr(settings, TR_KEY_script_torrent_added_filename, &strVal, NULL))
if (tr_variantDictFindStr(settings, TR_KEY_script_torrent_added_filename, &strVal, nullptr))
{
tr_sessionSetScript(session, TR_SCRIPT_ON_TORRENT_ADDED, strVal);
}

View File

@ -296,7 +296,7 @@ int tr_lpdInit(tr_session* ss, [[maybe_unused]] tr_address* tr_addr)
* string handling in tr_lpdSendAnnounce() and tr_lpdConsiderAnnounce().
* However, the code should work as long as interfaces to the rest of
* libtransmission are compatible with char* strings. */
TR_STATIC_ASSERT(sizeof(((struct tr_info*)0)->hashString[0]) == sizeof(char), "");
TR_STATIC_ASSERT(sizeof(((struct tr_info*)nullptr)->hashString[0]) == sizeof(char), "");
struct ip_mreq mcastReq;
int const opt_on = 1;