mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-06 16:21:50 +00:00
checkpatch: warn about uses of strcmp()/g_strcmp0()
Using strcmp()/g_strcmp0() for checking for string equality is hard to read. We should prefer our streq variants -- unless, you really mean cmp.
This commit is contained in:
parent
4d3de2721d
commit
23a200d19e
|
@ -190,6 +190,7 @@ complain ("XXX marker are reserved for development while work-in-progress. Use T
|
|||
complain ("This gtk-doc annotation looks wrong") if $line =~ /\*.*\( *(transfer-(none|container|full)|allow none) *\) *(:|\()/;
|
||||
complain ("Prefer nm_assert() or g_return*() to g_assert*()") if $line =~ /g_assert/ and (not $filename =~ /\/tests\//) and (not $filename =~ /\/nm-test-/);
|
||||
complain ("Use gs_free_error with GError variables") if $line =~ /\bgs_free\b +GError *\*/;
|
||||
complain ("Don't use strcmp/g_strcmp0 unless you need to sort. Consider nm_streq()/nm_streq0(),NM_IN_STRSET() for testing equality") if $line =~ /\b(strcmp|g_strcmp0)\b/;
|
||||
#complain ("Use spaces instead of tabs") if $line =~ /\t/;
|
||||
|
||||
# Further on we process stuff without comments.
|
||||
|
|
Loading…
Reference in a new issue