mirror of
https://github.com/transmission/transmission
synced 2025-01-03 05:25:52 +00:00
build: have clang-tidy check for NULL in libtransmission (#1945)
This commit is contained in:
parent
5947329a51
commit
65a3a7d042
3 changed files with 9 additions and 2 deletions
7
libtransmission/.clang-tidy
Normal file
7
libtransmission/.clang-tidy
Normal 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
|
||||||
|
|
|
@ -1140,7 +1140,7 @@ static void sessionSetImpl(void* vdata)
|
||||||
tr_sessionSetScriptEnabled(session, TR_SCRIPT_ON_TORRENT_ADDED, boolVal);
|
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);
|
tr_sessionSetScript(session, TR_SCRIPT_ON_TORRENT_ADDED, strVal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,7 +296,7 @@ int tr_lpdInit(tr_session* ss, [[maybe_unused]] tr_address* tr_addr)
|
||||||
* string handling in tr_lpdSendAnnounce() and tr_lpdConsiderAnnounce().
|
* string handling in tr_lpdSendAnnounce() and tr_lpdConsiderAnnounce().
|
||||||
* However, the code should work as long as interfaces to the rest of
|
* However, the code should work as long as interfaces to the rest of
|
||||||
* libtransmission are compatible with char* strings. */
|
* 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;
|
struct ip_mreq mcastReq;
|
||||||
int const opt_on = 1;
|
int const opt_on = 1;
|
||||||
|
|
Loading…
Reference in a new issue