mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-14 20:18:39 +00:00
checkpatch: encourage g_snprintf() over snprintf()
The only reason is consistency. The majority of times we do use g_snprintf(). As there are no strong reasons to prefer one over the other, prefer the one that use use most of the time.
This commit is contained in:
parent
27427bad90
commit
3a39ce6a99
|
@ -192,6 +192,7 @@ complain ("Prefer nm_assert() or g_return*() to g_assert*()") if $line =~ /g_ass
|
||||||
complain ("Use gs_free_error with GError variables") if $line =~ /\bgs_free\b +GError *\*/;
|
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 ("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 ("Don't use API that uses the numeric source id. Instead, use GSource and API like nm_g_idle_add(), nm_g_idle_add_source(), nm_clear_g_source_inst(), etc.") if $line =~ /\b(g_idle_add|g_idle_add_full|g_timeout_add|g_timeout_add_seconds|g_source_remove|nm_clear_g_source)\b/;
|
complain ("Don't use API that uses the numeric source id. Instead, use GSource and API like nm_g_idle_add(), nm_g_idle_add_source(), nm_clear_g_source_inst(), etc.") if $line =~ /\b(g_idle_add|g_idle_add_full|g_timeout_add|g_timeout_add_seconds|g_source_remove|nm_clear_g_source)\b/;
|
||||||
|
complain ("Prefer g_snprintf() over snprintf() (for consistency)") if $line =~ /\b(snprintf)\b/;
|
||||||
#complain ("Use spaces instead of tabs") if $line =~ /\t/;
|
#complain ("Use spaces instead of tabs") if $line =~ /\t/;
|
||||||
|
|
||||||
# Further on we process stuff without comments.
|
# Further on we process stuff without comments.
|
||||||
|
|
Loading…
Reference in a new issue