Run "make autostyle" in advance of new series.

This commit is contained in:
Nick Mathewson 2021-03-12 11:40:48 -05:00
parent b5d08ddc09
commit 444233c15e
27 changed files with 50 additions and 50 deletions

View File

@ -4958,9 +4958,9 @@ options_init_logs(const or_options_t *old_options, const or_options_t *options,
if (!validate_only) {
add_syslog_log(severity, options->SyslogIdentityTag);
}
#else
#else /* !defined(HAVE_SYSLOG_H) */
log_warn(LD_CONFIG, "The android logging API is no longer supported.");
#endif
#endif /* defined(HAVE_SYSLOG_H) */
goto cleanup;
}
}

View File

@ -852,4 +852,4 @@ resolve_addr_reset_suggested(int family)
tor_addr_make_unspec(&last_suggested_addrs[af_to_idx(family)]);
}
#endif /* TOR_UNIT_TESTS */
#endif /* defined(TOR_UNIT_TESTS) */

View File

@ -61,7 +61,7 @@ void resolve_addr_reset_suggested(int family);
#endif /* TOR_UNIT_TESTS */
#endif /* RESOLVE_ADDR_PRIVATE */
#endif /* defined(RESOLVE_ADDR_PRIVATE) */
#endif /* TOR_CONFIG_RESOLVE_ADDR_H */
#endif /* !defined(TOR_CONFIG_RESOLVE_ADDR_H) */

View File

@ -309,7 +309,7 @@ process_win32_console_ctrl(DWORD ctrl_type)
activate_signal(SIGINT);
return TRUE;
}
#endif
#endif /* defined(_WIN32) */
/**
* Write current memory usage information to the log.
@ -514,7 +514,7 @@ handle_signals(void)
* to handle control signals like Ctrl+C in the console, we can use this to
* simulate the SIGINT signal */
if (enabled) SetConsoleCtrlHandler(process_win32_console_ctrl, TRUE);
#endif
#endif /* defined(_WIN32) */
}
/* Cause the signal handler for signal_num to be called in the event loop. */

View File

@ -14,4 +14,4 @@
extern const char risky_option_list[];
#endif
#endif /* !defined(TOR_RISKY_OPTIONS_H) */

View File

@ -72,7 +72,7 @@
#include "core/or/or_handshake_state_st.h"
#include "feature/nodelist/routerinfo_st.h"
#include "core/or/var_cell_st.h"
#include "src/feature/relay/relay_find_addr.h"
#include "feature/relay/relay_find_addr.h"
#include "lib/tls/tortls.h"
#include "lib/tls/x509.h"

View File

@ -445,7 +445,7 @@ trailing_zeros(uint64_t x)
x>>=1;
}
return i;
#endif
#endif /* defined(__GNUC__) */
}
/**

View File

@ -25,6 +25,6 @@
#define TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#include "trace_probes_circuit.h"
#include "core/or/trace_probes_circuit.h"
#endif /* USE_TRACING_INSTRUMENTATION_LTTNG */
#endif /* defined(USE_TRACING_INSTRUMENTATION_LTTNG) */

View File

@ -19,4 +19,4 @@
#endif /* USE_TRACING_INSTRUMENTATION_LTTNG */
#endif /* TOR_TRACE_PROBES_CIRCUIT_H */
#endif /* !defined(TOR_TRACE_PROBES_CIRCUIT_H) */

View File

@ -52,7 +52,7 @@
#include "feature/nodelist/node_st.h"
#include "feature/nodelist/routerinfo_st.h"
#include "src/app/config/statefile.h"
#include "app/config/statefile.h"
static int control_setconf_helper(control_connection_t *conn,
const control_cmd_args_t *args,

View File

@ -183,9 +183,9 @@ static HT_HEAD(cdm_diff_ht, cdm_diff_t) cdm_diff_ht = HT_INITIALIZER();
// diff manager becomes larger than 64. To see if the issue goes away, we
// hardcode this value to 64 now while we investigate a better solution.
# define CACHE_MAX_NUM 64
#else
#else /* !defined(_WIN32) */
# define CACHE_MAX_NUM 128
#endif
#endif /* defined(_WIN32) */
/**
* Configuration for this module

View File

@ -46,6 +46,6 @@ typedef struct hs_metrics_entry_t {
extern const hs_metrics_entry_t base_metrics[];
extern const size_t base_metrics_size;
#endif /* HS_METRICS_ENTRY_PRIVATE */
#endif /* defined(HS_METRICS_ENTRY_PRIVATE) */
#endif /* !defined(TOR_FEATURE_HS_METRICS_ENTRY_H) */

View File

@ -93,7 +93,7 @@ STATIC int have_enough_mem_for_dircache(const struct or_options_t *options,
struct port_cfg_t;
STATIC const char *describe_relay_port(const struct port_cfg_t *port);
#endif /* TOR_UNIT_TESTS */
#endif /* defined(TOR_UNIT_TESTS) */
#endif /* defined(RELAY_CONFIG_PRIVATE) */

View File

@ -28,5 +28,5 @@ void relay_addr_learn_from_dirauth(void);
#endif /* RELAY_FIND_ADDR_PRIVATE */
#endif /* TOR_RELAY_FIND_ADDR_H */
#endif /* !defined(TOR_RELAY_FIND_ADDR_H) */

View File

@ -38,7 +38,7 @@ STATIC void add_obs(bw_array_t *b, time_t when, uint64_t n);
STATIC void bw_array_free_(bw_array_t *b);
STATIC size_t bwhist_fill_bandwidth_history(char *buf, size_t len,
const bw_array_t *b);
#endif /* defined(REPHIST_PRIVATE) */
#endif /* defined(BWHIST_PRIVATE) */
#ifdef TOR_UNIT_TESTS
extern struct bw_array_t *write_array;

View File

@ -145,6 +145,6 @@ struct hs_v2_stats_t;
const struct hs_v2_stats_t *rep_hist_get_hs_v2_stats(void);
struct hs_v3_stats_t;
const struct hs_v3_stats_t *rep_hist_get_hs_v3_stats(void);
#endif
#endif /* defined(TOR_UNIT_TESTS) */
#endif /* !defined(TOR_REPHIST_H) */

View File

@ -106,7 +106,7 @@ crypto_openssl_get_version_str(void)
#else
/* This old name was changed around OpenSSL 1.1.0 */
const int query = SSLEAY_VERSION;
#endif
#endif /* defined(OPENSSL_VERSION) */
if (crypto_openssl_version_str == NULL) {
const char *raw_version = OpenSSL_version(query);

View File

@ -571,7 +571,7 @@ wrap_closedir(void *arg)
{
closedir(arg);
}
#endif /* defined(HAVE_GLOB) */
#endif /* defined(_WIN32) || ... */
/** Return a new list containing the paths that match the pattern
* <b>pattern</b>. Return NULL on error. On POSIX systems, errno is set by the
@ -636,7 +636,7 @@ tor_glob(const char *pattern)
#else
(void)pattern;
return result;
#endif /* !defined(HAVE_GLOB) */
#endif /* defined(_WIN32) || ... */
return result;
}

View File

@ -258,7 +258,7 @@
abort()
#else
#define FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL FALLTHROUGH
#endif
#endif /* defined(ALL_BUGS_ARE_FATAL) */
/** In older code, we used tor_fragile_assert() to mark optional failure
* points. At these points, we could make some debug builds fail.

View File

@ -40,7 +40,7 @@ struct metrics_store_entry_t {
} u;
};
#endif /* METRICS_STORE_ENTRY_PRIVATE */
#endif /* defined(METRICS_STORE_ENTRY_PRIVATE) */
typedef struct metrics_store_entry_t metrics_store_entry_t;

View File

@ -734,7 +734,7 @@ sb_socket(scmp_filter_ctx ctx, sandbox_cfg_t *filter)
SCMP_CMP(2, SCMP_CMP_EQ, IPPROTO_IP));
if (rc)
return rc;
#endif
#endif /* defined(ENABLE_NSS) */
rc = seccomp_rule_add_3(ctx, SCMP_ACT_ALLOW, SCMP_SYS(socket),
SCMP_CMP(0, SCMP_CMP_EQ, PF_UNIX),
@ -1691,7 +1691,7 @@ get_syscall_from_ucontext(const ucontext_t *ctx)
{
return (int) ctx->uc_mcontext.M_SYSCALL;
}
#else
#else /* !defined(SYSCALL_NAME_DEBUGGING) */
static const char *
get_syscall_name(int syscall_num)
{
@ -1704,7 +1704,7 @@ get_syscall_from_ucontext(const ucontext_t *ctx)
(void) ctx;
return -1;
}
#endif
#endif /* defined(SYSCALL_NAME_DEBUGGING) */
#ifdef USE_BACKTRACE
#define MAX_DEPTH 256

View File

@ -80,7 +80,7 @@ struct tor_tls_t {
uint64_t last_write_count;
uint64_t last_read_count;
long last_error;
#endif
#endif /* defined(ENABLE_NSS) */
};
#endif /* !defined(TOR_TORTLS_ST_H) */

View File

@ -28,7 +28,7 @@
log_debug(LD_GENERAL, "Tracepoint \"" XSTR(event_name) "\" from " \
"subsystem \"" XSTR(subsystem) "\" hit.")
#else /* defined(USE_TRACING_INSTRUMENTATION_LOG_DEBUG) */
#else /* !defined(USE_TRACING_INSTRUMENTATION_LOG_DEBUG) */
/* NOP the debug event. */
#define TOR_TRACE_LOG_DEBUG(subsystem, name, ...)

View File

@ -26,7 +26,7 @@ tracing_log_warning(void)
"purpose, your tor is NOT safe to run.");
}
#else
#else /* !defined(HAVE_TRACING) */
/* NOP it. */
#define tracing_log_warning()

View File

@ -1215,7 +1215,7 @@ get_interface_address6_replacement(int severity, sa_family_t family,
return 0;
}
#endif
#endif /* 0 */
static int n_get_interface_address6_failure = 0;
@ -6041,7 +6041,7 @@ test_config_include_wildcards(void *data)
tt_ptr_op(result, OP_EQ, NULL);
tt_int_op(include_used, OP_EQ, 1);
config_free_lines(result);
#endif
#endif /* !defined(_WIN32) */
// test pattern *.conf
tor_snprintf(torrc_contents, sizeof(torrc_contents),
@ -6181,9 +6181,9 @@ test_config_include_hidden(void *data)
len++;
}
tt_int_op(len, OP_EQ, 1);
#else
#else /* !defined(_WIN32) */
tt_ptr_op(result, OP_EQ, NULL);
#endif
#endif /* defined(_WIN32) */
config_free_lines(result);
// test wildcards match hidden folders when explicitly in the pattern
@ -6993,7 +6993,7 @@ test_config_multifamily_port(void *arg)
#define CONFIG_TEST_SETUP(suffix, name, flags, setup, setup_data) \
{ #name#suffix, test_config_ ## name, flags, setup, setup_data }
#endif
#endif /* !defined(COCCI) */
struct testcase_t config_tests[] = {
CONFIG_TEST(adding_trusted_dir_server, TT_FORK),

View File

@ -650,7 +650,7 @@ test_protover_vote_roundtrip_ours(void *args)
*/
#define PROTOVER(proto_string, version_macro) \
(proto_string "=" STR(version_macro))
#endif
#endif /* defined(COCCI) */
#define DEBUG_PROTOVER(flags) \
STMT_BEGIN \

View File

@ -4532,7 +4532,7 @@ test_util_glob(void *ptr)
#else
const char *results_test3[] = {"dir1", "dir2", "file1", "file2",
"forbidden"};
#endif
#endif /* defined(_WIN32) */
TEST("*i*");
EXPECT(results_test3);
@ -4570,7 +4570,7 @@ test_util_glob(void *ptr)
const char *results_test10[] = {"file1"};
TEST("file1"PATH_SEPARATOR);
EXPECT(results_test10);
#endif
#endif /* defined(__APPLE__) || defined(__darwin__) || ... */
// test path separator at end - with wildcards and linux path separator
const char *results_test11[] = {"dir1", "dir2", "forbidden"};
@ -4584,7 +4584,7 @@ test_util_glob(void *ptr)
#else
const char *results_test12[] = {"dir1", "dir2", "empty", "file1", "file2",
"forbidden"};
#endif
#endif /* defined(_WIN32) */
TEST("*");
EXPECT(results_test12);
@ -4631,7 +4631,7 @@ test_util_glob(void *ptr)
tor_free(pattern);
tt_assert(!results);
}
#endif
#endif /* !defined(_WIN32) */
#undef TEST
#undef EXPECT
@ -4643,7 +4643,7 @@ test_util_glob(void *ptr)
(void) chmod(dir1_forbidden, 0700);
(void) chmod(dir2_forbidden, 0700);
(void) chmod(forbidden_forbidden, 0700);
#endif
#endif /* !defined(_WIN32) */
tor_free(dir1);
tor_free(dir2);
tor_free(forbidden);
@ -4657,11 +4657,11 @@ test_util_glob(void *ptr)
SMARTLIST_FOREACH(results, char *, f, tor_free(f));
smartlist_free(results);
}
#else
#else /* !defined(HAVE_GLOB) */
tt_skip();
done:
return;
#endif
#endif /* defined(HAVE_GLOB) */
}
static void
@ -4769,7 +4769,7 @@ test_util_get_glob_opened_files(void *ptr)
// dot files are not special on windows
const char *results_test3[] = {"", ".test-hidden", "dir1", "dir2", "empty",
"file1", "file2", "forbidden"};
#endif
#endif /* !defined(_WIN32) */
TEST("*"PATH_SEPARATOR"*");
EXPECT(results_test3);
@ -4781,7 +4781,7 @@ test_util_get_glob_opened_files(void *ptr)
// dot files are not special on windows
const char *results_test4[] = {"", ".test-hidden", "dir1", "dir2", "empty",
"file1", "file2", "forbidden"};
#endif
#endif /* !defined(_WIN32) */
TEST("*"PATH_SEPARATOR"*"PATH_SEPARATOR);
EXPECT(results_test4);
@ -4846,7 +4846,7 @@ test_util_get_glob_opened_files(void *ptr)
TT_FAIL(("unable to chmod a file on cleanup: %s", strerror(errno)));
}
}
#endif
#endif /* !defined(_WIN32) */
tor_free(dir1);
tor_free(dir2);
tor_free(forbidden);
@ -4860,11 +4860,11 @@ test_util_get_glob_opened_files(void *ptr)
SMARTLIST_FOREACH(results, char *, f, tor_free(f));
smartlist_free(results);
}
#else
#else /* !defined(HAVE_GLOB) */
tt_skip();
done:
return;
#endif
#endif /* defined(HAVE_GLOB) */
}
static void