if ($C && /\s(?:if|while|for|switch)\(/) {
print " KW(:$fn:$.\n";
}
- ## Warn about #else #if instead of #elif.
+ ## Warn about #else #if instead of #elif.
if (($lastline =~ /^\# *else/) and ($_ =~ /^\# *if/)) {
print " #else#if:$fn:$.\n";
}
+ ## Warn about some K&R violations
+ if (/^\s+\{/ and $lastline =~ /^\s*(if|while|for|else if)/ and
+ $lastline !~ /\{$/) {
+ print "non-K&R {:$fn:$.\n";
+ }
+ if (/^\s*else/ and $lastline =~ /\}$/) {
+ print " }\\nelse:$fn:$.\n";
+ }
$lastline = $_;
## Warn about unnecessary empty lines.
if ($lastnil && /^\s*}\n/) {
/* XXXipv6 we lack support for falling back to another address for
the same relay, warn the user */
- if (!tor_addr_is_null(&ri->ipv6_addr))
- {
+ if (!tor_addr_is_null(&ri->ipv6_addr)) {
tor_addr_port_t ap;
router_get_pref_orport(ri, &ap);
log_notice(LD_CONFIG,
// a file on a folder shared by the wm emulator.
// if no flashcard (real or emulated) is present,
// log files will be written in the root folder
- if (find_flashcard_path(path,MAX_PATH) == -1)
- {
+ if (find_flashcard_path(path,MAX_PATH) == -1) {
redir = _wfreopen( L"\\stdout.log", L"w", stdout );
redirdbg = _wfreopen( L"\\stderr.log", L"w", stderr );
} else {
{
if (node->ri) {
router_get_prim_orport(node->ri, ap_out);
- }
- else if (node->rs) {
+ } else if (node->rs) {
tor_addr_from_ipv4h(&ap_out->addr, node->rs->addr);
ap_out->port = node->rs->or_port;
}