]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Run "make autostyle."
authorNick Mathewson <nickm@torproject.org>
Wed, 5 Jun 2019 13:33:35 +0000 (09:33 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 5 Jun 2019 13:33:35 +0000 (09:33 -0400)
296 files changed:
src/app/config/config.c
src/app/config/or_options_st.h
src/app/config/or_state_st.h
src/app/config/statefile.h
src/app/main/subsysmgr.h
src/core/crypto/onion_crypto.h
src/core/mainloop/connection.c
src/core/mainloop/mainloop.c
src/core/mainloop/mainloop.h
src/core/mainloop/mainloop_pubsub.c
src/core/mainloop/mainloop_pubsub.h
src/core/mainloop/mainloop_sys.h
src/core/mainloop/netstatus.h
src/core/or/addr_policy_st.h
src/core/or/address_set.h
src/core/or/cell_queue_st.h
src/core/or/cell_st.h
src/core/or/circuit_st.h
src/core/or/circuitpadding.c
src/core/or/circuitpadding.h
src/core/or/circuitpadding_machines.h
src/core/or/connection_st.h
src/core/or/cpath_build_state_st.h
src/core/or/crypt_path.h
src/core/or/crypt_path_reference_st.h
src/core/or/crypt_path_st.h
src/core/or/destroy_cell_queue_st.h
src/core/or/dos.h
src/core/or/edge_connection_st.h
src/core/or/entry_connection_st.h
src/core/or/entry_port_cfg_st.h
src/core/or/extend_info_st.h
src/core/or/half_edge_st.h
src/core/or/listener_connection_st.h
src/core/or/ocirc_event.h
src/core/or/ocirc_event_sys.h
src/core/or/or_circuit_st.h
src/core/or/or_connection_st.h
src/core/or/or_handshake_certs_st.h
src/core/or/or_handshake_state_st.h
src/core/or/or_periodic.c
src/core/or/orconn_event.h
src/core/or/orconn_event_sys.h
src/core/or/origin_circuit_st.h
src/core/or/port_cfg_st.h
src/core/or/relay_crypto_st.h
src/core/or/sendme.h
src/core/or/server_port_cfg_st.h
src/core/or/socks_request_st.h
src/core/or/tor_version_st.h
src/core/or/var_cell_st.h
src/feature/api/tor_api.c
src/feature/api/tor_api.h
src/feature/control/btrack_circuit.h
src/feature/control/btrack_orconn.h
src/feature/control/btrack_orconn_cevent.h
src/feature/control/btrack_orconn_maps.h
src/feature/control/btrack_sys.h
src/feature/control/control_connection_st.h
src/feature/control/control_getinfo.h
src/feature/control/fmt_serverstatus.h
src/feature/control/getinfo_geoip.h
src/feature/dirauth/authmode.h
src/feature/dirauth/bridgeauth.h
src/feature/dirauth/bwauth.h
src/feature/dirauth/dirauth_periodic.h
src/feature/dirauth/dirauth_sys.h
src/feature/dirauth/dirvote.h
src/feature/dirauth/dsigs_parse.h
src/feature/dirauth/guardfraction.h
src/feature/dirauth/ns_detached_signatures_st.h
src/feature/dirauth/process_descs.h
src/feature/dirauth/reachability.h
src/feature/dirauth/recommend_pkg.h
src/feature/dirauth/shared_random.h
src/feature/dirauth/vote_microdesc_hash_st.h
src/feature/dirauth/voteflags.h
src/feature/dircache/cached_dir_st.h
src/feature/dircache/consdiffmgr.c
src/feature/dircache/dircache.h
src/feature/dirclient/dir_server_st.h
src/feature/dirclient/dirclient.h
src/feature/dirclient/dlstatus.h
src/feature/dirclient/download_status_st.h
src/feature/dircommon/dir_connection_st.h
src/feature/dircommon/vote_timing_st.h
src/feature/dircommon/voting_schedule.h
src/feature/dirparse/microdesc_parse.h
src/feature/dirparse/ns_parse.h
src/feature/dirparse/sigcommon.h
src/feature/dirparse/signing.h
src/feature/dirparse/unparseable.h
src/feature/hibernate/hibernate.c
src/feature/hs/hs_service.h
src/feature/hs/hs_stats.h
src/feature/hs/hsdir_index_st.h
src/feature/hs_common/shared_random_client.h
src/feature/keymgt/loadkey.h
src/feature/nodelist/authcert.h
src/feature/nodelist/authority_cert_st.h
src/feature/nodelist/desc_store_st.h
src/feature/nodelist/describe.h
src/feature/nodelist/dirlist.h
src/feature/nodelist/document_signature_st.h
src/feature/nodelist/extrainfo_st.h
src/feature/nodelist/microdesc_st.h
src/feature/nodelist/networkstatus.c
src/feature/nodelist/networkstatus_sr_info_st.h
src/feature/nodelist/networkstatus_st.h
src/feature/nodelist/networkstatus_voter_info_st.h
src/feature/nodelist/nickname.h
src/feature/nodelist/node_select.h
src/feature/nodelist/node_st.h
src/feature/nodelist/nodefamily.h
src/feature/nodelist/nodefamily_st.h
src/feature/nodelist/routerinfo.h
src/feature/nodelist/routerinfo_st.h
src/feature/nodelist/routerlist_st.h
src/feature/nodelist/routerstatus_st.h
src/feature/nodelist/signed_descriptor_st.h
src/feature/nodelist/vote_routerstatus_st.h
src/feature/relay/dns.c
src/feature/relay/onion_queue.h
src/feature/relay/relay_periodic.c
src/feature/relay/router.c
src/feature/relay/selftest.h
src/feature/rend/rend_authorized_client_st.h
src/feature/rend/rend_encoded_v2_service_descriptor_st.h
src/feature/rend/rend_intro_point_st.h
src/feature/rend/rend_service_descriptor_st.h
src/feature/rend/rendparse.h
src/feature/stats/predict_ports.h
src/feature/stats/rephist.h
src/lib/arch/bytes.h
src/lib/cc/compat_compiler.h
src/lib/cc/ctassert.h
src/lib/cc/torint.h
src/lib/compress/compress_zstd.c
src/lib/container/bitarray.h
src/lib/container/map.h
src/lib/container/namemap.h
src/lib/container/namemap_st.h
src/lib/container/order.h
src/lib/container/smartlist.h
src/lib/crypt_ops/crypto_cipher.h
src/lib/crypt_ops/crypto_dh_openssl.c
src/lib/crypt_ops/crypto_digest.c
src/lib/crypt_ops/crypto_digest_openssl.c
src/lib/crypt_ops/crypto_hkdf.c
src/lib/crypt_ops/crypto_init.c
src/lib/crypt_ops/crypto_init.h
src/lib/crypt_ops/crypto_nss_mgt.h
src/lib/crypt_ops/crypto_ope.c
src/lib/crypt_ops/crypto_ope.h
src/lib/crypt_ops/crypto_openssl_mgt.c
src/lib/crypt_ops/crypto_openssl_mgt.h
src/lib/crypt_ops/crypto_rand.c
src/lib/crypt_ops/crypto_rand.h
src/lib/crypt_ops/crypto_rand_fast.c
src/lib/crypt_ops/crypto_rsa.c
src/lib/crypt_ops/crypto_rsa.h
src/lib/crypt_ops/crypto_rsa_nss.c
src/lib/crypt_ops/crypto_s2k.c
src/lib/crypt_ops/crypto_util.c
src/lib/crypt_ops/digestset.h
src/lib/defs/dh_sizes.h
src/lib/defs/digest_sizes.h
src/lib/defs/time.h
src/lib/defs/x25519_sizes.h
src/lib/dispatch/dispatch.h
src/lib/dispatch/dispatch_cfg.h
src/lib/dispatch/dispatch_cfg_st.h
src/lib/dispatch/dispatch_naming.h
src/lib/dispatch/dispatch_st.h
src/lib/dispatch/msgtypes.h
src/lib/encoding/binascii.h
src/lib/encoding/keyval.h
src/lib/encoding/pem.h
src/lib/encoding/qstring.h
src/lib/encoding/time_fmt.h
src/lib/err/torerr.h
src/lib/evloop/token_bucket.h
src/lib/fs/conffile.h
src/lib/fs/dir.h
src/lib/fs/files.h
src/lib/fs/lockfile.h
src/lib/fs/mmap.c
src/lib/fs/mmap.h
src/lib/fs/path.h
src/lib/fs/userdb.h
src/lib/fs/winlib.h
src/lib/geoip/country.h
src/lib/intmath/addsub.h
src/lib/intmath/logic.h
src/lib/intmath/weakrng.h
src/lib/lock/compat_mutex.h
src/lib/log/escape.h
src/lib/log/log.c
src/lib/log/log.h
src/lib/log/ratelim.h
src/lib/log/util_bug.h
src/lib/log/win32err.h
src/lib/malloc/malloc.h
src/lib/malloc/map_anon.c
src/lib/malloc/map_anon.h
src/lib/math/fp.h
src/lib/math/laplace.h
src/lib/math/prob_distr.h
src/lib/meminfo/meminfo.h
src/lib/net/alertsock.h
src/lib/net/buffers_net.h
src/lib/net/gethostname.h
src/lib/net/inaddr.h
src/lib/net/inaddr_st.h
src/lib/net/nettypes.h
src/lib/net/resolve.c
src/lib/net/resolve.h
src/lib/net/socket.c
src/lib/net/socket.h
src/lib/net/socketpair.c
src/lib/net/socketpair.h
src/lib/net/socks5_status.h
src/lib/osinfo/uname.h
src/lib/process/daemon.h
src/lib/process/env.h
src/lib/process/pidfile.h
src/lib/process/process.c
src/lib/process/process.h
src/lib/process/process_unix.c
src/lib/process/process_unix.h
src/lib/process/process_win32.c
src/lib/process/process_win32.h
src/lib/process/setuid.h
src/lib/process/winprocess_sys.c
src/lib/pubsub/pub_binding_st.h
src/lib/pubsub/pubsub.h
src/lib/pubsub/pubsub_build.h
src/lib/pubsub/pubsub_builder_st.h
src/lib/pubsub/pubsub_connect.h
src/lib/pubsub/pubsub_flags.h
src/lib/pubsub/pubsub_macros.h
src/lib/pubsub/pubsub_publish.h
src/lib/smartlist_core/smartlist_core.h
src/lib/smartlist_core/smartlist_split.h
src/lib/string/compat_string.h
src/lib/string/parse_int.h
src/lib/string/printf.h
src/lib/string/scanf.h
src/lib/subsys/subsys.h
src/lib/term/getpass.h
src/lib/testsupport/testsupport.h
src/lib/thread/numcpus.h
src/lib/time/compat_time.c
src/lib/time/compat_time.h
src/lib/time/tvdiff.h
src/lib/tls/nss_countbytes.h
src/lib/tls/tortls.h
src/lib/tls/tortls_internal.h
src/lib/tls/tortls_openssl.c
src/lib/tls/tortls_st.h
src/lib/tls/x509.h
src/lib/tls/x509_internal.h
src/lib/tls/x509_nss.c
src/lib/tls/x509_openssl.c
src/lib/trace/debug.h
src/lib/trace/events.h
src/lib/trace/trace.h
src/lib/wallclock/approx_time.h
src/lib/wallclock/time_to_tm.h
src/lib/wallclock/timeval.h
src/lib/wallclock/tor_gettimeofday.h
src/test/bench.c
src/test/fuzz/fuzzing.h
src/test/fuzz/fuzzing_common.c
src/test/ptr_helpers.c
src/test/ptr_helpers.h
src/test/test-memwipe.c
src/test/test_circuitpadding.c
src/test/test_config.c
src/test/test_connection.h
src/test/test_crypto.c
src/test/test_dir_common.h
src/test/test_dns.c
src/test/test_dos.c
src/test/test_link_handshake.c
src/test/test_periodic_event.c
src/test/test_process.c
src/test/test_process_slow.c
src/test/test_protover.c
src/test/test_rng.c
src/test/test_shared_random.c
src/test/test_tortls.c
src/test/test_tortls.h
src/test/test_tortls_openssl.c
src/test/test_util.c
src/tools/tor-gencert.c

index d1b9d06bb304753d4fecb19ddddce9ddba4cb06e..4cbe81026c7c622308e21ad657a1618754746f53 100644 (file)
@@ -3551,7 +3551,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
     tor_free(t);
     t = format_recommended_version_list(options->RecommendedServerVersions, 1);
     tor_free(t);
-#endif
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
 
     if (options->UseEntryGuards) {
       log_info(LD_CONFIG, "Authoritative directory servers can't set "
@@ -3577,7 +3577,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
     if (options->GuardfractionFile && !old_options) {
       dirserv_read_guardfraction_file(options->GuardfractionFile, NULL);
     }
-#endif
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
   }
 
   if (options->AuthoritativeDir && !options->DirPort_set)
@@ -4605,7 +4605,7 @@ compute_real_max_mem_in_queues(const uint64_t val, int log_guess)
 #else
 /* On a 32-bit platform, we can't have 8GB of ram. */
 #define RAM_IS_VERY_LARGE(x) (0)
-#endif
+#endif /* SIZEOF_SIZE_T > 4 */
 
       if (RAM_IS_VERY_LARGE(ram)) {
         /* If we have 8 GB, or more, RAM available, we set the MaxMemInQueues
@@ -5777,7 +5777,7 @@ options_init_logs(const or_options_t *old_options, or_options_t *options,
 #else
         log_warn(LD_CONFIG, "Android logging is not supported"
                             " on this system. Sorry.");
-#endif // HAVE_ANDROID_LOG_H.
+#endif /* defined(HAVE_ANDROID_LOG_H) */
         goto cleanup;
       }
     }
index 4e03bec7faf0a063a5347c7f277d8ee0995cff14..2ee2d15674c4573b9aceae254a81c19935c6bedf 100644 (file)
@@ -1110,4 +1110,4 @@ struct or_options_t {
   int DormantCanceledByStartup;
 };
 
-#endif
+#endif /* !defined(TOR_OR_OPTIONS_ST_H) */
index cdb9b38287fb4d1ad93518c236c9a5ac37fed931..f45c6196ccc868db997b31973911dda1dfea5b5e 100644 (file)
@@ -96,4 +96,4 @@ struct or_state_t {
   int Dormant;
 };
 
-#endif
+#endif /* !defined(TOR_OR_STATE_ST_H) */
index 1950078450d9f1435bf60810177ae0348f02a346..515c90a52fb54a11736b13e78dc9cd8acd8b686c 100644 (file)
@@ -31,6 +31,6 @@ STATIC struct config_line_t *get_transport_in_state_by_name(
 STATIC void or_state_free_(or_state_t *state);
 #define or_state_free(st) FREE_AND_NULL(or_state_t, or_state_free_, (st))
 STATIC or_state_t *or_state_new(void);
-#endif
+#endif /* defined(STATEFILE_PRIVATE) */
 
 #endif /* !defined(TOR_STATEFILE_H) */
index 4ac44afca7ad60587be68ce0fc0fb0c7a6639156..d4426614e386f752177b135d936ef1b5d108b578 100644 (file)
@@ -26,4 +26,4 @@ void subsystems_prefork(void);
 void subsystems_postfork(void);
 void subsystems_thread_cleanup(void);
 
-#endif
+#endif /* !defined(TOR_SUBSYSMGR_T) */
index 1cddde361082ddf9e8b8f7ed111e48c2f17d27ea..7abdd6538ecb314c33e80d1d17fe8894eeeb0bc4 100644 (file)
@@ -44,4 +44,4 @@ void server_onion_keys_free_(server_onion_keys_t *keys);
 #define server_onion_keys_free(keys) \
   FREE_AND_NULL(server_onion_keys_t, server_onion_keys_free_, (keys))
 
-#endif
+#endif /* !defined(TOR_ONION_CRYPTO_H) */
index 487f6d4a5559b44ee7bc10608ac7e32446cfac32..127f08683fb79884ef86be0954b9c50d4c4f0ac0 100644 (file)
@@ -1476,7 +1476,7 @@ connection_listener_new(const struct sockaddr *listensockaddr,
         goto err;
       }
     }
-#endif /* __APPLE__ */
+#endif /* !defined(__APPLE__) */
 #endif /* defined(HAVE_SYS_UN_H) */
   } else {
     log_err(LD_BUG, "Got unexpected address family %d.",
@@ -2856,7 +2856,7 @@ retry_listener_ports(smartlist_t *old_conns,
           SMARTLIST_DEL_CURRENT(old_conns, conn);
           break;
         }
-#endif
+#endif /* defined(ENABLE_LISTENER_REBIND) */
       }
     } SMARTLIST_FOREACH_END(wanted);
 
@@ -2958,7 +2958,7 @@ retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol)
                conn_type_to_string(old_conn->type), old_conn->address,
                old_conn->port, new_conn->address, new_conn->port);
   } SMARTLIST_FOREACH_END(r);
-#endif
+#endif /* defined(ENABLE_LISTENER_REBIND) */
 
   /* Any members that were still in 'listeners' don't correspond to
    * any configured port.  Kill 'em. */
@@ -3957,9 +3957,9 @@ update_send_buffer_size(tor_socket_t sock)
       &isb, sizeof(isb), &bytesReturned, NULL, NULL)) {
     setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (const char*)&isb, sizeof(isb));
   }
-#else
+#else /* !(defined(_WIN32)) */
   (void) sock;
-#endif
+#endif /* defined(_WIN32) */
 }
 
 /** Try to flush more bytes onto <b>conn</b>-\>s.
index 82042e8498220f1686a4ba7771640c65cdbb2c66..c051b11566673296e7421240f9c2cfd18f248e18 100644 (file)
@@ -754,7 +754,7 @@ tor_shutdown_event_loop_for_restart_cb(
   tor_event_free(tor_shutdown_event_loop_for_restart_event);
   tor_shutdown_event_loop_and_exit(0);
 }
-#endif
+#endif /* defined(ENABLE_RESTART_DEBUGGING) */
 
 /**
  * After finishing the current callback (if any), shut down the main loop,
@@ -2375,7 +2375,7 @@ do_main_loop(void)
       event_add(tor_shutdown_event_loop_for_restart_event, &restart_after);
     }
   }
-#endif
+#endif /* defined(ENABLE_RESTART_DEBUGGING) */
 
   return run_main_loop_until_done();
 }
index cdc2bf8608a794f0f8d07b351923aa529ea099c2..caef736c156dfce87296156411bdfc84b0f693a1 100644 (file)
@@ -112,7 +112,7 @@ extern smartlist_t *connection_array;
 /* We need the periodic_event_item_t definition. */
 #include "core/mainloop/periodic.h"
 extern periodic_event_item_t mainloop_periodic_events[];
-#endif
-#endif /* defined(MAIN_PRIVATE) */
+#endif /* defined(TOR_UNIT_TESTS) */
+#endif /* defined(MAINLOOP_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_MAINLOOP_H) */
index 724a3115c85bd2cd2247d2ead5a43da3776c396b..53275d811950bbf48f3272a8781b1159b0137fe2 100644 (file)
@@ -6,9 +6,9 @@
 
 #include "orconfig.h"
 
-#include "src/core/or/or.h"
-#include "src/core/mainloop/mainloop.h"
-#include "src/core/mainloop/mainloop_pubsub.h"
+#include "core/or/or.h"
+#include "core/mainloop/mainloop.h"
+#include "core/mainloop/mainloop_pubsub.h"
 
 #include "lib/container/smartlist.h"
 #include "lib/dispatch/dispatch.h"
index a31b2b4ba7ff20ef5ac4259e01191ab0c81b73e1..365a3dd565c11522fdcb82d6217fc109a0ab25f0 100644 (file)
@@ -21,4 +21,4 @@ int tor_mainloop_set_delivery_strategy(const char *msg_channel_name,
                                         deliv_strategy_t strategy);
 void tor_mainloop_disconnect_pubsub(void);
 
-#endif
+#endif /* !defined(TOR_MAINLOOP_PUBSUB_H) */
index 14c567278c65a3db1120918c565d524307cd3e78..fa74fe5d4b157be3bf529a8921d2e10326165048 100644 (file)
@@ -9,4 +9,4 @@
 
 extern const struct subsys_fns_t sys_mainloop;
 
-#endif
+#endif /* !defined(MAINLOOP_SYS_H) */
index aba631e2fb56549cb1949d1a291472e3f5c7527c..e8469ff558450701762b21a0f6e227e2fe32457e 100644 (file)
@@ -21,4 +21,4 @@ void netstatus_flush_to_state(or_state_t *state, time_t now);
 void netstatus_load_from_state(const or_state_t *state, time_t now);
 void netstatus_note_clock_jumped(time_t seconds_diff);
 
-#endif
+#endif /* !defined(TOR_NETSTATUS_H) */
index a75f1a731d334a03f4e2727213e9c8185479c212..11442d29b492d8a84535eb96032bcf95924ba4ac 100644 (file)
@@ -43,4 +43,4 @@ struct addr_policy_t {
   uint16_t prt_max; /**< Highest port number to accept/reject. */
 };
 
-#endif
+#endif /* !defined(TOR_ADDR_POLICY_ST_H) */
index 7a9e71628eaee66e51562e9c1279fb0d21ec9a92..95608a9a53153d3ff7a802d73d4f547a2d280e7e 100644 (file)
@@ -28,4 +28,4 @@ void address_set_add_ipv4h(address_set_t *set, uint32_t addr);
 int address_set_probably_contains(const address_set_t *set,
                                   const struct tor_addr_t *addr);
 
-#endif
+#endif /* !defined(TOR_ADDRESS_SET_H) */
index 130b95a011e425a801043e5a81022741cb82ee80..7ba339b965da6665b880379afd70def169a150e1 100644 (file)
@@ -26,4 +26,4 @@ struct cell_queue_t {
   int n; /**< The number of cells in the queue. */
 };
 
-#endif
+#endif /* !defined(PACKED_CELL_ST_H) */
index 7ab7eceb50d30ba626406b4a3d4718f078c52c9c..c4eec4f4b57b0a9612ece6fe70e5f25288caf0a8 100644 (file)
@@ -16,5 +16,5 @@ struct cell_t {
   uint8_t payload[CELL_PAYLOAD_SIZE]; /**< Cell body. */
 };
 
-#endif
+#endif /* !defined(CELL_ST_H) */
 
index 3c7b931614b1e081b5c9b531733eed2a5e30818d..eae3c908d5870f2f070d743a2857217fba008c70 100644 (file)
@@ -229,4 +229,4 @@ struct circuit_t {
   struct circpad_machine_runtime_t *padding_info[CIRCPAD_MAX_MACHINES];
 };
 
-#endif
+#endif /* !defined(CIRCUIT_ST_H) */
index b2315d822f4a3d5b2505fd52278d0e5c797676c5..9210fa4e377e718662a6f24a54371b0334b434ed 100644 (file)
@@ -2595,7 +2595,7 @@ circpad_circ_responder_machine_init(void)
   circpad_register_padding_machine(circ_responder_machine,
                                    relay_padding_machines);
 }
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 /**
  * Initialize all of our padding machines.
@@ -2977,4 +2977,4 @@ circpad_string_to_machine(const char *str)
   return NULL;
 }
 
-#endif
+#endif /* 0 */
index 0dc66246d9e3a44a17910125f82962415311d904..3cf40e11dbf7032b344d6e179318837c77a041a7 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef TOR_CIRCUITPADDING_H
 #define TOR_CIRCUITPADDING_H
 
-#include "src/trunnel/circpad_negotiation.h"
+#include "trunnel/circpad_negotiation.h"
 #include "lib/evloop/timers.h"
 
 struct circuit_t;
@@ -803,6 +803,6 @@ extern smartlist_t *relay_padding_machines;
 
 #endif
 
-#endif
+#endif /* defined(CIRCUITPADDING_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_CIRCUITPADDING_H) */
index c44a70f2ccc35ee8f44cd1be7530c4b61a4e6e4a..3c9798d42d9180d4d4bbf7802fadb68ef726687a 100644 (file)
@@ -30,6 +30,6 @@ void circpad_machine_client_hide_rend_circuits(smartlist_t *machines_sl);
  *  The actual value will be sampled between the min and max.*/
 #define INTRO_MACHINE_MAXIMUM_PADDING 10
 
-#endif
+#endif /* defined(CIRCUITPADDING_MACHINES_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_CIRCUITPADDING_MACHINES_H) */
index d1430eda14684a37d9cc65e0599e6258a519e362..1c42a56d6b615d2fe0bf55559127de8ae4e656c6 100644 (file)
@@ -146,4 +146,4 @@ struct connection_t {
  * directory connection. */
 #define DIR_CONN_IS_SERVER(conn) ((conn)->purpose == DIR_PURPOSE_SERVER)
 
-#endif
+#endif /* !defined(CONNECTION_ST_H) */
index dbe596d8515695098edf4232b977c8fe19b60190..4572a104302b13e4dc381a968e59fe6e5e37a2f7 100644 (file)
@@ -34,5 +34,5 @@ struct cpath_build_state_t {
   time_t expiry_time;
 };
 
-#endif
+#endif /* !defined(CIRCUIT_BUILD_STATE_ST_ST_H) */
 
index 9850610ef7d65cb2c13dc4d4844706033ebaba8e..7a95fec2b4607aedcea18595dc3a85c935c1d767 100644 (file)
@@ -43,4 +43,4 @@ uint8_t *cpath_get_sendme_digest(crypt_path_t *cpath);
 unsigned int cpath_get_n_hops(crypt_path_t **head_ptr);
 #endif /* defined(TOR_UNIT_TESTS) */
 
-#endif
+#endif /* !defined(CRYPT_PATH_H) */
index 3d79f26c1c9499c96f2cdcf28087137a3f3d4b07..1827022b4e8e273dc5722c2991f23c7d50327493 100644 (file)
@@ -19,5 +19,5 @@ struct crypt_path_reference_t {
   crypt_path_t *cpath;
 };
 
-#endif
+#endif /* !defined(CRYPT_PATH_REFERENCE_ST_H) */
 
index d18d23e9397c7fcbf7c2c23f8a0f92d3afb36c18..249ac6aaa3c2fcca3c74dcd7a63edff03cba71ce 100644 (file)
@@ -35,7 +35,7 @@ struct onion_handshake_state_t {
 /* Helper macro to access private members of a struct. */
 #define pvt_crypto CRYPT_PATH_PRIV_FIELD(crypto)
 
-#endif
+#endif /* defined(CRYPT_PATH_PRIVATE) */
 
 /** Holds accounting information for a single step in the layered encryption
  * performed by a circuit.  Used only at the client edge of a circuit. */
@@ -82,4 +82,4 @@ struct crypt_path_t {
   relay_crypto_t CRYPT_PATH_PRIV_FIELD(crypto);
 };
 
-#endif
+#endif /* !defined(CRYPT_PATH_ST_H) */
index 56630670baba3b551eb9022aeb16a3cd42dd064a..e917afc7009952c2b34cc401c83c8fd79c775329 100644 (file)
@@ -23,5 +23,5 @@ struct destroy_cell_queue_t {
   int n; /**< The number of cells in the queue. */
 };
 
-#endif
+#endif /* !defined(DESTROY_CELL_QUEUE_ST_H) */
 
index 95448d0530dfe1419eb49b72b59e8340528c2305..b5154a7cd21b251ddedf3ee9502fedb1c3099d26 100644 (file)
@@ -134,7 +134,7 @@ MOCK_DECL(STATIC unsigned int, get_param_cc_enabled,
 MOCK_DECL(STATIC unsigned int, get_param_conn_enabled,
           (const networkstatus_t *ns));
 
-#endif /* TOR_DOS_PRIVATE */
+#endif /* defined(DOS_PRIVATE) */
 
-#endif /* TOR_DOS_H */
+#endif /* !defined(TOR_DOS_H) */
 
index 1665b8589f2d2812d3f3fbd2ff559475dfe2e733..8922a3a9cfa134aa96b8a2981cd3a88de8c6ee4e 100644 (file)
@@ -73,5 +73,5 @@ struct edge_connection_t {
   uint64_t dirreq_id;
 };
 
-#endif
+#endif /* !defined(EDGE_CONNECTION_ST_H) */
 
index 45621fadbfd0675927bef5aa4472cf1b5eb8c51e..e65c545d17e43b478cb3f7e0e297a6341e25e540 100644 (file)
@@ -96,5 +96,5 @@ struct entry_connection_t {
 /** Cast a entry_connection_t subtype pointer to a edge_connection_t **/
 #define ENTRY_TO_EDGE_CONN(c) (&(((c))->edge_))
 
-#endif
+#endif /* !defined(ENTRY_CONNECTION_ST_H) */
 
index 87dfb331e50520f5e10993597c9169c44b47baf8..b84838d44fa96e2b5044652b9496ee64da4c6cc7 100644 (file)
@@ -50,5 +50,5 @@ struct entry_port_cfg_t {
 
 };
 
-#endif
+#endif /* !defined(ENTRY_PORT_CFG_ST_H) */
 
index bc7a77b1b2d16157cb73e836f3aac8ef75633397..7704ff16b58dded483c2d7609299a4d16a0bd53c 100644 (file)
@@ -27,4 +27,4 @@ struct extend_info_t {
   curve25519_public_key_t curve25519_onion_key;
 };
 
-#endif
+#endif /* !defined(EXTEND_INFO_ST_H) */
index d4617be1083a3a48aad4199b7953bde68b644fdb..1fe47ad3f1c85bcd403ab81d2c9f10c1c77a1d50 100644 (file)
@@ -30,5 +30,5 @@ typedef struct half_edge_t {
   int connected_pending : 1;
 } half_edge_t;
 
-#endif
+#endif /* !defined(HALF_EDGE_ST_H) */
 
index 8989a39dc843c166b3461e6fba3ed22bcf7797ed..1250d9c9b420d3b6c9de1e160c4366a1a02ea1e1 100644 (file)
@@ -21,5 +21,5 @@ struct listener_connection_t {
 
 };
 
-#endif
+#endif /* !defined(LISTENER_CONNECTION_ST_H) */
 
index 0b125c28988d05ca2ddb9ff6476a502db72e13d9..59ec9e27cbee8d9f56c53d856e68c187ccb06a9b 100644 (file)
@@ -86,4 +86,4 @@ void ocirc_event_subscribe(ocirc_event_rcvr_t fn);
 void ocirc_event_publish(const ocirc_event_msg_t *msg);
 #endif
 
-#endif  /* defined(TOR_OCIRC_EVENT_STATE_H) */
+#endif /* !defined(TOR_OCIRC_EVENT_H) */
index 9d4bfe5333b0a1a07f4af543160e7ca89b6111c9..61180496dafb3ae318287babbe3ee6f37589db19 100644 (file)
@@ -10,4 +10,4 @@
 
 extern const struct subsys_fns_t sys_ocirc_event;
 
-#endif  /* defined(TOR_OCIRC_EVENT_H) */
+#endif /* !defined(TOR_OCIRC_EVENT_SYS_H) */
index 062e4ac854d2e575823e6050727fc22fe6e6f8eb..6789668224c266529ec447c3ecbb1f22c3f10c8e 100644 (file)
@@ -71,5 +71,5 @@ struct or_circuit_t {
   uint64_t total_cell_waiting_time;
 };
 
-#endif
+#endif /* !defined(OR_CIRCUIT_ST_H) */
 
index a5ce844bffe068bb710d97d753f4a31f80c0c71b..051fcd00d311c72b9ea24a75433f3090c51dad15 100644 (file)
@@ -91,4 +91,4 @@ struct or_connection_t {
   uint64_t bytes_xmitted, bytes_xmitted_by_tls;
 };
 
-#endif
+#endif /* !defined(OR_CONNECTION_ST_H) */
index a93b7104aaa113f1aa828020e033eb7f6d175ec5..9deb6d6d59b72fce1367aafb5900404cbae04ef0 100644 (file)
@@ -37,4 +37,4 @@ struct or_handshake_certs_t {
   size_t ed_rsa_crosscert_len;
 };
 
-#endif
+#endif /* !defined(OR_HANDSHAKE_CERTS_ST) */
index 09a8a34179a36d11c023deed2e25dd82e3318d49..472ce8a3027ae40eaf39b5e2a07c6b8be44c01fc 100644 (file)
@@ -74,5 +74,5 @@ struct or_handshake_state_t {
   or_handshake_certs_t *certs;
 };
 
-#endif
+#endif /* !defined(OR_HANDSHAKE_STATE_ST) */
 
index 93dfa8cf8bbf45fce9b837c4aa16e81a9adda749..fe28c99192f7edc3abf4669eace90ef2a915ce17 100644 (file)
@@ -18,7 +18,7 @@
 #include "core/or/circuituse.h"
 #include "core/or/or_periodic.h"
 
-#include "src/feature/relay/routermode.h"
+#include "feature/relay/routermode.h"
 
 #define DECLARE_EVENT(name, roles, flags)         \
   static periodic_event_item_t name ## _event =   \
index 80289d53e69e46749b42dcf612d1d7c7137ebaa5..d6635793db61a4bcdb0884696e0ce80bb340c157 100644 (file)
@@ -117,4 +117,4 @@ void orconn_event_subscribe(orconn_event_rcvr_t);
 void orconn_event_publish(const orconn_event_msg_t *);
 #endif
 
-#endif  /* defined(TOR_ORCONN_EVENT_H) */
+#endif /* !defined(TOR_ORCONN_EVENT_H) */
index bfb0a3ac4a84eded4de35740ce19d81cc33a3934..9703b2e3d1711834146ed8e02fbd65544aaf8a6d 100644 (file)
@@ -9,4 +9,4 @@
 
 extern const struct subsys_fns_t sys_orconn_event;
 
-#endif  /* defined(TOR_ORCONN_SYS_H) */
+#endif /* !defined(TOR_ORCONN_EVENT_SYS_H) */
index daa5f41dad1e423601ad0b792db3e4e5548374af..01bbc84ae216e1e53d126622a086ce1a0d1172da 100644 (file)
@@ -295,4 +295,4 @@ struct origin_circuit_t {
 
 };
 
-#endif
+#endif /* !defined(ORIGIN_CIRCUIT_ST_H) */
index b67091ce321a4d1cf746595fb78abb332fc034a1..e9e82bb1dedc839afbfc31dfc78fdcebebf84a97 100644 (file)
@@ -31,5 +31,5 @@ struct port_cfg_t {
   char unix_addr[FLEXIBLE_ARRAY_MEMBER];
 };
 
-#endif
+#endif /* !defined(PORT_CFG_ST_H) */
 
index 1f243ccdc8fb073ed669cb7e5f04013defec5b12..83bbd329a6a3a392ec9975047440597117f696f5 100644 (file)
@@ -30,4 +30,4 @@ struct relay_crypto_t {
 };
 #undef crypto_cipher_t
 
-#endif
+#endif /* !defined(RELAY_CRYPTO_ST_H) */
index cdbdf55ac76233d259f5b2ad3e7fc440968d59f8..20477103fdd0a9bcfa3e1a7562a72c262905f60d 100644 (file)
@@ -73,8 +73,8 @@ STATIC bool sendme_is_valid(const circuit_t *circ,
                             const uint8_t *cell_payload,
                             size_t cell_payload_len);
 
-#endif /* TOR_UNIT_TESTS */
+#endif /* defined(TOR_UNIT_TESTS) */
 
-#endif /* SENDME_PRIVATE */
+#endif /* defined(SENDME_PRIVATE) */
 
 #endif /* !defined(TOR_SENDME_H) */
index bd026af7eec6738c64f624908f37c9df61a0f23d..0738735c61823ff4d408f93f5a99edb8a0807aa6 100644 (file)
@@ -16,5 +16,5 @@ struct server_port_cfg_t {
   unsigned int bind_ipv6_only : 1;
 };
 
-#endif
+#endif /* !defined(SERVER_PORT_CFG_ST_H) */
 
index 5922870c6185f5d1c1511f40548039e830f754c8..9fb941ff7e5c48d1c3ad9afddbae3b4fbe8f13cd 100644 (file)
@@ -74,4 +74,4 @@ struct socks_request_t {
   uint8_t socks5_atyp; /* SOCKS5 address type */
 };
 
-#endif
+#endif /* !defined(SOCKS_REQUEST_ST_H) */
index 716429bd3290efed977fc6b57924ea24fd63bec4..c5bdcaf07b79d21f04b6763068f8eff78be6df5d 100644 (file)
@@ -28,5 +28,5 @@ struct tor_version_t {
   char git_tag[DIGEST_LEN];
 };
 
-#endif
+#endif /* !defined(TOR_VERSION_ST_H) */
 
index 4287c83f6def5014bf5a422b8f915ba9fe944f2b..607c0d6c83119e5ca9db80203b47e1a719dcb998 100644 (file)
@@ -19,5 +19,5 @@ struct var_cell_t {
   uint8_t payload[FLEXIBLE_ARRAY_MEMBER];
 };
 
-#endif
+#endif /* !defined(VAR_CELL_ST_H) */
 
index 697397d46b9dbbc037aff394ba1f22bcad7d3669..fd9d24135350806e749f3f7e56e51c8ffe0b240f 100644 (file)
 #define raw_socketpair tor_ersatz_socketpair
 #define raw_closesocket closesocket
 #define snprintf _snprintf
-#else
+#else /* !(defined(_WIN32)) */
 #define raw_socketpair socketpair
 #define raw_closesocket close
-#endif
+#endif /* defined(_WIN32) */
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index 2bf130c376bd258cf22ab43a9115d92a7d7fb5ea..cb84853a5225ad18685d65da3a3579553ce27504 100644 (file)
@@ -55,7 +55,7 @@ typedef SOCKET tor_control_socket_t;
 #else
 typedef int tor_control_socket_t;
 #define INVALID_TOR_CONTROL_SOCKET (-1)
-#endif
+#endif /* defined(_WIN32) */
 
 /** DOCDOC */
 tor_control_socket_t tor_main_configuration_setup_control_socket(
index c40822f1f17341b18c274b92399b129d5f42ce87..9e06fefb076f3b66c7e7c24d63b749db6c2a02dd 100644 (file)
@@ -12,4 +12,4 @@
 int btrack_circ_init(void);
 void btrack_circ_fini(void);
 
-#endif  /* defined(TOR_BTRACK_CIRCUIT_H) */
+#endif /* !defined(TOR_BTRACK_CIRCUIT_H) */
index 6ab4892a7877c342785c4b736d93670e3468cddb..f8f5c1096c7d1ab632d4a4d20a128ce810701679 100644 (file)
@@ -30,9 +30,9 @@ typedef struct bt_orconn_t {
   bool is_onehop;           /**< Is this for a one-hop circuit? */
 } bt_orconn_t;
 
-#endif  /* defined(BTRACK_ORCONN_PRIVATE) */
+#endif /* defined(BTRACK_ORCONN_PRIVATE) */
 
 int btrack_orconn_init(void);
 void btrack_orconn_fini(void);
 
-#endif  /* defined(TOR_BTRACK_ORCONN_H) */
+#endif /* !defined(TOR_BTRACK_ORCONN_H) */
index 954b452451ffd0919d471828dcb135d57bafb205..afec55581e52e2d27735d97c9d8a643dfda1317e 100644 (file)
@@ -15,4 +15,4 @@ void bto_cevent_anyconn(const bt_orconn_t *);
 void bto_cevent_apconn(const bt_orconn_t *);
 void bto_cevent_reset(void);
 
-#endif  /* defined(TOR_BTRACK_ORCONN_CEVENT_H) */
+#endif /* !defined(TOR_BTRACK_ORCONN_CEVENT_H) */
index 2065eb61b2154d9841883aa06f02fac6938e711c..c2043fa1535c559f45f3d63ae53c6b7e7e12a074 100644 (file)
@@ -15,4 +15,4 @@ bt_orconn_t *bto_find_or_new(uint64_t, uint64_t);
 void bto_init_maps(void);
 void bto_clear_maps(void);
 
-#endif  /* defined(TOR_BTRACK_ORCONN_MAPS_H) */
+#endif /* !defined(TOR_BTRACK_ORCONN_MAPS_H) */
index fad35b41db1f274570ad68565fbdd502e0279fba..3f831d0640bf829296b5143da5cc49905192ece4 100644 (file)
@@ -11,4 +11,4 @@
 
 extern const struct subsys_fns_t sys_btrack;
 
-#endif  /* defined(TOR_BTRACK_SYS_H) */
+#endif /* !defined(TOR_BTRACK_SYS_H) */
index cace6bb36f479a6ec98d870ec774528ebbb099e3..c9164f03b3675f3cc6b8ae090938d8834de74937 100644 (file)
@@ -44,4 +44,4 @@ struct control_connection_t {
   char *current_cmd;
 };
 
-#endif
+#endif /* !defined(CONTROL_CONNECTION_ST_H) */
index 2d56586f6ddb105b5ab4203e05da76cb338a0c28..52978686d85fbfafbde310ea465d7410ed8e5e37 100644 (file)
@@ -58,4 +58,4 @@ STATIC int getinfo_helper_current_time(
     const char **errmsg);
 #endif /* defined(CONTROL_GETINFO_PRIVATE) */
 
-#endif /* !defined(TOR_CONTROL_GETINFO) */
+#endif /* !defined(TOR_CONTROL_GETINFO_H) */
index 4b95e5b59fb3cf9f376bf5e4ab2ab66564a7c9a0..d9190cb7e19fd6a03b30b3fa9797ccbc290d888a 100644 (file)
@@ -15,4 +15,4 @@
 int list_server_status_v1(smartlist_t *routers, char **router_status_out,
                           int for_controller);
 
-#endif
+#endif /* !defined(TOR_FMT_SERVERSTATUS_H) */
index fe22137859f9ce230a8c23c7a2de5005e3510bd0..94759d0d1832b99b5715768bace81e6352d1dfaf 100644 (file)
@@ -11,4 +11,4 @@ int getinfo_helper_geoip(control_connection_t *control_conn,
                      const char *question, char **answer,
                      const char **errmsg);
 
-#endif
+#endif /* !defined(TOR_GETINFO_GEOIP_H) */
index 876a1f947b433b3ce0231ca9e37e56c9715f8f12..48afc3cdb42373aabe186635cfa1e24ab28a1d64 100644 (file)
@@ -29,7 +29,7 @@ authdir_mode_v3(const or_options_t *options)
 
 #define have_module_dirauth() (1)
 
-#else /* HAVE_MODULE_DIRAUTH */
+#else /* !(defined(HAVE_MODULE_DIRAUTH)) */
 
 #define authdir_mode(options) (((void)(options)),0)
 #define authdir_mode_handles_descs(options,purpose) \
@@ -41,6 +41,6 @@ authdir_mode_v3(const or_options_t *options)
 
 #define have_module_dirauth() (0)
 
-#endif /* HAVE_MODULE_DIRAUTH */
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
 
-#endif /* TOR_MODE_H */
+#endif /* !defined(TOR_DIRAUTH_MODE_H) */
index cc80fd63759669f5c350b2f8df4813846688446c..4905e9c3eea14c660bb1c0e9aac34c443145778d 100644 (file)
@@ -9,4 +9,4 @@
 
 void bridgeauth_dump_bridge_status_to_file(time_t now);
 
-#endif
+#endif /* !defined(TOR_DIRAUTH_BRIDGEAUTH_H) */
index 8b7acc4a1ccd8efe462bb82a320718eed7443df7..81c8affbd785cbbf43aaf32a4ca17a2cbd1fb913 100644 (file)
@@ -55,4 +55,4 @@ STATIC void dirserv_cache_measured_bw(const measured_bw_line_t *parsed_line,
 STATIC void dirserv_expire_measured_bw_cache(time_t now);
 #endif /* defined(BWAUTH_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_BWAUTH_H) */
index de14cbb3c8b4246a8f8d0f4c69b39b2fe726f347..1124fae952e65ce6a42cf9729aff92b8790b4a0a 100644 (file)
@@ -12,7 +12,7 @@
 void dirauth_register_periodic_events(void);
 void reschedule_dirvote(const or_options_t *options);
 
-#else
+#else /* !(defined(HAVE_MODULE_DIRAUTH)) */
 
 static inline void
 reschedule_dirvote(const or_options_t *options)
@@ -20,6 +20,6 @@ reschedule_dirvote(const or_options_t *options)
   (void)options;
 }
 
-#endif
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
 
-#endif
+#endif /* !defined(DIRVOTE_PERIODIC_H) */
index e10f4c95897737b01c3d2a8edd66375afb76d4bd..4e9b6a2ab4d5c888f022527b81201a138c3161a7 100644 (file)
@@ -9,4 +9,4 @@
 
 extern const struct subsys_fns_t sys_dirauth;
 
-#endif
+#endif /* !defined(DIRAUTH_SYS_H) */
index f9de5ebc41d4eefc117f222edfbedd30e685a943..a0cfe0a34cc1b38621fca6c372a3c98e8e95acae 100644 (file)
@@ -128,7 +128,7 @@ struct config_line_t;
 char *format_recommended_version_list(const struct config_line_t *line,
                                       int warn);
 
-#else /* HAVE_MODULE_DIRAUTH */
+#else /* !(defined(HAVE_MODULE_DIRAUTH)) */
 
 static inline time_t
 dirvote_act(const or_options_t *options, time_t now)
@@ -193,7 +193,7 @@ dirvote_add_signatures(const char *detached_signatures_body,
   return 0;
 }
 
-#endif /* HAVE_MODULE_DIRAUTH */
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
 
 /* Item access */
 MOCK_DECL(const char*, dirvote_get_pending_consensus,
index fec51ba488e580e948b63db91f115d28b848493a..0cc53072f8d0bc8eef63a9c0b1469c1b1a474a3c 100644 (file)
@@ -19,4 +19,4 @@ void ns_detached_signatures_free_(ns_detached_signatures_t *s);
 #define ns_detached_signatures_free(s) \
   FREE_AND_NULL(ns_detached_signatures_t, ns_detached_signatures_free_, (s))
 
-#endif
+#endif /* !defined(TOR_DSIGS_PARSE_H) */
index 72404907a47d53be5ca4dd3059d6b2f4bf8a68e2..9f01ded8389e12b0c2678d146cf508a63e6259d0 100644 (file)
@@ -21,4 +21,4 @@ dirserv_read_guardfraction_file_from_str(const char *guardfraction_file_str,
 int dirserv_read_guardfraction_file(const char *fname,
                                  smartlist_t *vote_routerstatuses);
 
-#endif
+#endif /* !defined(TOR_GUARDFRACTION_H) */
index 0f92be2f0d5c07965ff155f31f9741d4ee8376f1..61d20b7525f884114f65129eaf7e67ffe36e4688 100644 (file)
@@ -18,5 +18,5 @@ struct ns_detached_signatures_t {
                          * document_signature_t */
 };
 
-#endif
+#endif /* !defined(NS_DETACHED_SIGNATURES_ST_H) */
 
index 510e54f8138ce5b99344560d4db867b3fc7eed66..001c866ebad5021db44a6349339f135aadc2165f 100644 (file)
@@ -36,4 +36,4 @@ void dirserv_set_node_flags_from_authoritative_status(node_t *node,
 
 int dirserv_would_reject_router(const routerstatus_t *rs);
 
-#endif
+#endif /* !defined(TOR_RECV_UPLOADS_H) */
index 5a938673ff5a4111f11a795bf23181eae8a5c6fc..873a3f9a236a03f60704cf822f04f6dd3593eb41 100644 (file)
@@ -33,4 +33,4 @@ int dirserv_should_launch_reachability_test(const routerinfo_t *ri,
 void dirserv_single_reachability_test(time_t now, routerinfo_t *router);
 void dirserv_test_reachability(time_t now);
 
-#endif
+#endif /* !defined(TOR_REACHABILITY_H) */
index 1f97d501778aa68d9bfe8cf72750a3fd3da2a835..af17e945e880f9969258ab758913fd6ff708f2e7 100644 (file)
@@ -24,6 +24,6 @@ validate_recommended_package_line(const char *line)
   return 0;
 }
 
-#endif
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
 
-#endif
+#endif /* !defined(TOR_RECOMMEND_PKG_H) */
index 0b45ad1ed7f37848380adc7508552e8cc270a75e..1d8fa89b0fc43a6e2935387aa7764761082e903b 100644 (file)
@@ -110,7 +110,7 @@ int sr_init(int save_to_disk);
 void sr_save_and_cleanup(void);
 void sr_act_post_consensus(const networkstatus_t *consensus);
 
-#else /* HAVE_MODULE_DIRAUTH */
+#else /* !(defined(HAVE_MODULE_DIRAUTH)) */
 
 static inline int
 sr_init(int save_to_disk)
@@ -131,7 +131,7 @@ sr_act_post_consensus(const networkstatus_t *consensus)
   (void) consensus;
 }
 
-#endif /* HAVE_MODULE_DIRAUTH */
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
 
 /* Public methods used only by dirauth code. */
 
index 92acdf11579c51faa9f0ec79d6fa0aa13384e06d..7869f92b4f70ef02633a310d226c49b27f7eb5b7 100644 (file)
@@ -18,5 +18,5 @@ struct vote_microdesc_hash_t {
   char *microdesc_hash_line;
 };
 
-#endif
+#endif /* !defined(VOTE_MICRODESC_HASH_ST_H) */
 
index ee809a290d43978d2a6c91a34317ed1a5277fd23..c4f36e7817a81b0f4780700f84cb37ab353a77e0 100644 (file)
@@ -25,7 +25,7 @@ void dirauth_set_routerstatus_from_routerinfo(routerstatus_t *rs,
                                               int listbadexits);
 
 void dirserv_compute_performance_thresholds(digestmap_t *omit_as_sybil);
-#endif
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
 
 void dirserv_set_bridges_running(time_t now);
 
@@ -34,6 +34,6 @@ void dirserv_set_bridges_running(time_t now);
  * StaleDesc flag. */
 #define DESC_IS_STALE_INTERVAL (18*60*60)
 STATIC void dirserv_set_routerstatus_testing(routerstatus_t *rs);
-#endif
+#endif /* defined(VOTEFLAGS_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_VOTEFLAGS_H) */
index 71dca8c3a225c3cdd17c5f41738db058d70ed80c..a28802f905caf5a3a150a6b225427c7df0f2d655 100644 (file)
@@ -21,5 +21,5 @@ struct cached_dir_t {
   int refcnt; /**< Reference count for this cached_dir_t. */
 };
 
-#endif
+#endif /* !defined(CACHED_DIR_ST_H) */
 
index 6b16307e3c8d001fc9a1dea7a3904f6401b6a25e..397efa03411c1dbf13b4ce8662c9b33efa4fe74f 100644 (file)
@@ -525,7 +525,7 @@ consdiffmgr_add_consensus_nulterm(const char *consensus,
   tor_free(ctmp);
   return r;
 }
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 /**
  * Given a buffer containing a networkstatus consensus, and the results of
index 236ea649ef35e48b54ec07b011f0403d62d94fea..de0d205f6a50fdd197164903ea7ec9b2ae7fda53 100644 (file)
@@ -38,6 +38,6 @@ STATIC int parse_hs_version_from_post(const char *url, const char *prefix,
                                       const char **end_pos);
 
 STATIC unsigned parse_accept_encoding_header(const char *h);
-#endif
+#endif /* defined(DIRCACHE_PRIVATE) */
 
 #endif /* !defined(TOR_DIRCACHE_H) */
index 2f5706cdd950d4aa0d89dea199e926cb8f407be4..8e35532435cdfdbba70e9b586a64636ffa320e95 100644 (file)
@@ -51,4 +51,4 @@ struct dir_server_t {
                                **/
 };
 
-#endif
+#endif /* !defined(DIR_SERVER_ST_H) */
index 1a93265dc3dcb0bcdb99140a71c28b567d741af3..be4374c7cff0cefd21d155dd9e61422773cee44c 100644 (file)
@@ -167,6 +167,6 @@ STATIC int handle_response_fetch_consensus(dir_connection_t *conn,
 
 STATIC dirinfo_type_t dir_fetch_type(int dir_purpose, int router_purpose,
                                      const char *resource);
-#endif
+#endif /* defined(DIRCLIENT_PRIVATE) */
 
 #endif /* !defined(TOR_DIRCLIENT_H) */
index 99e0d0225bc6eea5ed03661745e21c4d4fb848dd..681712b059037ff646d132540001a435e941782f 100644 (file)
@@ -53,6 +53,6 @@ STATIC void next_random_exponential_delay_range(int *low_bound_out,
 /* no more than triple the previous delay */
 #define DIR_TEST_NET_RANDOM_MULTIPLIER (2)
 
-#endif
+#endif /* defined(DLSTATUS_PRIVATE) */
 
 #endif /* !defined(TOR_DLSTATUS_H) */
index 11555a1dcc3c19ee85c2c7b8a835ca9022bb910a..39a5ad286096b11221c0fda59c31361bf5ca58fc 100644 (file)
@@ -61,5 +61,5 @@ struct download_status_t {
                         * only updated if backoff == 1 */
 };
 
-#endif
+#endif /* !defined(DOWNLOAD_STATUS_ST_H) */
 
index 8c59cc7a46e1cc1b9ee0f11a8c94a36da305a2b5..a858560c2952cb79b9c397c0620b3570411d7b3b 100644 (file)
@@ -64,4 +64,4 @@ struct dir_connection_t {
 #endif /* defined(MEASUREMENTS_21206) */
 };
 
-#endif
+#endif /* !defined(DIR_CONNECTION_ST_H) */
index 47b90ab0093a519364d5daa9d0e7776046e8caee..814a325314b83cfaa23c89ca076d709ee5f474d7 100644 (file)
@@ -20,5 +20,5 @@ struct vote_timing_t {
   int dist_delay;
 };
 
-#endif
+#endif /* !defined(VOTE_TIMING_ST_H) */
 
index bafd81184e4b241211e8c1cce8cd5f33bc5fdb42..d78c7ee2da9f4503cc68e03b715b422eafb00780 100644 (file)
@@ -61,5 +61,5 @@ time_t voting_schedule_get_start_of_next_interval(time_t now,
                                                   int offset);
 time_t voting_schedule_get_next_valid_after_time(void);
 
-#endif /* TOR_VOTING_SCHEDULE_H */
+#endif /* !defined(TOR_VOTING_SCHEDULE_H) */
 
index 23a90084b18ed97fb6c36edc6e97639751770bd1..95af85544aad211deacb206cfe0446b337d3ff98 100644 (file)
@@ -17,4 +17,4 @@ smartlist_t *microdescs_parse_from_string(const char *s, const char *eos,
                                           saved_location_t where,
                                           smartlist_t *invalid_digests_out);
 
-#endif
+#endif /* !defined(TOR_MICRODESC_PARSE_H) */
index dedfa6fc8842387c9e8aae52703192cda2a3d2b7..0cf2cc88d0b18137f2b1057aeb2b0a239f0137c1 100644 (file)
@@ -42,6 +42,6 @@ STATIC routerstatus_t *routerstatus_parse_entry_from_string(
                                      vote_routerstatus_t *vote_rs,
                                      int consensus_method,
                                      consensus_flavor_t flav);
-#endif
+#endif /* defined(NS_PARSE_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_NS_PARSE_H) */
index fdd8e839a9ca3b9a2b18b1308e11dcf18d765868..b6b34e8f62d9a6763556f9515332132ae7487ea3 100644 (file)
@@ -43,6 +43,6 @@ MOCK_DECL(STATIC int, signed_digest_equals,
 MOCK_DECL(STATIC int, router_compute_hash_final,(char *digest,
                            const char *start, size_t len,
                            digest_algorithm_t alg));
-#endif
+#endif /* defined(SIGCOMMON_PRIVATE) */
 
 #endif /* !defined(TOR_SIGCOMMON_H) */
index 2e3699baf8fef9fce8a48b6a02fbf84cc8bb610a..8b119b4eb2f8701588568f26feb02dfe59524d90 100644 (file)
@@ -20,4 +20,4 @@ int router_append_dirobj_signature(char *buf, size_t buf_len,
                                    const char *digest,
                                    size_t digest_len,
                                    crypto_pk_t *private_key);
-#endif
+#endif /* !defined(TOR_SIGNING_H) */
index 853fe8cb0fbe636dd570344ca3764a12c6e31377..49e047961f29904bcaf0c049c03e5dcfb9415b77 100644 (file)
@@ -51,6 +51,6 @@ EXTERN(struct smartlist_t *, descs_dumped)
 MOCK_DECL(STATIC dumped_desc_t *, dump_desc_populate_one_file,
     (const char *dirname, const char *f));
 STATIC void dump_desc_populate_fifo_from_directory(const char *dirname);
-#endif
+#endif /* defined(UNPARSEABLE_PRIVATE) */
 
 #endif /* !defined(TOR_UNPARSEABLE_H) */
index 7351e5e00216ef96c45688ea5130411923d4df86..674fe3c813bd1483dc5aaec1f6a74f06fe339121 100644 (file)
@@ -57,7 +57,7 @@ hibernating, phase 2:
  * Coverity. Here's a kludge to unconfuse it.
  */
 #   define __INCLUDE_LEVEL__ 2
-# endif /* defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__) */
+#endif /* defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__) */
 #include <systemd/sd-daemon.h>
 #endif /* defined(HAVE_SYSTEMD) */
 
@@ -893,7 +893,7 @@ hibernate_begin(hibernate_state_t new_state, time_t now)
      */
     sd_notifyf(0, "EXTEND_TIMEOUT_USEC=%" PRIu64,
             ((uint64_t)(options->ShutdownWaitLength) + 30) * TOR_USEC_PER_SEC);
-#endif
+#endif /* defined(HAVE_SYSTEMD) */
   } else { /* soft limit reached */
     hibernate_end_time = interval_end_time;
   }
index 8d7f773219a594c7bbf470783a0c36803e74db56..22aa00b2d748fb97a13df0b873f236c973b14c6d 100644 (file)
@@ -361,7 +361,7 @@ STATIC hs_service_t *get_first_service(void);
 STATIC hs_service_intro_point_t *service_intro_point_find_by_ident(
                                          const hs_service_t *service,
                                          const hs_ident_circuit_t *ident);
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 /* Service accessors. */
 STATIC hs_service_t *find_service(hs_service_ht *map,
index ca048e2123c8bc52318edf7bfb860ab78370f215..6700eca15b1baaee4684d04b0d5e863a3c0c4c72 100644 (file)
@@ -15,4 +15,4 @@ uint32_t hs_stats_get_n_introduce2_v2_cells(void);
 void hs_stats_note_service_rendezvous_launch(void);
 uint32_t hs_stats_get_n_rendezvous_launches(void);
 
-#endif
+#endif /* !defined(TOR_HS_STATS_H) */
index 7d4116d8bb322333d0b7f0c4c31e24f218dc35f6..6c86c02f4764e2d16b3f4f7701aacbf2e8f84962 100644 (file)
@@ -20,5 +20,5 @@ struct hsdir_index_t {
   uint8_t store_second[DIGEST256_LEN];
 };
 
-#endif
+#endif /* !defined(HSDIR_INDEX_ST_H) */
 
index 95fe2c65abcaf546f8c1449f084a7c0b728b5f78..c90c52cfea4bd8091b486d1285c72f5c6ebcfbd2 100644 (file)
@@ -44,5 +44,5 @@ time_t get_start_time_of_current_round(void);
 
 #endif /* TOR_UNIT_TESTS */
 
-#endif /* TOR_SHARED_RANDOM_CLIENT_H */
+#endif /* !defined(TOR_SHARED_RANDOM_CLIENT_H) */
 
index 8beee57a20f07b864881ce6c1bef778b8e85f311..0a5af0b8047255aa54ace463cac0f2661f0def04 100644 (file)
@@ -52,4 +52,4 @@ int read_encrypted_secret_key(ed25519_secret_key_t *out,
 int write_encrypted_secret_key(const ed25519_secret_key_t *out,
                                const char *fname);
 
-#endif
+#endif /* !defined(TOR_LOADKEY_H) */
index 2effdb06e6f9e2377bf96354dad1e4d032bfe29e..071293f9ee4dd266dc33c3ae55a68cf1a482388d 100644 (file)
@@ -57,4 +57,4 @@ MOCK_DECL(download_status_t *, download_status_for_authority_id_and_sk,
 
 void authcert_free_all(void);
 
-#endif
+#endif /* !defined(TOR_AUTHCERT_H) */
index 68a84bc452b49006256fed17e5d3840ede9fb5b6..bf9b690c248fc4edb2feb1f9e92b2c32ce137f92 100644 (file)
@@ -28,5 +28,5 @@ struct authority_cert_t {
   uint16_t dir_port;
 };
 
-#endif
+#endif /* !defined(AUTHORITY_CERT_ST_H) */
 
index b04a1abc7d863411e086b57f53e03c9825f65a25..4d1378cdfa08769370dbc058eae5d3661461b2bf 100644 (file)
@@ -36,4 +36,4 @@ struct desc_store_t {
   size_t bytes_dropped;
 };
 
-#endif
+#endif /* !defined(DESC_STORE_ST_H) */
index 018af6470ed65b3a49529aef82538c543c246718..d29192200e8d8d41162737dd46ab7b1267c3152f 100644 (file)
@@ -22,4 +22,4 @@ const char *node_describe(const struct node_t *node);
 const char *router_describe(const struct routerinfo_t *ri);
 const char *routerstatus_describe(const struct routerstatus_t *ri);
 
-#endif
+#endif /* !defined(TOR_DESCRIBE_H) */
index 9fabd0a44a897de35dcdd38385f8d5d9b0d37551..b6dda32d851ef90fb2015da5cdfd439b12157820 100644 (file)
@@ -44,4 +44,4 @@ void dir_server_add(dir_server_t *ent);
 void clear_dir_servers(void);
 void dirlist_free_all(void);
 
-#endif
+#endif /* !defined(TOR_DIRLIST_H) */
index 66e32c422f39d5caa53dde7a3cf4851463254530..ac2a80325256a91b5bf010203b451008cbd2cc34 100644 (file)
@@ -25,5 +25,5 @@ struct document_signature_t {
                                      * as good. */
 };
 
-#endif
+#endif /* !defined(DOCUMENT_SIGNATURE_ST_H) */
 
index c54277b05e8d0094ff2b43420f77ec55782049b3..22c708f018c55d79da0bf87082b5d51b9e7bb928 100644 (file)
@@ -26,5 +26,5 @@ struct extrainfo_t {
   size_t pending_sig_len;
 };
 
-#endif
+#endif /* !defined(EXTRAINFO_ST_H) */
 
index 367e6a3ef6b86cee47e55fbb698fec6f8c2c470a..c8265cb778768ab27729e2bb3228a7f9d017b3a4 100644 (file)
@@ -78,4 +78,4 @@ struct microdesc_t {
   struct short_policy_t *ipv6_exit_policy;
 };
 
-#endif
+#endif /* !defined(MICRODESC_ST_H) */
index c7e337309ece32cd7637106a07ca18635f21ada5..2db293a8afb6fb4fc4af6f02e3c1110aead22a08 100644 (file)
@@ -1772,7 +1772,7 @@ reload_consensus_from_file(const char *fname,
                                              flavor, flags, source_dir);
     tor_free(content);
   }
-#endif
+#endif /* defined(_WIN32) */
   if (rv < -1) {
     log_warn(LD_GENERAL, "Couldn't set consensus from cache file %s",
              escaped(fname));
index 677d8ed81141b416c55447123c4e51b67016b477..420c3d61e4019583863b77ca188131d801cfe3e0 100644 (file)
@@ -19,5 +19,5 @@ struct networkstatus_sr_info_t {
   smartlist_t *commits;
 };
 
-#endif
+#endif /* !defined(NETWORKSTATUS_SR_INFO_ST_H) */
 
index 5c1eea32599120ab009e3b3cbe33651244a2cc1c..6e84c170d6452998247e15b95c623e017bab0c88 100644 (file)
@@ -104,4 +104,4 @@ struct networkstatus_t {
   uint8_t bw_file_digest256[DIGEST256_LEN];
 };
 
-#endif
+#endif /* !defined(NETWORKSTATUS_ST_H) */
index 4037fcdeca8bc1e95a1a3d3b5a2d8bff45291cd2..66af82a8e34c950d9d1c36575e246902f686ea8f 100644 (file)
@@ -27,4 +27,4 @@ struct networkstatus_voter_info_t {
   smartlist_t *sigs;
 };
 
-#endif
+#endif /* !defined(NETWORKSTATUS_VOTER_INFO_ST_H) */
index 9bdc6b50e80a74d9203e35184ce5f82b6009b5e5..78db2a5f9186bbf20cb9bad41f8b25bb71dbd88e 100644 (file)
@@ -16,4 +16,4 @@ int is_legal_nickname(const char *s);
 int is_legal_nickname_or_hexdigest(const char *s);
 int is_legal_hexdigest(const char *s);
 
-#endif
+#endif /* !defined(TOR_NICKNAME_H) */
index ed7450b92c8409fddcb1894e539902937a2b86c7..d8b4aca5c1a3ccbb1d664ebf1ad3e08ca3fe1701 100644 (file)
@@ -97,6 +97,6 @@ STATIC const routerstatus_t *router_pick_directory_server_impl(
                                            int *n_busy_out);
 STATIC int router_is_already_dir_fetching(const tor_addr_port_t *ap,
                                           int serverdesc, int microdesc);
-#endif
+#endif /* defined(NODE_SELECT_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_NODE_SELECT_H) */
index 53ffde29e4c9538ea8eb5e4e9c434e60022505b4..c63a535a19626ea5ebab627eda26913432dfaed8 100644 (file)
@@ -99,4 +99,4 @@ struct node_t {
   struct hsdir_index_t hsdir_index;
 };
 
-#endif
+#endif /* !defined(NODE_ST_H) */
index bc5dafce03b0cada919ea36eede4230579ce8cf4..31b71e77a046a5016bf5f52d702ce21d9561000f 100644 (file)
@@ -47,4 +47,4 @@ char *nodefamily_canonicalize(const char *s, const uint8_t *rsa_id_self,
 
 void nodefamily_free_all(void);
 
-#endif
+#endif /* !defined(TOR_NODEFAMILY_H) */
index be533da824258f0a3baefed5f55d4ea0f5318330..20390c93089b8fcac27fde72a3c3638b910804ba 100644 (file)
@@ -45,4 +45,4 @@ struct nodefamily_t {
 #define NODEFAMILY_MEMBER_PTR(nf, i) \
   (&((nf)->family_members[(i) * NODEFAMILY_MEMBER_LEN]))
 
-#endif
+#endif /* !defined(TOR_NODEFAMILY_ST_H) */
index bfa28c7754229040205661fbdf601200dcd4fab5..ca66e660b39cc69dafac4fc3dfe717ba9e2252dc 100644 (file)
@@ -24,4 +24,4 @@ smartlist_t *router_get_all_orports(const routerinfo_t *ri);
 const char *router_purpose_to_string(uint8_t p);
 uint8_t router_purpose_from_string(const char *s);
 
-#endif
+#endif /* !defined(TOR_ROUTERINFO_H) */
index 59656818c16d870319f84d8afd108818c9f4a110..59fd56d0a054effbf7c26152af291fbf6a039987 100644 (file)
@@ -112,4 +112,4 @@ struct routerinfo_t {
   uint8_t purpose;
 };
 
-#endif
+#endif /* !defined(ROUTERINFO_ST_H) */
index 7446ead3cbc7c040714d32cd8dfb53250ebc55db..10b919a1bf402254b40c1628a4d299ffca43f2ae 100644 (file)
@@ -36,5 +36,5 @@ struct routerlist_t {
   desc_store_t extrainfo_store;
 };
 
-#endif
+#endif /* !defined(ROUTERLIST_ST_H) */
 
index 8d91b45e11a5ed21e96eae24a5fa2d62b7b61ee5..46337c9e5206961cd2c428a67f4f59f875562d10 100644 (file)
@@ -78,5 +78,5 @@ struct routerstatus_t {
 
 };
 
-#endif
+#endif /* !defined(ROUTERSTATUS_ST_H) */
 
index bdcebf184a7b671a48fa63c0daf03b6717bcf420..64c28f7440865b4127239e21005846f8bb073a01 100644 (file)
@@ -57,5 +57,5 @@ struct signed_descriptor_t {
   unsigned int send_unencrypted : 1;
 };
 
-#endif
+#endif /* !defined(SIGNED_DESCRIPTOR_ST_H) */
 
index 366754c166184d20d69c64e9c7c4360f9f895150..0d909da2602b11e28c56a90935f62c2d08ff141a 100644 (file)
@@ -38,4 +38,4 @@ struct vote_routerstatus_t {
   uint8_t ed25519_id[ED25519_PUBKEY_LEN];
 };
 
-#endif
+#endif /* !defined(VOTE_ROUTERSTATUS_ST_H) */
index f68efc90963e02b4545be5ae011d6007ead7de26..05b97e0ae215b105521404458afe4a61acfdcd27 100644 (file)
@@ -1394,7 +1394,7 @@ configured_nameserver_address(const size_t idx)
 
  return NULL;
 }
-#endif
+#endif /* defined(HAVE_EVDNS_BASE_GET_NAMESERVER_ADDR) */
 
 /** Configure eventdns nameservers if force is true, or if the configuration
  * has changed since the last time we called this function, or if we failed on
index 0df921e057d1d45185efed8bae4147ff36113afa..cf478bc1a0a6d60813af4cb2a7ebaa63ebe61ae8 100644 (file)
@@ -20,4 +20,4 @@ int onion_num_pending(uint16_t handshake_type);
 void onion_pending_remove(or_circuit_t *circ);
 void clear_pending_onions(void);
 
-#endif
+#endif /* !defined(TOR_ONION_QUEUE_H) */
index 8908b5741570f170379813d2bea84fb27ee55480..b48b4958958b4e0e940259987918d03980271ab1 100644 (file)
@@ -24,7 +24,7 @@
 #include "feature/relay/routerkeys.h"
 #include "feature/relay/routermode.h"
 #include "feature/relay/selftest.h"
-#include "src/feature/stats/predict_ports.h"
+#include "feature/stats/predict_ports.h"
 
 #include "lib/crypt_ops/crypto_rand.h"
 
index 82dad3191d2050251fcf210a1c8206356ac946f2..e0daf34db262523098366668cc0df1453ed10d91 100644 (file)
@@ -353,7 +353,7 @@ set_server_identity_key_digest_testing(const uint8_t *digest)
 {
   memcpy(server_identitykey_digest, digest, DIGEST_LEN);
 }
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 /** Make sure that we have set up our identity keys to match or not match as
  * appropriate, and die with an assertion if we have not. */
index a80ec8936ea8220c9d0ea6df2f4500353521e3da..aea77ec7912ea8902a37324f1b893e36bc8c7662 100644 (file)
@@ -21,4 +21,4 @@ void router_orport_found_reachable(void);
 void router_dirport_found_reachable(void);
 void router_perform_bandwidth_test(int num_circs, time_t now);
 
-#endif
+#endif /* !defined(TOR_SELFTEST_H) */
index 7bd4f2fe8c55817e9919dfb3fea2357ffbd816a4..51a1798fcb2eebdc72f4ece8ee10776798441cf7 100644 (file)
@@ -14,5 +14,5 @@ struct rend_authorized_client_t {
   crypto_pk_t *client_key;
 };
 
-#endif
+#endif /* !defined(REND_AUTHORIZED_CLIENT_ST_H) */
 
index 05ff145d531a40a3b9058b3751ac374167fa7904..bd8a60f0d990145c766a563ec48f558c29ec4c24 100644 (file)
@@ -13,5 +13,5 @@ struct rend_encoded_v2_service_descriptor_t {
   char *desc_str; /**< Descriptor string. */
 };
 
-#endif
+#endif /* !defined(REND_ENCODED_V2_SERVICE_DESCRIPTOR_ST_H) */
 
index de6987e5698c73b010ffb9a9825fbc20c9ee9535..4882b6275289b1379ca98991f4d5a4bb55543e12 100644 (file)
@@ -73,4 +73,4 @@ struct rend_intro_point_t {
   unsigned int circuit_established:1;
 };
 
-#endif
+#endif /* !defined(REND_INTRO_POINT_ST_H) */
index aeb3178064761b75b55afe0235090e3bb35527e1..ff7627ce967393ad7839c397fb45ed3c79657443 100644 (file)
@@ -30,5 +30,5 @@ struct rend_service_descriptor_t {
   smartlist_t *successful_uploads;
 };
 
-#endif
+#endif /* !defined(REND_SERVICE_DESCRIPTOR_ST_H) */
 
index 0cef931e901f0a59fd15f4e455ca939b949da83c..b1ccce9b6c19c56caad1eb5641854a38ed28073a 100644 (file)
@@ -29,4 +29,4 @@ int rend_parse_introduction_points(rend_service_descriptor_t *parsed,
                                    size_t intro_points_encoded_size);
 int rend_parse_client_keys(strmap_t *parsed_clients, const char *str);
 
-#endif
+#endif /* !defined(TOR_REND_PARSE_H) */
index 272344da2f5389c3c60d3c8637ecbd91e02e659d..45b206c23a2f52b1d841302cf8bc5dd8d9bab13f 100644 (file)
@@ -27,4 +27,4 @@ int rep_hist_circbuilding_dormant(time_t now);
 int predicted_ports_prediction_time_remaining(time_t now);
 void predicted_ports_free_all(void);
 
-#endif
+#endif /* !defined(TOR_PREDICT_PORTS_H) */
index 3accc8c6107ffdfe7ce19a19e7acacd92a756a5b..0d72946382ece710ea68804a5022119d8496b45b 100644 (file)
@@ -103,7 +103,7 @@ typedef struct bw_array_t bw_array_t;
 STATIC uint64_t find_largest_max(bw_array_t *b);
 STATIC void commit_max(bw_array_t *b);
 STATIC void advance_obs(bw_array_t *b);
-#endif
+#endif /* defined(REPHIST_PRIVATE) */
 
 /**
  * Represents the type of a cell for padding accounting
index fa82241b28efe285d3cfb3f3f5b1a26cfd8ecdf9..b8b62881396824e3f1bcb701d0e5fee8969ee9fc 100644 (file)
@@ -129,7 +129,7 @@ tor_ntohll(uint64_t a)
 {
   return a;
 }
-#else
+#else /* !(defined(WORDS_BIGENDIAN)) */
 static inline uint16_t
 tor_htons(uint16_t a)
 {
@@ -177,6 +177,6 @@ tor_ntohll(uint64_t a)
 {
   return tor_htonll(a);
 }
-#endif
+#endif /* defined(WORDS_BIGENDIAN) */
 
-#endif
+#endif /* !defined(TOR_BYTES_H) */
index 18b76cc1a1d6e34ffaac79610cb2a29e83d59bc3..a8d1593214ad34bea0bda88d48ee3023f9d1f47d 100644 (file)
 #define EAT_SEMICOLON                                   \
   struct dummy_semicolon_eater__
 
-#endif /* !defined(TOR_COMPAT_H) */
+#endif /* !defined(TOR_COMPAT_COMPILER_H) */
index e42976360ff15633f0e6b24bd2dfc14bdb7d8284..bedf0b83a69a5608deda595f498701c98e2d9525 100644 (file)
@@ -22,7 +22,7 @@
 /* If C11 is available, just use _Static_assert.  */
 #define CTASSERT(x) _Static_assert((x), #x)
 
-#else
+#else /* !(__STDC_VERSION__ >= 201112L) */
 
 /*
  * If C11 is not available, expand __COUNTER__, or __INCLUDE_LEVEL__
 #else
 /* hope it's unique enough */
 #define CTASSERT(x) CTASSERT_EXPN((x), l, __LINE__)
-#endif
+#endif /* defined(__COUNTER__) || ... */
 
 #define CTASSERT_EXPN(x, a, b) CTASSERT_DECL(x, a, b)
 #define CTASSERT_DECL(x, a, b) \
   typedef char tor_ctassert_##a##_##b[(x) ? 1 : -1] ATTR_UNUSED
 
-#endif
+#endif /* __STDC_VERSION__ >= 201112L */
 
 #endif /* !defined(TOR_CTASSERT_H) */
index 9a66aada18205ea30952f4e5235d1a16f5b4bbc4..523f378ed7ebe4f039c732274c6926229700f966 100644 (file)
@@ -96,9 +96,9 @@ typedef int32_t ssize_t;
 #  else
 #    define TOR_PRIuSZ PRIu32
 #  endif
-#else
+#else /* !(defined(_WIN32)) */
 #  define TOR_PRIuSZ "zu"
-#endif
+#endif /* defined(_WIN32) */
 
 #ifdef _WIN32
 #  ifdef _WIN64
@@ -106,9 +106,9 @@ typedef int32_t ssize_t;
 #  else
 #    define TOR_PRIdSZ PRId32
 #  endif
-#else
+#else /* !(defined(_WIN32)) */
 #  define TOR_PRIdSZ "zd"
-#endif
+#endif /* defined(_WIN32) */
 
 #ifndef SSIZE_MAX
 #if (SIZEOF_SIZE_T == 4)
index 45d0d4d6029547ffcf0a820dc2a5b31446804c01..a99ea67e0bf40b8b77c7c7cbe2f5ecba2868faa2 100644 (file)
@@ -25,7 +25,7 @@
  * all invocations of zstd's static-only functions in a check to make sure
  * that the compile-time version matches the run-time version. */
 #define ZSTD_STATIC_LINKING_ONLY
-#endif
+#endif /* defined(ENABLE_ZSTD_ADVANCED_APIS) */
 
 #ifdef HAVE_ZSTD
 #ifdef HAVE_CFLAG_WUNUSED_CONST_VARIABLE
@@ -35,7 +35,7 @@ DISABLE_GCC_WARNING(unused-const-variable)
 #ifdef HAVE_CFLAG_WUNUSED_CONST_VARIABLE
 ENABLE_GCC_WARNING(unused-const-variable)
 #endif
-#endif
+#endif /* defined(HAVE_ZSTD) */
 
 /** Total number of bytes allocated for Zstandard state. */
 static atomic_counter_t total_zstd_allocation;
@@ -77,7 +77,7 @@ tor_zstd_format_version(char *buf, size_t buflen, unsigned version_number)
                version_number / 100 % 100,
                version_number % 100);
 }
-#endif
+#endif /* defined(HAVE_ZSTD) */
 
 #define VERSION_STR_MAX_LEN 16 /* more than enough space for 99.99.99 */
 
@@ -125,9 +125,9 @@ tor_zstd_can_use_static_apis(void)
   }
 #endif
   return (ZSTD_VERSION_NUMBER == ZSTD_versionNumber());
-#else
+#else /* !(defined(ZSTD_STATIC_LINKING_ONLY) && defined(HAVE_ZSTD)) */
   return 0;
-#endif
+#endif /* defined(ZSTD_STATIC_LINKING_ONLY) && defined(HAVE_ZSTD) */
 }
 
 /** Internal Zstandard state for incremental compression/decompression.
@@ -237,7 +237,7 @@ tor_zstd_state_size_precalc(int compress, int preset)
 #endif
     }
   }
-#endif
+#endif /* defined(ZSTD_STATIC_LINKING_ONLY) */
   return tor_zstd_state_size_precalc_fake(compress, preset);
 }
 #endif /* defined(HAVE_ZSTD) */
@@ -527,7 +527,7 @@ tor_zstd_warn_if_version_mismatched(void)
              "For safety, we'll avoid using advanced zstd functionality.",
              header_version, runtime_version);
   }
-#endif
+#endif /* defined(HAVE_ZSTD) && defined(ENABLE_ZSTD_ADVANCED_APIS) */
 }
 
 #ifdef TOR_UNIT_TESTS
@@ -538,4 +538,4 @@ tor_zstd_set_static_apis_disabled_for_testing(int disabled)
 {
   static_apis_disable_for_testing = disabled;
 }
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
index 910d5fea65c8214251b56b0bd59f2318b2531022..45992796af5b24c9c27dc874d8a48ff69a57f45d 100644 (file)
@@ -83,4 +83,4 @@ bitarray_is_set(bitarray_t *b, int bit)
   return b[bit >> BITARRAY_SHIFT] & (1u << (bit & BITARRAY_MASK));
 }
 
-#endif /* !defined(TOR_CONTAINER_H) */
+#endif /* !defined(TOR_BITARRAY_H) */
index d61b1ec18f8f2bee340f69559107f578216ce284..9da1d3072c21ac282564d5eeb7ed591627f892a6 100644 (file)
@@ -258,4 +258,4 @@ void* strmap_remove_lc(strmap_t *map, const char *key);
     return digestmap_iter_done((digestmap_iter_t*)iter);                \
   }
 
-#endif /* !defined(TOR_CONTAINER_H) */
+#endif /* !defined(TOR_MAP_H) */
index 97792e13ba2b423be3d1571e859edf4f5e636cc8..b96bc13f3a825a17a09701a0c9e54e88540b1d78 100644 (file)
@@ -32,4 +32,4 @@ unsigned namemap_get_or_create_id(namemap_t *map,
 size_t namemap_get_size(const namemap_t *map);
 void namemap_clear(namemap_t *map);
 
-#endif
+#endif /* !defined(TOR_NAMEMAP_H) */
index 5717352fa2def8ca646f8a0c8f82b948d00e8b0a..5008fd5855a448fc92beb37bc2328cefdf5552b9 100644 (file)
@@ -31,4 +31,4 @@ struct namemap_t {
 /** Macro to initialize a namemap. */
 #define NAMEMAP_INIT() { HT_INITIALIZER(), NULL }
 
-#endif
+#endif /* !defined(NAMEMAP_ST_H) */
index a176d6d8a6d5d9269904dfc9ceca9d1c754a70b2..3f2fd054a0b229f35d36329e405475538f5427e0 100644 (file)
@@ -57,4 +57,4 @@ third_quartile_uint32(uint32_t *array, int n_elements)
   return find_nth_uint32(array, n_elements, (n_elements*3)/4);
 }
 
-#endif /* !defined(TOR_CONTAINER_H) */
+#endif /* !defined(TOR_ORDER_H) */
index 77682db03ec3e6d529d43e842d5f6b5ace7149f4..81b0151433a3614bf3d86e7e373068463a133781 100644 (file)
@@ -165,4 +165,4 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join,
   }                                             \
   STMT_END
 
-#endif /* !defined(TOR_CONTAINER_H) */
+#endif /* !defined(TOR_SMARTLIST_H) */
index cc4fbf7a41707b561565373a253fc2cfd4c138a0..88d63c1df28f0fa0a9fd71a8f172cf87d813a30e 100644 (file)
@@ -54,4 +54,4 @@ int crypto_cipher_decrypt_with_iv(const char *key,
                                   char *to, size_t tolen,
                                   const char *from, size_t fromlen);
 
-#endif /* !defined(TOR_CRYPTO_H) */
+#endif /* !defined(TOR_CRYPTO_CIPHER_H) */
index 8c6388fd5d8f202d3f1c30e3dd7147caa13c77ca..75cee1b596fbfd1db7c2b10ba96ae6e50655d487 100644 (file)
@@ -34,7 +34,7 @@ static int tor_check_dh_key(int severity, const BIGNUM *bn);
 struct crypto_dh_t {
   DH *dh; /**< The openssl DH object */
 };
-#endif
+#endif /* !defined(ENABLE_NSS) */
 
 static DH *new_openssl_dh_from_params(BIGNUM *p, BIGNUM *g);
 
@@ -100,7 +100,7 @@ crypto_validate_dh_params(const BIGNUM *p, const BIGNUM *g)
     DH_free(dh);
   return ret;
 }
-#endif
+#endif /* 0 */
 
 /**
  * Helper: convert <b>hex<b> to a bignum, and return it.  Assert that the
@@ -202,7 +202,7 @@ crypto_dh_new(int dh_type)
     tor_free(res); // sets res to NULL.
   return res;
 }
-#endif
+#endif /* !defined(ENABLE_NSS) */
 
 /** Create and return a new openssl DH from a given prime and generator. */
 static DH *
@@ -461,7 +461,7 @@ crypto_dh_free_(crypto_dh_t *dh)
   DH_free(dh->dh);
   tor_free(dh);
 }
-#endif
+#endif /* !defined(ENABLE_NSS) */
 
 void
 crypto_dh_free_all_openssl(void)
index 9da135e9c4c559e802dfe41799d2ce9bfb3c2e87..64a7d2d52cf9f1f7fbda685fc7c3732be418a753 100644 (file)
@@ -149,9 +149,9 @@ struct crypto_xof_t {
    * outside the tests yet.
    */
   EVP_MD_CTX *ctx;
-#else
+#else /* !(defined(OPENSSL_HAS_SHAKE3_EVP)) */
   keccak_state s;
-#endif
+#endif /* defined(OPENSSL_HAS_SHAKE3_EVP) */
 };
 
 /** Allocate a new XOF object backed by SHAKE-256.  The security level
@@ -169,9 +169,9 @@ crypto_xof_new(void)
   tor_assert(xof->ctx);
   int r = EVP_DigestInit(xof->ctx, EVP_shake256());
   tor_assert(r == 1);
-#else
+#else /* !(defined(OPENSSL_HAS_SHAKE256)) */
   keccak_xof_init(&xof->s, 256);
-#endif
+#endif /* defined(OPENSSL_HAS_SHAKE256) */
   return xof;
 }
 
@@ -188,7 +188,7 @@ crypto_xof_add_bytes(crypto_xof_t *xof, const uint8_t *data, size_t len)
 #else
   int i = keccak_xof_absorb(&xof->s, data, len);
   tor_assert(i == 0);
-#endif
+#endif /* defined(OPENSSL_HAS_SHAKE256) */
 }
 
 /** Squeeze bytes out of a XOF object.  Calling this routine will render
@@ -203,7 +203,7 @@ crypto_xof_squeeze_bytes(crypto_xof_t *xof, uint8_t *out, size_t len)
 #else
   int i = keccak_xof_squeeze(&xof->s, out, len);
   tor_assert(i == 0);
-#endif
+#endif /* defined(OPENSSL_HAS_SHAKE256) */
 }
 
 /** Cleanse and deallocate a XOF object. */
@@ -236,10 +236,10 @@ crypto_xof(uint8_t *output, size_t output_len,
   r = EVP_DigestFinalXOF(ctx, output, output_len);
   tor_assert(r == 1);
   EVP_MD_CTX_free(ctx);
-#else
+#else /* !(defined(OPENSSL_HAS_SHA3)) */
   crypto_xof_t *xof = crypto_xof_new();
   crypto_xof_add_bytes(xof, input, input_len);
   crypto_xof_squeeze_bytes(xof, output, output_len);
   crypto_xof_free(xof);
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
 }
index a1c92351fc1f1a4420f86e5ecc6dab3222f1b2dd..c631b0eac0dddb207a7a3c2371ce743cb8911556 100644 (file)
@@ -70,7 +70,7 @@ crypto_digest256(char *digest, const char *m, size_t len,
 #else
     ret = (sha3_256((uint8_t *)digest, DIGEST256_LEN,(const uint8_t *)m, len)
            > -1);
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
   }
 
   if (!ret)
@@ -100,7 +100,7 @@ crypto_digest512(char *digest, const char *m, size_t len,
 #else
     ret = (sha3_512((uint8_t*)digest, DIGEST512_LEN, (const uint8_t*)m, len)
            > -1);
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
   }
 
   if (!ret)
@@ -167,7 +167,7 @@ crypto_digest_alloc_bytes(digest_algorithm_t alg)
     case DIGEST_SHA3_256: /* Fall through */
     case DIGEST_SHA3_512:
       return END_OF_FIELD(d.sha3);
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
     default:
       tor_assert(0); // LCOV_EXCL_LINE
       return 0;      // LCOV_EXCL_LINE
@@ -212,14 +212,14 @@ crypto_digest_new_internal(digest_algorithm_t algorithm)
         return NULL;
       }
       break;
-#else
+#else /* !(defined(OPENSSL_HAS_SHA3)) */
     case DIGEST_SHA3_256:
       keccak_digest_init(&r->d.sha3, 256);
       break;
     case DIGEST_SHA3_512:
       keccak_digest_init(&r->d.sha3, 512);
       break;
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
     default:
       tor_assert_unreached();
     }
@@ -271,7 +271,7 @@ crypto_digest_free_(crypto_digest_t *digest)
       EVP_MD_CTX_free(digest->d.md);
     }
   }
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
   size_t bytes = crypto_digest_alloc_bytes(digest->algorithm);
   memwipe(digest, 0, bytes);
   tor_free(digest);
@@ -310,12 +310,12 @@ crypto_digest_add_bytes(crypto_digest_t *digest, const char *data,
       tor_assert(r);
   }
       break;
-#else
+#else /* !(defined(OPENSSL_HAS_SHA3)) */
     case DIGEST_SHA3_256: /* FALLSTHROUGH */
     case DIGEST_SHA3_512:
       keccak_digest_update(&digest->d.sha3, (const uint8_t *)data, len);
       break;
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
     default:
       /* LCOV_EXCL_START */
       tor_fragile_assert();
@@ -354,12 +354,12 @@ crypto_digest_get_digest(crypto_digest_t *digest,
     EVP_MD_CTX_free(tmp);
     tor_assert(res == 1);
     goto done;
-#else
+#else /* !(defined(OPENSSL_HAS_SHA3)) */
     /* Tiny-Keccak handles copying into a temporary ctx, and also can handle
      * short output buffers by truncating appropriately. */
     keccak_digest_sum(&digest->d.sha3, (uint8_t *)out, out_len);
     return;
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
   }
 
   const size_t alloc_bytes = crypto_digest_alloc_bytes(digest->algorithm);
@@ -412,7 +412,7 @@ crypto_digest_dup(const crypto_digest_t *digest)
     result->d.md = EVP_MD_CTX_new();
     EVP_MD_CTX_copy(result->d.md, digest->d.md);
   }
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
   return result;
 }
 
@@ -458,7 +458,7 @@ crypto_digest_assign(crypto_digest_t *into,
     EVP_MD_CTX_copy(into->d.md, from->d.md);
     return;
   }
-#endif
+#endif /* defined(OPENSSL_HAS_SHA3) */
 
   memcpy(into,from,alloc_bytes);
 }
index fd2e7016519bbd8dd0d8c32a028ad14f5c800977..e0f3d65ad1a78958318d70683ed674b707c76f85 100644 (file)
@@ -25,7 +25,7 @@
 #include <openssl/kdf.h>
 #define HAVE_OPENSSL_HKDF 1
 #endif
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 #include <string.h>
 
@@ -109,7 +109,7 @@ crypto_expand_key_material_rfc5869_sha256_openssl(
   return 0;
 }
 
-#else
+#else /* !(defined(HAVE_OPENSSL_HKDF)) */
 
 /**
  * Perform RFC5869 HKDF computation using our own legacy implementation.
@@ -166,7 +166,7 @@ crypto_expand_key_material_rfc5869_sha256_legacy(
   memwipe(mac, 0, sizeof(mac));
   return 0;
 }
-#endif
+#endif /* defined(HAVE_OPENSSL_HKDF) */
 
 /** Expand some secret key material according to RFC5869, using SHA256 as the
  * underlying hash.  The <b>key_in_len</b> bytes at <b>key_in</b> are the
@@ -191,11 +191,11 @@ crypto_expand_key_material_rfc5869_sha256(
                                              salt_in_len, info_in,
                                              info_in_len,
                                              key_out, key_out_len);
-#else
+#else /* !(defined(HAVE_OPENSSL_HKDF)) */
   return crypto_expand_key_material_rfc5869_sha256_legacy(key_in,
                                                key_in_len, salt_in,
                                                salt_in_len, info_in,
                                                info_in_len,
                                                key_out, key_out_len);
-#endif
+#endif /* defined(HAVE_OPENSSL_HKDF) */
 }
index 5c2780b2ca981652e714bdc2e4a5610ef31eab9e..a16bf4e11aba7a4e00e2a42d3aa9c51f446c2867 100644 (file)
@@ -99,7 +99,7 @@ crypto_global_init(int useAccel, const char *accelName, const char *accelDir)
     (void)useAccel;
     (void)accelName;
     (void)accelDir;
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 #ifdef ENABLE_NSS
     if (crypto_nss_late_init() < 0)
       return -1;
index 540d08eb56374c7a0600d0ef4a794572095e8654..8de3eb03ed9963406b531b3ae829095792d6f41c 100644 (file)
@@ -33,4 +33,4 @@ const char *crypto_get_header_version_string(void);
 
 int tor_is_using_nss(void);
 
-#endif /* !defined(TOR_CRYPTO_H) */
+#endif /* !defined(TOR_CRYPTO_INIT_H) */
index 72fd2a1229592e906df35266a93102baefe2e3e0..4cfa9b42a48ad324f650ce5e01055adef3ac1812 100644 (file)
@@ -29,6 +29,6 @@ void crypto_nss_global_cleanup(void);
 
 void crypto_nss_prefork(void);
 void crypto_nss_postfork(void);
-#endif
+#endif /* defined(ENABLE_NSS) */
 
-#endif /* !defined(TOR_CRYPTO_NSS_H) */
+#endif /* !defined(TOR_CRYPTO_NSS_MGT_H) */
index 2186d2a939dc7ce357dc3adbfdbf48a9b2f61610..4bd4b35706e25b696f85841e4dc1d7c01d64ae10 100644 (file)
@@ -57,9 +57,9 @@ ope_val_from_le(ope_val_t x)
     ((x) >> 8) |
     (((x)&0xff) << 8);
 }
-#else
+#else /* !(defined(WORDS_BIGENDIAN)) */
 #define ope_val_from_le(x) (x)
-#endif
+#endif /* defined(WORDS_BIGENDIAN) */
 
 /**
  * Return a new AES256-CTR stream cipher object for <b>ope</b>, ready to yield
index 610d9563354866521399a0f3b66ce39901c18e4c..9778dfe0f08ab290b78bda05fa4e69867fbe20bd 100644 (file)
@@ -41,6 +41,6 @@ struct aes_cnt_cipher;
 STATIC struct aes_cnt_cipher *ope_get_cipher(const crypto_ope_t *ope,
                                               uint32_t initial_idx);
 STATIC uint64_t sum_values_from_cipher(struct aes_cnt_cipher *c, size_t n);
-#endif
+#endif /* defined(CRYPTO_OPE_PRIVATE) */
 
-#endif
+#endif /* !defined(CRYPTO_OPE_H) */
index c97815f9a4e7590debd13542ac22f92290856784..9ec59e7c81e33c44daaa49cc981716cee54366b1 100644 (file)
@@ -200,10 +200,10 @@ crypto_openssl_early_init(void)
                      OPENSSL_INIT_LOAD_CRYPTO_STRINGS |
                      OPENSSL_INIT_ADD_ALL_CIPHERS |
                      OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
-#else
+#else /* !(defined(OPENSSL_1_1_API)) */
     ERR_load_crypto_strings();
     OpenSSL_add_all_algorithms();
-#endif
+#endif /* defined(OPENSSL_1_1_API) */
 
     setup_openssl_threading();
 
index a3dd03aa04e6992c1d85f6044891a314b460ed8e..111a2d12ed7ae9742c89504f80b79125511c64e3 100644 (file)
@@ -84,6 +84,6 @@ int crypto_openssl_late_init(int useAccel, const char *accelName,
 void crypto_openssl_thread_cleanup(void);
 void crypto_openssl_global_cleanup(void);
 
-#endif /* ENABLE_OPENSSL */
+#endif /* defined(ENABLE_OPENSSL) */
 
 #endif /* !defined(TOR_CRYPTO_OPENSSL_H) */
index 79c8ed1eedc0ace340827f444043b074b0d97195..a80a98f2670a088699ee2f768b97a794b0dc032f 100644 (file)
@@ -47,7 +47,7 @@ DISABLE_GCC_WARNING(redundant-decls)
 #include <openssl/rand.h>
 #include <openssl/sha.h>
 ENABLE_GCC_WARNING(redundant-decls)
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 #ifdef ENABLE_NSS
 #include <pk11pub.h>
@@ -419,7 +419,7 @@ crypto_seed_openssl_rng(void)
   else
     return -1;
 }
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 #ifdef ENABLE_NSS
 /**
@@ -442,7 +442,7 @@ crypto_seed_nss_rng(void)
 
   return load_entropy_ok ? 0 : -1;
 }
-#endif
+#endif /* defined(ENABLE_NSS) */
 
 /**
  * Seed the RNG for any and all crypto libraries that we're using with bytes
@@ -520,13 +520,13 @@ crypto_rand_unmocked(char *to, size_t n)
 
 #undef BUFLEN
   }
-#else
+#else /* !(defined(ENABLE_NSS)) */
   int r = RAND_bytes((unsigned char*)to, (int)n);
   /* We consider a PRNG failure non-survivable. Let's assert so that we get a
    * stack trace about where it happened.
    */
   tor_assert(r >= 0);
-#endif
+#endif /* defined(ENABLE_NSS) */
 }
 
 /**
@@ -627,6 +627,6 @@ crypto_force_rand_ssleay(void)
     RAND_set_rand_method(default_method);
     return 1;
   }
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
   return 0;
 }
index 528f238fa52467fcb1445f8f1c9bf0ea42b06f74..a019287aa90044632d0bea5ecd6b9aee14bbe36a 100644 (file)
@@ -87,7 +87,7 @@ crypto_fast_rng_t *get_thread_fast_rng(void);
 void destroy_thread_fast_rng(void);
 void crypto_rand_fast_init(void);
 void crypto_rand_fast_shutdown(void);
-#endif
+#endif /* defined(CRYPTO_PRIVATE) */
 
 #if defined(TOR_UNIT_TESTS)
 /* Used for white-box testing */
@@ -96,7 +96,7 @@ size_t crypto_fast_rng_get_bytes_used_per_stream(void);
 void crypto_fast_rng_disable_reseed(crypto_fast_rng_t *rng);
 /* To override the prng for testing. */
 crypto_fast_rng_t *crypto_replace_thread_fast_rng(crypto_fast_rng_t *rng);
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 #ifdef CRYPTO_RAND_PRIVATE
 
index b71ade81bdabc436747ab76f703f5f2f9869747e..c7f71a17c91c0d9dc0a87fe84e41faa161b0c1d4 100644 (file)
@@ -182,7 +182,7 @@ crypto_fast_rng_new_from_seed(const uint8_t *seed)
   /* We decided above that noinherit would always do _something_. Assert here
    * that we were correct. */
   tor_assert(inherit != INHERIT_RES_KEEP);
-#endif
+#endif /* defined(CHECK_PID) || ... */
   return result;
 }
 
@@ -196,7 +196,7 @@ crypto_fast_rng_disable_reseed(crypto_fast_rng_t *rng)
 {
   rng->n_till_reseed = -1;
 }
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 /**
  * Helper: create a crypto_cipher_t object from SEED_LEN bytes of
@@ -251,7 +251,7 @@ crypto_fast_rng_refill(crypto_fast_rng_t *rng)
 #else
     /* If testing is disabled, this shouldn't be able to become negative. */
     tor_assert_unreached();
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
   }
   /* Now fill rng->buf with output from our stream cipher, initialized from
    * that seed value. */
@@ -302,7 +302,7 @@ crypto_fast_rng_getbytes_impl(crypto_fast_rng_t *rng, uint8_t *out,
      */
     tor_assert(rng->owner == getpid());
   }
-#endif
+#endif /* defined(CHECK_PID) */
 
   size_t bytes_to_yield = n;
 
@@ -356,7 +356,7 @@ crypto_fast_rng_get_bytes_used_per_stream(void)
 {
   return BUFLEN;
 }
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 /**
  * Thread-local instance for our fast RNG.
@@ -409,7 +409,7 @@ crypto_replace_thread_fast_rng(crypto_fast_rng_t *rng)
   tor_threadlocal_set(&thread_rng, rng);
   return old_rng;
 }
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 /**
  * Initialize the global thread-local key that will be used to keep track
index c9189b0dfc87c0c091bbd1045a68eb0fe7422a7b..c39d2e18d178453effed35c5fadf3a9373428671 100644 (file)
@@ -59,7 +59,7 @@ crypto_get_rsa_padding(int padding)
     default: tor_assert(0); return -1; // LCOV_EXCL_LINE
     }
 }
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 /** Compare the public-key components of a and b.  Return non-zero iff
  * a==b.  A NULL key is considered to be distinct from all non-NULL
index c1ea767f85fbba266fb22646e20979518ae000b2..e9bfec2f857d358f1bb65ca17a6fa8069e837f73 100644 (file)
@@ -119,7 +119,7 @@ struct rsa_st *crypto_pk_get_openssl_rsa_(crypto_pk_t *env);
 crypto_pk_t *crypto_new_pk_from_openssl_rsa_(struct rsa_st *rsa);
 MOCK_DECL(struct evp_pkey_st *, crypto_pk_get_openssl_evp_pkey_,(
                                  crypto_pk_t *env,int private));
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 #ifdef ENABLE_NSS
 struct SECKEYPublicKeyStr;
@@ -129,7 +129,7 @@ const struct SECKEYPublicKeyStr *crypto_pk_get_nss_pubkey(
                                            const crypto_pk_t *key);
 const struct SECKEYPrivateKeyStr *crypto_pk_get_nss_privkey(
                                            const crypto_pk_t *key);
-#endif
+#endif /* defined(ENABLE_NSS) */
 
 void crypto_pk_assign_public(crypto_pk_t *dest, const crypto_pk_t *src);
 void crypto_pk_assign_private(crypto_pk_t *dest, const crypto_pk_t *src);
@@ -140,6 +140,6 @@ struct SECItemStr;
 STATIC int secitem_uint_cmp(const struct SECItemStr *a,
                             const struct SECItemStr *b);
 #endif
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
-#endif
+#endif /* !defined(TOR_CRYPTO_RSA_H) */
index ad2ad38b66bb40ca331013107e7714816c01a6fb..612b7a0e6401ce25844e1d71cbc0b81d25c77b02 100644 (file)
@@ -156,7 +156,7 @@ crypto_pk_get_openssl_evp_pkey_,(crypto_pk_t *pk, int private))
   tor_free(buf);
   return result;
 }
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 /** Allocate and return storage for a public key.  The key itself will not yet
  * be set.
index 42276597d41b1013548437358feaaf4a90572b03..5cf98e3e64540411d3917d821bd1c4e47aa11f0a 100644 (file)
@@ -285,7 +285,7 @@ secret_to_key_compute_key(uint8_t *key_out, size_t key_out_len,
       if (rv < 0)
         return S2K_FAILED;
       return (int)key_out_len;
-#else
+#else /* !(defined(ENABLE_OPENSSL)) */
       SECItem passItem = { .type = siBuffer,
                            .data = (unsigned char *) secret,
                            .len = (int)secret_len };
@@ -325,7 +325,7 @@ secret_to_key_compute_key(uint8_t *key_out, size_t key_out_len,
       if (alg)
         SECOID_DestroyAlgorithmID(alg, PR_TRUE);
       return rv;
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
     }
 
     case S2K_TYPE_SCRYPT: {
index 67a1a9eb925fe19a73573a26e77817981d30dc3f..5e3f4a87a1023c1cb3aa375da548b642f1bd5d30 100644 (file)
@@ -30,7 +30,7 @@ DISABLE_GCC_WARNING(redundant-decls)
 #include <openssl/err.h>
 #include <openssl/crypto.h>
 ENABLE_GCC_WARNING(redundant-decls)
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 #include "lib/log/log.h"
 #include "lib/log/util_bug.h"
index 91d53a05425565a4d318e8d52073b4b5301e18a5..7d6d687342cb228e0a09562220dcb59286ae97cc 100644 (file)
@@ -26,4 +26,4 @@ void digestset_add(digestset_t *set, const char *addr);
 int digestset_probably_contains(const digestset_t *set,
                                 const char *addr);
 
-#endif
+#endif /* !defined(TOR_DIGESTSET_H) */
index a2ffbc51c206b33b92bce564d612f7c70192d09e..b0d1eba0c544506c147d9627eb8775ad22edeae8 100644 (file)
@@ -19,4 +19,4 @@
 /** Length of our legacy DH keys. */
 #define DH1024_KEY_LEN (1024/8)
 
-#endif
+#endif /* !defined(TOR_DH_SIZES_H) */
index 525e5209d6f8f7e7637f4eca4b4ee35048f3c139..a0dd97a74dca3ee12315ce667da8a4ff4f0e531c 100644 (file)
@@ -24,4 +24,4 @@
 /** Length of the output of our 64-bit optimized message digests (SHA512). */
 #define DIGEST512_LEN 64
 
-#endif
+#endif /* !defined(TOR_DIGEST_SIZES_H) */
index c25f5022c5f0c663800444ddd367e3a09fa99ad2..459afbf42d6c556fcd662604d6c56e3db920378b 100644 (file)
@@ -20,4 +20,4 @@
 /* How many nanoseconds per millisecond */
 #define TOR_NSEC_PER_MSEC (1000*1000)
 
-#endif
+#endif /* !defined(TOR_TIME_DEFS_H) */
index 8933a8866bd7b2c72cf686d733264e15bfea99fb..6431f0a2dd71efb7dd1e61a0843c2bc5a3b43a54 100644 (file)
@@ -33,4 +33,4 @@
 #define ED25519_BASE64_LEN 43
 #define ED25519_SIG_BASE64_LEN 86
 
-#endif
+#endif /* !defined(TOR_X25519_SIZES_H) */
index 8e62e8f1683632c4448fbaa63e3911047f92d87b..a9e655409a37688435860b169b286aaa9e9de7b3 100644 (file)
@@ -111,4 +111,4 @@ void dispatch_free_msg_(const dispatch_t *d, msg_t *msg);
 
 char *dispatch_fmt_msg_data(const dispatch_t *d, const msg_t *msg);
 
-#endif
+#endif /* !defined(TOR_DISPATCH_H) */
index 2c755e39bcfb91bf074dfb9fae9da75e5bf6955e..61fade7240768adadb8e43c6ecfcdfff00c33ff7 100644 (file)
@@ -36,4 +36,4 @@ int dcfg_add_recv(dispatch_cfg_t *cfg, message_id_t msg,
 
 void dcfg_free_(dispatch_cfg_t *cfg);
 
-#endif
+#endif /* !defined(TOR_DISPATCH_CFG_H) */
index d004fe5934f6edd5711e1e8dbb485e31fb7abc32..57b6f0347f500ff658310e1bddf3498549fcb8c7 100644 (file)
@@ -22,4 +22,4 @@ struct dispatch_cfg_t {
   struct smartlist_t *recv_by_msg;
 };
 
-#endif
+#endif /* !defined(TOR_DISPATCH_CFG_ST_H) */
index c116d2184ddaa18cd5bf0de65303dddf2896ec4b..fd6c83cc12f338dc41bc14fe9f4844535f42e6b1 100644 (file)
@@ -43,4 +43,4 @@ size_t get_num_msg_type_ids(void);
 
 void dispatch_naming_init(void);
 
-#endif
+#endif /* !defined(TOR_DISPATCH_NAMING_H) */
index 568107b700c0ece529c8f71b432c0a8d140d2e01..ee42518b5ae7a29b919baa3902c1788fb8f35bae 100644 (file)
@@ -103,6 +103,6 @@ struct dispatch_t {
   dispatch_typefns_t *typefns;
 };
 
-#endif
+#endif /* defined(DISPATCH_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_DISPATCH_ST_H) */
index 4e79e592a674596841f681856b25d6ca56ab27ef..b4c4a10248a50355b7485bcdcd28f7f0a542c514 100644 (file)
@@ -77,4 +77,4 @@ typedef struct dispatch_typefns_t {
   char *(*fmt_fn)(msg_aux_data_t);
 } dispatch_typefns_t;
 
-#endif
+#endif /* !defined(TOR_DISPATCH_MSGTYPES_H) */
index 44998bb85bd63d76bd5a6730abd8dc1dc25369fd..40c5593b11936207344ba55d6226bf3146636b4d 100644 (file)
@@ -58,4 +58,4 @@ size_t base32_encoded_size(size_t srclen);
 void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen);
 int base16_decode(char *dest, size_t destlen, const char *src, size_t srclen);
 
-#endif /* !defined(TOR_UTIL_FORMAT_H) */
+#endif /* !defined(TOR_BINASCII_H) */
index cd327b7a82bb37f0828aff11c58f572322b2140f..dcddfa3396afe8890d0f6031a6dc1fc91df86d38 100644 (file)
@@ -14,4 +14,4 @@
 
 int string_is_key_value(int severity, const char *string);
 
-#endif
+#endif /* !defined(TOR_KEYVAL_H) */
index 0bbb06a794acc0b79e8bb187d6acddf16ff722fe..6b20350aa8ce2ad46c1efa63976fa2ddb48dfe9a 100644 (file)
@@ -23,4 +23,4 @@ int pem_encode(char *dest, size_t destlen, const uint8_t *src, size_t srclen,
 int pem_decode(uint8_t *dest, size_t destlen, const char *src, size_t srclen,
                const char *objtype);
 
-#endif
+#endif /* !defined(TOR_PEM_H) */
index fe15b655f106469df36c5662a2e202a9db2c32bd..840e1044ce0eac8e9acf579614a3fb9a53137cdf 100644 (file)
@@ -15,4 +15,4 @@
 const char *decode_qstring(const char *start, size_t in_len_max,
                            char **out, size_t *out_len);
 
-#endif
+#endif /* !defined(TOR_ENCODING_QSTRING_H) */
index 0ddeca57fcfe8770dbc3b6c1f7ae0895e74e4005..d14bc1f902c83d805e6aa7de1d7085826aa876c2 100644 (file)
@@ -41,4 +41,4 @@ int parse_iso_time_nospace(const char *cp, time_t *t);
 int parse_http_time(const char *buf, struct tm *tm);
 int format_time_interval(char *out, size_t out_len, long interval);
 
-#endif
+#endif /* !defined(TOR_TIME_FMT_H) */
index 0badaf7c6d87569049f1da751fbc2bc9d9a978cb..c2da6697a964ac698b8cd0c92190dfded5226b5d 100644 (file)
@@ -45,4 +45,4 @@ void tor_log_sigsafe_err_set_granularity(int ms);
 int format_hex_number_sigsafe(unsigned long x, char *buf, int max_len);
 int format_dec_number_sigsafe(unsigned long x, char *buf, int max_len);
 
-#endif /* !defined(TOR_TORLOG_H) */
+#endif /* !defined(TOR_TORERR_H) */
index 9398d2baa3d26292f6f8e5b1d991f5690dfe7f74..1ce6f1bf94e9c44871d0f7a2205c491220ebecb8 100644 (file)
@@ -112,6 +112,6 @@ token_bucket_rw_get_write(const token_bucket_rw_t *bucket)
 
 STATIC uint32_t rate_per_sec_to_rate_per_step(uint32_t rate);
 
-#endif
+#endif /* defined(TOKEN_BUCKET_PRIVATE) */
 
-#endif /* TOR_TOKEN_BUCKET_H */
+#endif /* !defined(TOR_TOKEN_BUCKET_H) */
index 7af9119dbb6f162d0122182cefa71e6cbb55e9b6..29115e108519cabebc46f127a1b4d2b069e99b81 100644 (file)
@@ -20,4 +20,4 @@ int config_get_lines_include(const char *string, struct config_line_t **result,
                              int extended, int *has_include,
                              struct smartlist_t *opened_lst);
 
-#endif /* !defined(TOR_CONFLINE_H) */
+#endif /* !defined(TOR_CONFFILE_H) */
index 826bc2dfc5fafe25e3f10de9104f1d9cec466265..9ff81faa420677c20b58af149935a533e0ef289f 100644 (file)
@@ -30,4 +30,4 @@ MOCK_DECL(int, check_private_dir, (const char *dirname, cpd_check_t check,
 
 MOCK_DECL(struct smartlist_t *, tor_listdir, (const char *dirname));
 
-#endif
+#endif /* !defined(TOR_DIR_H) */
index 52c94c914f2004f14dd244b393f2b856b5dbbb1f..81dba8c140edad03af30f90895d559f78a72ef9e 100644 (file)
@@ -27,7 +27,7 @@
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
-#endif
+#endif /* defined(_WIN32) */
 
 #ifndef O_BINARY
 #define O_BINARY 0
@@ -108,7 +108,7 @@ char *read_file_to_str_until_eof(int fd, size_t max_bytes_to_read,
  * Tor is built for unit tests, or when Tor is built on an operating system
  * without its own getdelim(). */
 ssize_t compat_getdelim_(char **lineptr, size_t *n, int delim, FILE *stream);
-#endif
+#endif /* !defined(HAVE_GETDELIM) || defined(TOR_UNIT_TESTS) */
 
 #ifdef HAVE_GETDELIM
 /**
@@ -123,10 +123,10 @@ ssize_t compat_getdelim_(char **lineptr, size_t *n, int delim, FILE *stream);
  */
 #define tor_getdelim(lineptr, n, delim, stream) \
   getdelim((lineptr), (n), (delim), (stream))
-#else
+#else /* !(defined(HAVE_GETDELIM)) */
 #define tor_getdelim(lineptr, n, delim, stream) \
   compat_getdelim_((lineptr), (n), (delim), (stream))
-#endif
+#endif /* defined(HAVE_GETDELIM) */
 
 #ifdef HAVE_GETLINE
 /**
@@ -137,9 +137,9 @@ ssize_t compat_getdelim_(char **lineptr, size_t *n, int delim, FILE *stream);
  */
 #define tor_getline(lineptr, n, stream) \
   getline((lineptr), (n), (stream))
-#else
+#else /* !(defined(HAVE_GETLINE)) */
 #define tor_getline(lineptr, n, stream) \
   tor_getdelim((lineptr), (n), '\n', (stream))
-#endif
+#endif /* defined(HAVE_GETLINE) */
 
-#endif
+#endif /* !defined(TOR_FS_H) */
index 8aeee4cc7f4b851a70bb9d399e71e993e3f7af84..fc0281e2535332783c218a34d917ce3693589b22 100644 (file)
@@ -17,4 +17,4 @@ tor_lockfile_t *tor_lockfile_lock(const char *filename, int blocking,
                                   int *locked_out);
 void tor_lockfile_unlock(tor_lockfile_t *lockfile);
 
-#endif
+#endif /* !defined(TOR_LOCKFILE_H) */
index daaee1f9b1deb3238a0636044d0852591e52d5ac..f71c0cff7a9420eb140f294e9ab20c955437a4ab 100644 (file)
@@ -237,4 +237,4 @@ tor_munmap_file(tor_mmap_t *handle)
 }
 #else
 #error "cannot implement tor_mmap_file"
-#endif /* defined(HAVE_MMAP) || ... || ... */
+#endif /* defined(HAVE_MMAP) || defined(RUNNING_DOXYGEN) || ... */
index 18fb18a13c11d4951a63750f3d917a57e914a45c..61aad544b204685b163a242936b5942cbae9c91d 100644 (file)
@@ -38,4 +38,4 @@ typedef struct tor_mmap_t {
 tor_mmap_t *tor_mmap_file(const char *filename);
 int tor_munmap_file(tor_mmap_t *handle);
 
-#endif
+#endif /* !defined(TOR_MMAP_H) */
index 4675ac84e815557509c07b65f047de4b2638ab65..28a1838b8846a02a3d9c2e9de5870e6b837be1b0 100644 (file)
@@ -27,4 +27,4 @@ void clean_fname_for_stat(char *name);
 int get_parent_directory(char *fname);
 char *make_path_absolute(char *fname);
 
-#endif
+#endif /* !defined(TOR_PATH_H) */
index 5c3979487388586f4f631c97fff61fd8b6b9542d..5e5ddb89a33a695e4cbe6a57266c0db6312b444f 100644 (file)
@@ -21,6 +21,6 @@ struct passwd;
 const struct passwd *tor_getpwnam(const char *username);
 const struct passwd *tor_getpwuid(uid_t uid);
 char *get_user_homedir(const char *username);
-#endif
+#endif /* !defined(_WIN32) */
 
-#endif
+#endif /* !defined(TOR_USERDB_H) */
index 64a22439e5d0e3dc6fdb83a2cc1d06362268164c..7237226c76bb9dd8ed4731d1eac7a6587eac9671 100644 (file)
@@ -17,6 +17,6 @@
 #include <tchar.h>
 
 HANDLE load_windows_system_library(const TCHAR *library_name);
-#endif
+#endif /* defined(_WIN32) */
 
-#endif
+#endif /* !defined(TOR_WINLIB_H) */
index 9a8911d49439fae51eeb26082a13a025272385d9..a24a1c4c0de6862be316c6e9c6255bbe9376acb2 100644 (file)
@@ -13,4 +13,4 @@ typedef int16_t country_t;
 
 #define COUNTRY_MAX INT16_MAX
 
-#endif
+#endif /* !defined(TOR_COUNTRY_H) */
index 83efa8291910fa962504779750b38596e19bc332..3f745d457da4cdaa0e4ef07925413cc89027f06e 100644 (file)
@@ -16,4 +16,4 @@
 
 uint32_t tor_add_u32_nowrap(uint32_t a, uint32_t b);
 
-#endif /* !defined(TOR_INTMATH_MULDIV_H) */
+#endif /* !defined(TOR_INTMATH_ADDSUB_H) */
index a4cecd69ccd561b15044e0df3bea90df538cf78c..b2f77462e17f541706327e8e95ff638b3d22a109 100644 (file)
@@ -17,4 +17,4 @@
 /** Macro: true if two values have different boolean values. */
 #define bool_neq(a,b) (!(a)!=!(b))
 
-#endif
+#endif /* !defined(HAVE_TOR_LOGIC_H) */
index e26bf58cbbc139d6e0a610225af530442e43446b..40941e59b2431271f900714b5f4edf384957f59e 100644 (file)
@@ -28,4 +28,4 @@ int32_t tor_weak_random_range(tor_weak_rng_t *rng, int32_t top);
  * <b>n</b> */
 #define tor_weak_random_one_in_n(rng, n) (0==tor_weak_random_range((rng),(n)))
 
-#endif
+#endif /* !defined(TOR_WEAKRNG_H) */
index b63ce240243f2826e75b97bf797785147f8ec02f..e0c3d7cb788cdbe2231c14435d247522b3267634 100644 (file)
@@ -48,7 +48,7 @@ typedef struct tor_mutex_t {
 #else
   /** No-threads only: Dummy variable so that tor_mutex_t takes up space. */
   int _unused;
-#endif /* defined(USE_WIN32_MUTEX) || ... */
+#endif /* defined(USE_WIN32_THREADS) || ... */
 } tor_mutex_t;
 
 tor_mutex_t *tor_mutex_new(void);
index 2f726186c5e22dfde6a30aa16e68793dabbaa304..0b9fc3406b948a66c70edda3e51c2b89bcaf3421 100644 (file)
@@ -20,4 +20,4 @@ char *esc_for_log(const char *string) ATTR_MALLOC;
 char *esc_for_log_len(const char *chars, size_t n) ATTR_MALLOC;
 const char *escaped(const char *string);
 
-#endif /* !defined(TOR_TORLOG_H) */
+#endif /* !defined(TOR_ESCAPE_H) */
index 84e3eafc272e0ea76f59aaf4c19109f4a7c24102..c68f335da6c68e81939eecd412d4bfc4331bbaf5 100644 (file)
@@ -155,7 +155,7 @@ severity_to_android_log_priority(int severity)
       // LCOV_EXCL_STOP
   }
 }
-#endif // HAVE_ANDROID_LOG_H.
+#endif /* defined(HAVE_ANDROID_LOG_H) */
 
 /** A mutex to guard changes to logfiles and logging. */
 static tor_mutex_t log_mutex;
@@ -1233,7 +1233,7 @@ add_android_log(const log_severity_list_t *severity,
   UNLOCK_LOGS();
   return 0;
 }
-#endif // HAVE_ANDROID_LOG_H.
+#endif /* defined(HAVE_ANDROID_LOG_H) */
 
 /** If <b>level</b> is a valid log severity, return the corresponding
  * numeric value.  Otherwise, return -1. */
index 4a3ea0ad550f43eb7d01d299f3287f7cc9a7b27b..3db21695841a99e5ffd9c3dfc221e8a343d5a3e0 100644 (file)
@@ -207,7 +207,7 @@ static inline bool debug_logging_enabled(void)
 {
   return PREDICT_UNLIKELY(log_global_min_severity_ == LOG_DEBUG);
 }
-#endif
+#endif /* defined(TOR_COVERAGE) */
 
 void log_fn_(int severity, log_domain_mask_t domain,
              const char *funcname, const char *format, ...)
index 48edd7c849ebc5f503e3e126a030f8401f60733f..1db54ba726205cf8879e43ab6a61318d1dfee8be 100644 (file)
@@ -50,4 +50,4 @@ typedef struct ratelim_t {
 
 char *rate_limit_log(ratelim_t *lim, time_t now);
 
-#endif
+#endif /* !defined(TOR_RATELIM_H) */
index fb223b35f4e6a2ac253d79c6e33ea76bff8f075b..546ae1e3ef127c32f5b866c9b4e6187a8c748faf 100644 (file)
     tor__assert_tmp_value__;                    \
   } )
 #define ASSERT_PREDICT_LIKELY_(e) ASSERT_PREDICT_UNLIKELY_(e)
-#else
+#else /* !(defined(TOR_UNIT_TESTS) && defined(__GNUC__)) */
 #define ASSERT_PREDICT_UNLIKELY_(e) PREDICT_UNLIKELY(e)
 #define ASSERT_PREDICT_LIKELY_(e) PREDICT_LIKELY(e)
-#endif
+#endif /* defined(TOR_UNIT_TESTS) && defined(__GNUC__) */
 
 /* Sometimes we don't want to use assertions during branch coverage tests; it
  * leads to tons of unreached branches which in reality are only assertions we
@@ -96,7 +96,7 @@
   (void)(a);                                                            \
   (void)(fmt);                                                          \
   STMT_END
-#else
+#else /* !(defined(TOR_UNIT_TESTS) && ... */
 /** Like assert(3), but send assertion failures to the log as well as to
  * stderr. */
 #define tor_assert(expr) tor_assertf(expr, NULL)
index 33413dfd15d920796e315ea0a63e3bc28614734c..ecfa88792d8d4a6ee8087b6feb59c2e3cc3a2755 100644 (file)
@@ -19,4 +19,4 @@
 char *format_win32_error(DWORD err);
 #endif
 
-#endif
+#endif /* !defined(TOR_WIN32ERR_H) */
index ef6b509ca4ba1d30ebc3dc78c859f50225bd14d1..8c81d30dd5b82f73f279c0e1753be13e367d2ed6 100644 (file)
@@ -48,12 +48,12 @@ void tor_free_(void *mem);
     raw_free(*tor_free__tmpvar);                               \
     *tor_free__tmpvar=NULL;                                    \
   STMT_END
-#else
+#else /* !(defined(__GNUC__)) */
 #define tor_free(p) STMT_BEGIN                                 \
   raw_free(p);                                                 \
   (p)=NULL;                                                    \
   STMT_END
-#endif
+#endif /* defined(__GNUC__) */
 
 #define tor_malloc(size)       tor_malloc_(size)
 #define tor_malloc_zero(size)  tor_malloc_zero_(size)
index e2c41ab9c363ce9292c60d04ca1924c0adc0e1ff..219bd706cc3edcfe6a37eadd1d185eb60606d0b2 100644 (file)
@@ -59,7 +59,7 @@
 #define FLAG_NOINHERIT VM_INHERIT_NONE
 #elif defined(MAP_INHERIT_NONE)
 #define FLAG_NOINHERIT MAP_INHERIT_NONE
-#endif
+#endif /* defined(INHERIT_NONE) || ... */
 
 #elif defined(HAVE_MADVISE)
 
@@ -72,7 +72,7 @@
 #define FLAG_NOINHERIT MADV_DONTFORK
 #endif
 
-#endif
+#endif /* defined(HAVE_MINHERIT) || ... */
 
 /**
  * Helper: try to prevent the <b>sz</b> bytes at <b>mem</b> from being swapped
@@ -91,7 +91,7 @@ lock_mem(void *mem, size_t sz)
   (void) sz;
 
   return 0;
-#endif
+#endif /* defined(_WIN32) || ... */
 }
 
 /**
@@ -108,7 +108,7 @@ nodump_mem(void *mem, size_t sz)
   (void) mem;
   (void) sz;
   return 0;
-#endif
+#endif /* defined(MADV_DONTDUMP) */
 }
 
 /**
@@ -130,19 +130,19 @@ noinherit_mem(void *mem, size_t sz, inherit_res_t *inherit_result_out)
     *inherit_result_out = INHERIT_RES_ZERO;
     return 0;
   }
-#endif
+#endif /* defined(FLAG_ZERO) */
 #ifdef FLAG_NOINHERIT
   int r2 = MINHERIT(mem, sz, FLAG_NOINHERIT);
   if (r2 == 0) {
     *inherit_result_out = INHERIT_RES_DROP;
   }
   return r2;
-#else
+#else /* !(defined(FLAG_NOINHERIT)) */
   (void)inherit_result_out;
   (void)mem;
   (void)sz;
   return 0;
-#endif
+#endif /* defined(FLAG_NOINHERIT) */
 }
 
 /**
@@ -199,7 +199,7 @@ tor_mmap_anonymous(size_t sz, unsigned flags,
   raw_assert(ptr != NULL);
 #else
   ptr = tor_malloc_zero(sz);
-#endif
+#endif /* defined(_WIN32) || ... */
 
   if (flags & ANONMAP_PRIVATE) {
     int lock_result = lock_mem(ptr, sz);
@@ -234,5 +234,5 @@ tor_munmap_anonymous(void *mapping, size_t sz)
 #else
   (void)sz;
   tor_free(mapping);
-#endif
+#endif /* defined(_WIN32) || ... */
 }
index 6c02cd6c161f8047ec70e6e9ec6efa08a3533e04..4c4690e12fc327bcbb893a72474072ab48cfe62f 100644 (file)
@@ -62,7 +62,7 @@ typedef enum {
 #define NOINHERIT_CAN_FAIL
 #else
 #define NOINHERIT_CAN_FAIL
-#endif
+#endif /* defined(_WIN32) || ... */
 
 void *tor_mmap_anonymous(size_t sz, unsigned flags,
                          inherit_res_t *inherit_result_out);
index cb24649e6c225901b447b12b1f1b4a8b7905dbef..a73789c945ccf7171c5dc9b17f94d39f3fc7605a 100644 (file)
@@ -21,4 +21,4 @@ int64_t tor_llround(double d) ATTR_CONST;
 int64_t clamp_double_to_int64(double number);
 int tor_isinf(double x);
 
-#endif
+#endif /* !defined(TOR_FP_H) */
index e8651e5197be02e352bae8615b055b6acb1e11f2..02b0e890f098c90b081d52c2d49645f092b24737 100644 (file)
@@ -19,4 +19,4 @@ int64_t sample_laplace_distribution(double mu, double b, double p);
 int64_t add_laplace_noise(int64_t signal, double random, double delta_f,
                           double epsilon);
 
-#endif
+#endif /* !defined(TOR_LAPLACE_H) */
index 8fccf8d015b80543f3f55fb6ff28cae93fae764f..7254dc86235b774a329e6da5a2607e19fea368e7 100644 (file)
@@ -58,7 +58,7 @@ struct dist {
 #else
 #define TYPE_CHECK_OBJ(OPS, OBJ, TYPE) \
   (0*sizeof(&(OBJ) - (const TYPE *)&(OBJ)))
-#endif
+#endif /* defined(__COVERITY__) */
 
 /**
 * Typed initializer element for struct dist using the specified struct
@@ -248,6 +248,6 @@ STATIC double icdf_genpareto(double p, double mu, double sigma, double xi);
 STATIC double isf_genpareto(double p, double mu, double sigma, double xi);
 STATIC double sample_genpareto(uint32_t s, double p0, double xi);
 
-#endif
+#endif /* defined(PROB_DISTR_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_PROB_DISTR_H) */
index 2d64e1ab0643b4abb963ef1855960b1eefd5ed05..9580640f4d88abb298fe0ee99d7b64d674b7fc87 100644 (file)
@@ -18,4 +18,4 @@
 void tor_log_mallinfo(int severity);
 MOCK_DECL(int, get_total_system_memory, (size_t *mem_out));
 
-#endif
+#endif /* !defined(TOR_MEMINFO_H) */
index c45f42be818aa9f490bc22e52a5f48f21d7a975d..4d0d0dd57c66fdc7aef464388168589410fafdb3 100644 (file)
@@ -42,4 +42,4 @@ typedef struct alert_sockets_t {
 int alert_sockets_create(alert_sockets_t *socks_out, uint32_t flags);
 void alert_sockets_close(alert_sockets_t *socks);
 
-#endif
+#endif /* !defined(TOR_ALERTSOCK_H) */
index a3a90172a11df749bfef836b5daca2f4f1d1ae38..5058dd0a269b75e33e451d8e21ca6fb9efbfa08f 100644 (file)
@@ -31,4 +31,4 @@ int buf_read_from_pipe(struct buf_t *buf, int fd, size_t at_most,
 int buf_flush_to_pipe(struct buf_t *buf, int fd, size_t sz,
                       size_t *buf_flushlen);
 
-#endif /* !defined(TOR_BUFFERS_H) */
+#endif /* !defined(TOR_BUFFERS_NET_H) */
index 69b0528bc0ffb4e8cd1b4ad2692f933a30cfa015..b3b77b05896c9a364019eb1ef742333fac016c3d 100644 (file)
@@ -16,4 +16,4 @@
 
 MOCK_DECL(int,tor_gethostname,(char *name, size_t namelen));
 
-#endif
+#endif /* !defined(TOR_GETHOSTNAME_H) */
index 36352b65ea49f2f82134ac0e5ae354c20be2297d..602573944cf52cab05d8fd3f2a56da9552c9855a 100644 (file)
@@ -24,4 +24,4 @@ int tor_inet_ntoa(const struct in_addr *in, char *buf, size_t buf_len);
 const char *tor_inet_ntop(int af, const void *src, char *dst, size_t len);
 int tor_inet_pton(int af, const char *src, void *dst);
 
-#endif
+#endif /* !defined(TOR_INADDR_H) */
index 806f2c096a38491f07aecee745dbf754583dbbf0..230f29a63ab6e124a497dcd20deebd514adc7a73 100644 (file)
@@ -104,4 +104,4 @@ struct sockaddr_in6 {
 };
 #endif /* !defined(HAVE_STRUCT_SOCKADDR_IN6) */
 
-#endif /* TOR_INADDR_ST_H */
+#endif /* !defined(TOR_INADDR_ST_H) */
index 6209bbe18ac86f03681208a11bb944b67c39059d..0eb352c6575b8853200e7214ec55b613078d6899 100644 (file)
@@ -41,4 +41,4 @@ typedef int socklen_t;
 #define TOR_INVALID_SOCKET (-1)
 #endif /* defined(_WIN32) */
 
-#endif
+#endif /* !defined(TOR_NET_TYPES_H) */
index 49c263faa236a603f76a957e45cb157ffa1db952..2dda491d142794bf3abc0c87f800588c8564d447 100644 (file)
@@ -421,7 +421,7 @@ tor_make_getaddrinfo_cache_active(void)
 {
   sandbox_getaddrinfo_is_active = 1;
 }
-#else
+#else /* !(defined(USE_SANDBOX_GETADDRINFO)) */
 void
 sandbox_disable_getaddrinfo_cache(void)
 {
@@ -430,4 +430,4 @@ void
 tor_make_getaddrinfo_cache_active(void)
 {
 }
-#endif
+#endif /* defined(USE_SANDBOX_GETADDRINFO) */
index 0fb77f16611518770742e7d2beeb9b918da2b89a..d11c902a91c98d94fd355645127c4fa6000c79f9 100644 (file)
@@ -55,4 +55,4 @@ void tor_free_getaddrinfo_cache(void);
 void sandbox_disable_getaddrinfo_cache(void);
 void tor_make_getaddrinfo_cache_active(void);
 
-#endif
+#endif /* !defined(TOR_RESOLVE_H) */
index f978deeab8d61676602ef4b7ae16a0e165d5aa78..e824a05045418d6a6164db456397861408a15da5 100644 (file)
@@ -84,9 +84,9 @@ check_network_configuration(bool server_mode)
                "so your relay makes it harder to figure out how busy it is.");
     }
   }
-#else
+#else /* !(defined(__FreeBSD__)) */
   (void) server_mode;
-#endif
+#endif /* defined(__FreeBSD__) */
 }
 
 /* When set_max_file_sockets() is called, update this with the max file
@@ -487,11 +487,11 @@ tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
   r = socketpair(family, type, protocol, fd);
   if (r < 0)
     return -errno;
-#else
+#else /* !(defined(HAVE_SOCKETPAIR) && !defined(_WIN32)) */
   r = tor_ersatz_socketpair(family, type, protocol, fd);
   if (r < 0)
     return -r;
-#endif
+#endif /* defined(HAVE_SOCKETPAIR) && !defined(_WIN32) */
 
 #if defined(FD_CLOEXEC)
   if (SOCKET_OK(fd[0])) {
index 86ae336dfba00d833c83a9a31b5d8c8c4e7701c9..193ad91e4cbc69c76772b075da655974dce6df86 100644 (file)
@@ -116,4 +116,4 @@ const char *tor_socket_strerror(int e);
 #define SIO_IDEAL_SEND_BACKLOG_QUERY 0x4004747b
 #endif
 
-#endif
+#endif /* !defined(TOR_SOCKET_H) */
index 15c706bec75cd9a81c7bb56999d04309624bdebd..3be7b26f7f2cccf7bee0cabb59a7fe2f9ac3144e 100644 (file)
 #include <windows.h>
 #define socket_errno() (WSAGetLastError())
 #define SOCKET_EPROTONOSUPPORT WSAEPROTONOSUPPORT
-#else
+#else /* !(defined(_WIN32)) */
 #define closesocket(x) close(x)
 #define socket_errno() (errno)
 #define SOCKET_EPROTONOSUPPORT EPROTONOSUPPORT
-#endif
+#endif /* defined(_WIN32) */
 
 #ifdef NEED_ERSATZ_SOCKETPAIR
 
index 6be08038810e29136e0b17c3d2100258a89c7ced..58206069736f0df2d84408d1e0ec4ee42d3f911f 100644 (file)
@@ -16,4 +16,4 @@ int tor_ersatz_socketpair(int family, int type, int protocol,
                           tor_socket_t fd[2]);
 #endif
 
-#endif
+#endif /* !defined(TOR_SOCKETPAIR_H) */
index e55242ce6625e34ab379f0ef45e5bf805d18663c..e55119e0b05beb84f6019d9d9b6bc92bff281fe0 100644 (file)
@@ -29,4 +29,4 @@ typedef enum {
   SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED = 0x08,
 } socks5_reply_status_t;
 
-#endif
+#endif /* !defined(TOR_SOCKS5_STATUS_H) */
index fcce629074f851a54a88b7435ade994dd524f599..443a30d358f29992f18b63feb5f2f9da012d3e76 100644 (file)
@@ -15,4 +15,4 @@
 
 MOCK_DECL(const char *, get_uname,(void));
 
-#endif
+#endif /* !defined(HAVE_TOR_UNAME_H) */
index 20920e0aae6b41ee3c5e73ecad22acbced23e5d9..423c498837503f782f1da4990a4246ebac115c33 100644 (file)
@@ -18,4 +18,4 @@ int finish_daemon(const char *desired_cwd);
 
 bool start_daemon_has_been_called(void);
 
-#endif
+#endif /* !defined(TOR_DAEMON_H) */
index 15d59351e01377bf5cb4d2ea56c8924e0b74bf60..19c223597067c6f5882b2500beb4ac15a739b4af 100644 (file)
@@ -38,4 +38,4 @@ void set_environment_variable_in_smartlist(struct smartlist_t *env_vars,
                                            const char *new_var,
                                            void (*free_old)(void*),
                                            int free_p);
-#endif
+#endif /* !defined(TOR_ENV_H) */
index dfeb39e046ea24c03e4d459e97cb26075e9b980f..af59041f805613fffa4e36c9f824222f0d4fc94b 100644 (file)
@@ -13,4 +13,4 @@
 
 int write_pidfile(const char *filename);
 
-#endif
+#endif /* !defined(TOR_PIDFILE_H) */
index 422942dc83b62d48381670c03cd11a9bfda504bd..631c7169f13ce99553097234e5960c6e016fa37d 100644 (file)
@@ -83,7 +83,7 @@ struct process_t {
 #else
   /** Our Win32 process handle. */
   process_win32_t *win32_process;
-#endif
+#endif /* !defined(_WIN32) */
 };
 
 /** Convert a given process status in <b>status</b> to its string
@@ -205,7 +205,7 @@ process_new(const char *command)
 #else
   /* Prepare our Win32 process handle. */
   process->win32_process = process_win32_new();
-#endif
+#endif /* !defined(_WIN32) */
 
   smartlist_add(processes, process);
 
@@ -240,7 +240,7 @@ process_free_(process_t *process)
 #else
   /* Cleanup our Win32 process handle. */
   process_win32_free(process->win32_process);
-#endif
+#endif /* !defined(_WIN32) */
 
   smartlist_remove(processes, process);
 
@@ -513,7 +513,7 @@ process_get_unix_process(const process_t *process)
   tor_assert(process->unix_process);
   return process->unix_process;
 }
-#else
+#else /* !(!defined(_WIN32)) */
 /** Get the internal handle for Windows backend. */
 process_win32_t *
 process_get_win32_process(const process_t *process)
@@ -522,7 +522,7 @@ process_get_win32_process(const process_t *process)
   tor_assert(process->win32_process);
   return process->win32_process;
 }
-#endif
+#endif /* !defined(_WIN32) */
 
 /** Write <b>size</b> bytes of <b>data</b> to the given process's standard
  * input. */
index 14069923a092e3d504365288bcdba59a7c897a4b..05c091a5bff8d45c781b3d9f70ae32c843b9d14b 100644 (file)
@@ -111,7 +111,7 @@ struct process_unix_t *process_get_unix_process(const process_t *process);
 #else
 struct process_win32_t;
 struct process_win32_t *process_get_win32_process(const process_t *process);
-#endif
+#endif /* !defined(_WIN32) */
 
 void process_write(process_t *process,
                    const uint8_t *data, size_t size);
@@ -140,6 +140,6 @@ STATIC void process_read_buffer(process_t *process,
 STATIC void process_read_lines(process_t *process,
                                buf_t *buffer,
                                process_read_callback_t callback);
-#endif /* defined(PROCESS_PRIVATE). */
+#endif /* defined(PROCESS_PRIVATE) */
 
-#endif /* defined(TOR_PROCESS_H). */
+#endif /* !defined(TOR_PROCESS_H) */
index 790ab897e9ea9c85ce20d71a3d0d580707773548..17ade87463adcd79d066b2f5ab147f6a74e74b46 100644 (file)
@@ -702,4 +702,4 @@ process_unix_close_file_descriptors(process_unix_t *unix_process)
   return success;
 }
 
-#endif /* defined(_WIN32). */
+#endif /* !defined(_WIN32) */
index a1d8f7299356b5bfb6f041f5cead984d0b1a4bfe..da40b3e5670942235ddbcc6cee87e451ae2c9149 100644 (file)
@@ -61,8 +61,8 @@ STATIC int process_unix_read_handle(process_t *,
                                     process_unix_handle_t *,
                                     buf_t *);
 STATIC bool process_unix_close_file_descriptors(process_unix_t *);
-#endif /* defined(PROCESS_UNIX_PRIVATE). */
+#endif /* defined(PROCESS_UNIX_PRIVATE) */
 
-#endif /* defined(_WIN32). */
+#endif /* !defined(_WIN32) */
 
-#endif /* defined(TOR_PROCESS_UNIX_H). */
+#endif /* !defined(TOR_PROCESS_UNIX_H) */
index ddbe76bfd9ba3c27bc142c7b3113b4cce48f55d7..624333d4a3149eaedff709a9952428576c89c81b 100644 (file)
@@ -741,7 +741,7 @@ process_win32_cleanup_handle(process_win32_handle_t *handle)
                format_win32_error(error_code));
     }
   }
-#endif
+#endif /* 0 */
 
   /* Close our handle. */
   if (handle->pipe != INVALID_HANDLE_VALUE) {
@@ -1084,4 +1084,4 @@ tor_join_win_cmdline(const char *argv[])
   return joined_argv;
 }
 
-#endif /* ! defined(_WIN32). */
+#endif /* defined(_WIN32) */
index d79dde157e8d8addfbd28161c3ed3b839400ea54..a50d86df5ba54b110cf6176f44e8f1048e0eae26 100644 (file)
@@ -90,8 +90,8 @@ STATIC bool process_win32_handle_read_completion(process_win32_handle_t *,
 
 STATIC char *format_win_cmdline_argument(const char *arg);
 STATIC char *tor_join_win_cmdline(const char *argv[]);
-#endif /* defined(PROCESS_WIN32_PRIVATE). */
+#endif /* defined(PROCESS_WIN32_PRIVATE) */
 
-#endif /* ! defined(_WIN32). */
+#endif /* defined(_WIN32) */
 
-#endif /* defined(TOR_PROCESS_WIN32_H). */
+#endif /* !defined(TOR_PROCESS_WIN32_H) */
index 7d03e1f025373b6cc55e2f532ad0a4197b0da26f..a2125d2d061dd49d7220abb67c1726eb9c22f1c4 100644 (file)
@@ -19,4 +19,4 @@ int have_capability_support(void);
 #define SWITCH_ID_WARN_IF_NO_CAPS (1<<1)
 int switch_id(const char *user, unsigned flags);
 
-#endif
+#endif /* !defined(TOR_SETUID_H) */
index 1266babca8f7fbedf8b7116b46b5e6cb9270f066..48c088865879d9a85aeee77856e1296dc88f43dc 100644 (file)
@@ -51,7 +51,7 @@ subsys_winprocess_initialize(void)
 
   return 0;
 }
-#else  /* !defined(_WIN32) */
+#else /* !(defined(_WIN32)) */
 #define WINPROCESS_SYS_ENABLED false
 #define subsys_winprocess_initialize NULL
 #endif /* defined(_WIN32) */
index 4f5df8ff38dc9160e43b5d30b61dd4fdf09a519b..d841bf3f54d3afa072b53ef7524fdd186ba5f769 100644 (file)
@@ -35,4 +35,4 @@ typedef struct pub_binding_t {
   msg_t msg_template;
 } pub_binding_t;
 
-#endif
+#endif /* !defined(TOR_PUB_BINDING_ST_H) */
index 08e3f42f7c579bda78188991cec0e185340c4cbb..5346b0751750055760e8f6ce56624c58443cdd4b 100644 (file)
@@ -86,4 +86,4 @@
 #include "lib/pubsub/pubsub_macros.h"
 #include "lib/pubsub/pubsub_publish.h"
 
-#endif
+#endif /* !defined(TOR_PUBSUB_PUBSUB_H) */
index 93aad50b28fdef836ea12141ffc3f5d14aca6e28..5a0c5f5bd36ede778b63853a762cb8eb1ff654a1 100644 (file)
@@ -89,4 +89,4 @@ void pubsub_items_clear_bindings(pubsub_items_t *items);
   FREE_AND_NULL(pubsub_items_t, pubsub_items_free_, (cfg))
 void pubsub_items_free_(pubsub_items_t *cfg);
 
-#endif
+#endif /* !defined(TOR_PUBSUB_BUILD_H) */
index cedeb02b16f36d8c999dc1ff0eab2b7075409904..545aa3f3efbfbd8dffa793f38f7c6eaeaaa92afc 100644 (file)
@@ -156,6 +156,6 @@ typedef struct pubsub_adjmap_t {
   struct smartlist_t **sub_by_msg;
 } pubsub_adjmap_t;
 
-#endif
+#endif /* defined(PUBSUB_PRIVATE) */
 
-#endif
+#endif /* !defined(TOR_PUBSUB_BUILDER_ST_H) */
index bdcb33d2f511f0fecb10e3b87f64314ceadd6ae3..0ad106044e96d984928a1b223ca09986bc004893 100644 (file)
@@ -51,4 +51,4 @@ int pubsub_connector_register_type_(struct pubsub_connector_t *,
                                     const char *file,
                                     unsigned line);
 
-#endif
+#endif /* !defined(TOR_PUBSUB_CONNECT_H) */
index d07a06be7be9fbe3dbb30ae358cae1a7e435b95d..53c6e49565987840beff6c85d54d8f60dbb6f9f3 100644 (file)
@@ -29,4 +29,4 @@
  */
 #define DISP_FLAG_STUB (1u<<1)
 
-#endif
+#endif /* !defined(TOR_PUBSUB_FLAGS_H) */
index d091e40dfa44b82d36e07da34fc607042b78931a..357e59fd547abc304d00db9becad8f101a2bcf8a 100644 (file)
                                   __FILE__,                     \
                                   __LINE__)
 
-#endif
+#endif /* !defined(TOR_DISPATCH_MSG_H) */
index 0250fd0760c46ca60386476e40808e86e9cc3365..0686a465de0b2948e27770fdb6faaeab990c0b3b 100644 (file)
@@ -12,4 +12,4 @@ struct pub_binding_t;
 
 int pubsub_pub_(const struct pub_binding_t *pub, msg_aux_data_t auxdata);
 
-#endif
+#endif /* !defined(TOR_PUBSUB_PUBLISH_H) */
index a1a195f3123d0418e6a91c8056e92cd56e0e8003..795741c447863bfc6d64dc9e551be667a401f881 100644 (file)
@@ -98,4 +98,4 @@ void smartlist_del(smartlist_t *sl, int idx);
 void smartlist_del_keeporder(smartlist_t *sl, int idx);
 void smartlist_insert(smartlist_t *sl, int idx, void *val);
 
-#endif /* !defined(TOR_CONTAINER_H) */
+#endif /* !defined(TOR_SMARTLIST_CORE_H) */
index 4f72376125018399a91cb4f32649c688cacfccc5..e2cc7245b7dc5c2131f87952883c49f104fa46e1 100644 (file)
@@ -17,4 +17,4 @@
 int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep,
                            int flags, int max);
 
-#endif
+#endif /* !defined(TOR_SMARTLIST_SPLIT_H) */
index a0e37bb6dcbb9076176a2f79743fa8b1a666e31f..4f30bf53927f81185f0b254576285fd4c282d0d0 100644 (file)
@@ -25,14 +25,14 @@ static inline int strncasecmp(const char *a, const char *b, size_t n);
 static inline int strncasecmp(const char *a, const char *b, size_t n) {
   return _strnicmp(a,b,n);
 }
-#endif
+#endif /* !defined(HAVE_STRNCASECMP) */
 #ifndef HAVE_STRCASECMP
 static inline int strcasecmp(const char *a, const char *b);
 static inline int strcasecmp(const char *a, const char *b) {
   return _stricmp(a,b);
 }
-#endif
-#endif
+#endif /* !defined(HAVE_STRCASECMP) */
+#endif /* defined(_WIN32) */
 
 #if defined __APPLE__
 /* On OSX 10.9 and later, the overlap-checking code for strlcat would
@@ -59,4 +59,4 @@ char *tor_strtok_r_impl(char *str, const char *sep, char **lasts);
 #define tor_strtok_r(str, sep, lasts) tor_strtok_r_impl(str, sep, lasts)
 #endif
 
-#endif
+#endif /* !defined(TOR_COMPAT_STRING_H) */
index 925547942e6806a233ef65d940b64275c41676bf..50d48b44c5f34b6ea8daa79d6204db81b4aa06cb 100644 (file)
@@ -22,4 +22,4 @@ double tor_parse_double(const char *s, double min, double max, int *ok,
 uint64_t tor_parse_uint64(const char *s, int base, uint64_t min,
                          uint64_t max, int *ok, char **next);
 
-#endif
+#endif /* !defined(TOR_PARSE_INT_H) */
index 2cc13d6beece62629ffa4485119c7bd9b08fd461..6e90770f81e45a8d9da4d571f1fb2c70afa3ff01 100644 (file)
@@ -27,4 +27,4 @@ int tor_asprintf(char **strp, const char *fmt, ...)
 int tor_vasprintf(char **strp, const char *fmt, va_list args)
   CHECK_PRINTF(2,0);
 
-#endif /* !defined(TOR_UTIL_STRING_H) */
+#endif /* !defined(TOR_UTIL_PRINTF_H) */
index 6673173de5e2812868266467edd62389fe9a372c..b642e242dbf4f7b5a4f2a5e579b42a24fe073795 100644 (file)
@@ -21,4 +21,4 @@ int tor_vsscanf(const char *buf, const char *pattern, va_list ap) \
 int tor_sscanf(const char *buf, const char *pattern, ...)
   CHECK_SCANF(2, 3);
 
-#endif /* !defined(TOR_UTIL_STRING_H) */
+#endif /* !defined(TOR_UTIL_SCANF_H) */
index d78bb4a60246ec51b75b4be62dee96924c37d583..21f984f32d6e0eba7e4f70fd191461b1f773af0f 100644 (file)
@@ -92,4 +92,4 @@ typedef struct subsys_fns_t {
  * less than this value. */
 #define SUBSYS_LEVEL_LIBS -10
 
-#endif
+#endif /* !defined(TOR_SUBSYS_T) */
index a9c146ea8f89a7ca4a53f8fb916076333463385f..aa597ec42302714ed204a959d5fdb29a984d16a3 100644 (file)
@@ -15,4 +15,4 @@
 
 ssize_t tor_getpass(const char *prompt, char *output, size_t buflen);
 
-#endif
+#endif /* !defined(TOR_GETPASS_H) */
index 9363a9ba661c8d295a841256335473f472eb7f6a..631ec0228cb2b9cad613d3a8fd51d77c370192ed 100644 (file)
@@ -21,7 +21,7 @@
  * tests. */
 #define STATIC
 #define EXTERN(type, name) extern type name;
-#else
+#else /* !(defined(TOR_UNIT_TESTS)) */
 #define STATIC static
 #define EXTERN(type, name)
 #endif /* defined(TOR_UNIT_TESTS) */
index 3f0a29ce7c22d043bfe95117cc3d1e0a97d5feb5..2f1ea16eb9e16ab48b264ddac073add3bf9b7ab8 100644 (file)
@@ -13,4 +13,4 @@
 
 int compute_num_cpus(void);
 
-#endif
+#endif /* !defined(TOR_NUMCPUS_H) */
index 70802770cc672b57f9d87d9303d3686087e7efd4..7136eaba676adee5935812b96a02831b6d746bc5 100644 (file)
@@ -304,7 +304,7 @@ monotime_coarse_get(monotime_coarse_t *out)
 #endif /* defined(TOR_UNIT_TESTS) */
   out->abstime_ = mach_approximate_time();
 }
-#endif
+#endif /* defined(HAVE_MACH_APPROXIMATE_TIME) */
 
 /**
  * Return the number of nanoseconds between <b>start</b> and <b>end</b>.
@@ -767,7 +767,7 @@ monotime_coarse_zero(monotime_coarse_t *out)
 {
   memset(out, 0, sizeof(*out));
 }
-#endif
+#endif /* defined(MONOTIME_COARSE_TYPE_IS_DIFFERENT) */
 
 int64_t
 monotime_diff_usec(const monotime_t *start,
@@ -833,7 +833,7 @@ monotime_coarse_absolute_msec(void)
 {
   return monotime_coarse_absolute_nsec() / ONE_MILLION;
 }
-#else
+#else /* !(defined(MONOTIME_COARSE_FN_IS_DIFFERENT)) */
 #define initialized_at_coarse initialized_at
 #endif /* defined(MONOTIME_COARSE_FN_IS_DIFFERENT) */
 
@@ -865,7 +865,7 @@ monotime_msec_to_approx_coarse_stamp_units(uint64_t msec)
     mach_time_info.numer;
   return abstime_val >> monotime_shift;
 }
-#else
+#else /* !(defined(__APPLE__)) */
 uint64_t
 monotime_coarse_stamp_units_to_approx_msec(uint64_t units)
 {
@@ -876,4 +876,4 @@ monotime_msec_to_approx_coarse_stamp_units(uint64_t msec)
 {
   return (msec * STAMP_TICKS_PER_SECOND) / 1000;
 }
-#endif
+#endif /* defined(__APPLE__) */
index 360d92e5c92e62e19a4de2c7f436eeeb7224e658..8c7661d7cb2907642628139360be9a52d6dab1db 100644 (file)
@@ -344,7 +344,7 @@ monotime_coarse_diff_msec32(const monotime_coarse_t *start,
 #else
 #define USING_32BIT_MSEC_HACK
   return monotime_coarse_diff_msec32_(start, end);
-#endif
+#endif /* SIZEOF_VOID_P == 8 */
 }
 
 #ifdef TOR_UNIT_TESTS
index 724af1528aa3b8b7efa1a05440e4655d99c48c81..657cb99553fea0465e0fca992ddcf546ed51c305 100644 (file)
@@ -20,4 +20,4 @@ int64_t tv_to_msec(const struct timeval *tv);
 
 time_t time_diff(const time_t from, const time_t to);
 
-#endif
+#endif /* !defined(TOR_TVDIFF_H) */
index 8b3160392300bc609bb964371f6a9cd01b34b3cf..47f220c4c17773352caebc848b900b3991a06f12 100644 (file)
@@ -22,4 +22,4 @@ int tor_get_prfiledesc_byte_counts(struct PRFileDesc *fd,
                                    uint64_t *n_read_out,
                                    uint64_t *n_written_out);
 
-#endif
+#endif /* !defined(TOR_NSS_COUNTBYTES_H) */
index 8efc7a1c98ace15424b25e4585c8aa13a948acfa..9e195c6af2b6c13b73430d6f236a9ddb6e338bca 100644 (file)
@@ -25,12 +25,12 @@ struct ssl_ctx_st;
 struct ssl_session_st;
 typedef struct ssl_ctx_st tor_tls_context_impl_t;
 typedef struct ssl_st tor_tls_impl_t;
-#else
+#else /* !(defined(ENABLE_OPENSSL)) */
 struct PRFileDesc;
 typedef struct PRFileDesc tor_tls_context_impl_t;
 typedef struct PRFileDesc tor_tls_impl_t;
-#endif
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
+#endif /* defined(TORTLS_PRIVATE) */
 
 struct tor_x509_cert_t;
 
@@ -144,9 +144,9 @@ void check_no_tls_errors_(const char *fname, int line);
 
 void tor_tls_log_one_error(tor_tls_t *tls, unsigned long err,
                            int severity, int domain, const char *doing);
-#else
+#else /* !(defined(ENABLE_OPENSSL)) */
 #define check_no_tls_errors() STMT_NIL
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 int tor_tls_get_my_certs(int server,
                          const struct tor_x509_cert_t **link_cert_out,
index 071c5065618363e06b519a1e23336a04de7479b4..866483a94ced7ca0d372aa29a2399b540823423a 100644 (file)
@@ -61,8 +61,8 @@ STATIC int tor_tls_session_secret_cb(struct ssl_st *ssl, void *secret,
                             void *arg);
 STATIC int find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m,
                              uint16_t cipher);
-#endif
-#endif
+#endif /* defined(TORTLS_OPENSSL_PRIVATE) */
+#endif /* defined(ENABLE_OPENSSL) */
 
 #ifdef TOR_UNIT_TESTS
 extern int tor_tls_object_ex_data_index;
@@ -73,4 +73,4 @@ extern uint64_t total_bytes_written_over_tls;
 extern uint64_t total_bytes_written_by_tls;
 #endif /* defined(TOR_UNIT_TESTS) */
 
-#endif /* defined(TORTLS_INTERNAL_H) */
+#endif /* !defined(TORTLS_INTERNAL_H) */
index b40f948a3bdc85557a9712980d21456e0348a98a..04027104e1909a826072efd9051bd22148096d06 100644 (file)
@@ -25,7 +25,7 @@
    * <winsock.h> and mess things up, in at least some openssl versions. */
   #include <winsock2.h>
   #include <ws2tcpip.h>
-#endif
+#endif /* defined(_WIN32) */
 
 #include "lib/crypt_ops/crypto_cipher.h"
 #include "lib/crypt_ops/crypto_rand.h"
@@ -318,7 +318,7 @@ tor_tls_init(void)
 #else
     SSL_library_init();
     SSL_load_error_strings();
-#endif
+#endif /* defined(OPENSSL_1_1_API) */
 
 #if (SIZEOF_VOID_P >= 8 &&                              \
      OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,0,1))
@@ -383,7 +383,7 @@ static const char SERVER_CIPHER_LIST[] =
    * conclude that it has no valid ciphers if it's running with TLS1.3.
    */
   TLS1_3_TXT_AES_128_GCM_SHA256 ":"
-#endif
+#endif /* defined(TLS1_3_TXT_AES_128_GCM_SHA256) */
   TLS1_TXT_DHE_RSA_WITH_AES_256_SHA ":"
   TLS1_TXT_DHE_RSA_WITH_AES_128_SHA;
 
@@ -657,7 +657,7 @@ tor_tls_context_new(crypto_pk_t *identity, unsigned int key_lifetime,
     if (r < 0)
       goto error;
   }
-#else
+#else /* !(defined(SSL_CTX_set1_groups_list) || ...) */
   if (! is_client) {
     int nid;
     EC_KEY *ec_key;
@@ -673,7 +673,7 @@ tor_tls_context_new(crypto_pk_t *identity, unsigned int key_lifetime,
       SSL_CTX_set_tmp_ecdh(result->ctx, ec_key);
     EC_KEY_free(ec_key);
   }
-#endif
+#endif /* defined(SSL_CTX_set1_groups_list) || ...)
   SSL_CTX_set_verify(result->ctx, SSL_VERIFY_PEER,
                      always_accept_verify_cb);
   /* let us realloc bufs that we're writing from */
@@ -1062,7 +1062,7 @@ tor_tls_new(tor_socket_t sock, int isServer)
     /* We can't actually use TLS 1.3 until this bug is fixed. */
     SSL_set_max_proto_version(result->ssl, TLS1_2_VERSION);
   }
-#endif
+#endif /* defined(SSL_CTRL_SET_MAX_PROTO_VERSION) */
 
   if (!SSL_set_cipher_list(result->ssl,
                      isServer ? SERVER_CIPHER_LIST : CLIENT_CIPHER_LIST)) {
@@ -1728,7 +1728,7 @@ tor_tls_export_key_material,(tor_tls_t *tls, uint8_t *secrets_out,
     else
       return -1;
   }
-#endif
+#endif /* defined(TLS1_3_VERSION) */
 
   return (r == 1) ? 0 : -1;
 }
index 3f7ea8ac6af422f2613f85e25c32721f1c399b11..73f6e6ecca8dfcc413b52c30175134ec7e6de0d5 100644 (file)
@@ -64,7 +64,7 @@ struct tor_tls_t {
   void (*negotiated_callback)(tor_tls_t *tls, void *arg);
   /** Argument to pass to negotiated_callback. */
   void *callback_arg;
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 #ifdef ENABLE_NSS
   /** Last values retried from tor_get_prfiledesc_byte_counts(). */
   uint64_t last_write_count;
@@ -72,4 +72,4 @@ struct tor_tls_t {
 #endif
 };
 
-#endif
+#endif /* !defined(TOR_TORTLS_ST_H) */
index 5e6660de5c3ac6ddcfc791f0b3d35486cf9f6c32..0390a5464d10f0c6067cecd9ac359823a6c83945 100644 (file)
@@ -35,7 +35,7 @@ struct tor_x509_cert_t {
   common_digests_t cert_digests;
   common_digests_t pkey_digests;
 };
-#endif
+#endif /* defined(TOR_X509_PRIVATE) */
 
 void tor_tls_pick_certificate_lifetime(time_t now,
                                        unsigned cert_lifetime,
@@ -47,7 +47,7 @@ tor_x509_cert_t *tor_x509_cert_replace_expiration(
                                                const tor_x509_cert_t *inp,
                                                time_t new_expiration_time,
                                                crypto_pk_t *signing_key);
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
 
 tor_x509_cert_t *tor_x509_cert_dup(const tor_x509_cert_t *cert);
 
@@ -72,4 +72,4 @@ int tor_tls_cert_is_valid(int severity,
                           time_t now,
                           int check_rsa_1024);
 
-#endif
+#endif /* !defined(TOR_X509_H) */
index bf2bec96899a86a24e0a00ffb03b0765d57b259f..f858baae98fc36477586d577020195a35ac59afd 100644 (file)
@@ -50,4 +50,4 @@ int tor_x509_cert_set_cached_der_encoding(tor_x509_cert_t *cert);
 #define tor_x509_cert_set_cached_der_encoding(cert) (0)
 #endif
 
-#endif
+#endif /* !defined(TOR_X509_INTERNAL_H) */
index fb4af54c52c6ee41a0ff878c61fd136fd2632f94..e04afaf07b832127b4f79fea9aed2bbefb9fc759 100644 (file)
@@ -120,13 +120,13 @@ tor_tls_create_certificate_internal(crypto_pk_t *rsa,
                                      der.data, der.len,
                                      (SECKEYPrivateKey *)signing_key,//const
                                      &cert->signature);
-#else
+#else /* !(0) */
   s = SEC_DerSignData(cert->arena,
                       &signed_der,
                       der.data, der.len,
                       (SECKEYPrivateKey *)signing_key,//const
                       SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION);
-#endif
+#endif /* 0 */
 
   if (s != SECSuccess)
     goto err;
@@ -145,7 +145,7 @@ tor_tls_create_certificate_internal(crypto_pk_t *rsa,
                                &result_cert->signatureWrap, issuer_pk, NULL);
     tor_assert(cert_ok == SECSuccess);
   }
-#endif
+#endif /* 1 */
 
  err:
   if (subject_spki)
@@ -455,4 +455,4 @@ tor_x509_cert_replace_expiration(const tor_x509_cert_t *inp,
 
   return newcert ? tor_x509_cert_new(newcert) : NULL;
 }
-#endif
+#endif /* defined(TOR_UNIT_TESTS) */
index a344279c22ff5dc8b8914834a5306cd9aa9b6fbf..03f65049cf76b1d974938fd2d01db22ce3169268 100644 (file)
@@ -59,12 +59,12 @@ ENABLE_GCC_WARNING(redundant-decls)
 #define X509_get_notAfter(cert) \
     X509_getm_notAfter(cert)
 #endif
-#else /* ! OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0) */
+#else /* !(defined(OPENSSL_1_1_API)) */
 #define X509_get_notBefore_const(cert) \
   ((const ASN1_TIME*) X509_get_notBefore((X509 *)cert))
 #define X509_get_notAfter_const(cert) \
   ((const ASN1_TIME*) X509_get_notAfter((X509 *)cert))
-#endif
+#endif /* defined(OPENSSL_1_1_API) */
 
 /** Return a newly allocated X509 name with commonName <b>cname</b>. */
 static X509_NAME *
index e35616cf50031c687c8ccd00bbd0c76769c84c5b..92bb95c8830be5e884946c9d04a91ad74b26def4 100644 (file)
@@ -27,4 +27,4 @@
                         "\"" XSTR(subsystem) "\" hit. " \
                         "(line "XSTR(__LINE__) ")")
 
-#endif /* TOR_TRACE_LOG_DEBUG_H */
+#endif /* !defined(TOR_TRACE_LOG_DEBUG_H) */
index 1e1e7b9d169abc192086acb2aed25b8b63485d0a..0674f7d501bfc153055d15c9583b8f5abb16ace2 100644 (file)
 #include "lib/trace/debug.h"
 #endif
 
-#else /* TOR_EVENT_TRACING_ENABLED */
+#else /* !(defined(TOR_EVENT_TRACING_ENABLED)) */
 
 /* Reaching this point, we NOP every event declaration because event tracing
  * is not been enabled at compile time. */
 #define tor_trace(subsystem, name, args...)
 
-#endif /* TOR_EVENT_TRACING_ENABLED */
+#endif /* defined(TOR_EVENT_TRACING_ENABLED) */
 
-#endif /* TOR_TRACE_EVENTS_H */
+#endif /* !defined(TOR_TRACE_EVENTS_H) */
index 606d435568666b71beebd327ab4f5f9399940cb3..5001b28a1da0dc929d16bb5d61cfbdde66066387 100644 (file)
@@ -11,4 +11,4 @@
 
 void tor_trace_init(void);
 
-#endif // TOR_TRACE_TRACE_H
+#endif /* !defined(TOR_TRACE_TRACE_H) */
index e6b53f2c27f62005eb2b0b8b791bf2be73cbc18a..e7da160122e651826b0a31f08485c4d68be06172 100644 (file)
@@ -22,4 +22,4 @@ time_t approx_time(void);
 void update_approx_time(time_t now);
 #endif /* defined(TIME_IS_FAST) */
 
-#endif
+#endif /* !defined(TOR_APPROX_TIME_H) */
index abe78c0efe252c4b199a1ca1ea43ae7c36d575a2..da27fcaba13fb3aed4cea69960dfe5920a35de2d 100644 (file)
@@ -19,4 +19,4 @@ struct tm *tor_localtime_r_msg(const time_t *timep, struct tm *result,
 struct tm *tor_gmtime_r_msg(const time_t *timep, struct tm *result,
                             char **err_out);
 
-#endif
+#endif /* !defined(TOR_WALLCLOCK_TIME_TO_TM_H) */
index 33076adc8b55ef684ac20276411bd23532fa4419..e632d04a04cc0cd8e92946c0383b4bdad1e5bd7e 100644 (file)
@@ -39,7 +39,7 @@
     (tvout)->tv_sec += (tvout)->tv_usec / 1000000;                  \
     (tvout)->tv_usec %= 1000000;                                    \
   } while (0)
-#endif
+#endif /* defined(TOR_COVERAGE) */
 
 #ifndef timeradd
 /** Replacement for timeradd on platforms that do not have it: sets tvout to
@@ -83,4 +83,4 @@
    ((tv1)->tv_sec op (tv2)->tv_sec))
 #endif /* !defined(timercmp) */
 
-#endif
+#endif /* !defined(TOR_TIMEVAL_H) */
index c7fff9747ab67b97b1de646ceb195c0cef817ec6..6fec2fc893dd2da4986e753dc523086d8ae5864d 100644 (file)
@@ -17,4 +17,4 @@ struct timeval;
 
 MOCK_DECL(void, tor_gettimeofday, (struct timeval *timeval));
 
-#endif
+#endif /* !defined(TOR_GETTIMEOFDAY_H) */
index 65fa617cbd1d26fb6e2dd7e169729e587a2df07c..cf732df5936f85da07e9aff82b47d605f39bc582 100644 (file)
@@ -22,7 +22,7 @@
 #include <openssl/ec.h>
 #include <openssl/ecdh.h>
 #include <openssl/obj_mac.h>
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 #include "core/or/circuitlist.h"
 #include "app/config/config.h"
@@ -701,7 +701,7 @@ bench_ecdh_p224(void)
 {
   bench_ecdh_impl(NID_secp224r1, "P-224");
 }
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 static void
 bench_md_parse(void)
index 150ac4aa7d562eacf0132f2d6b094e651dcf9525..2d278825eccad19bcc113f618b875134a4a476ef 100644 (file)
@@ -9,5 +9,5 @@ int fuzz_main(const uint8_t *data, size_t sz);
 
 void disable_signature_checking(void);
 
-#endif /* FUZZING_H */
+#endif /* !defined(FUZZING_H) */
 
index 387c865a9b36f57b4553dcd4e10c25c65f68d37d..6d0f9d7d604524338b5666c8da730f88d8b46c2c 100644 (file)
@@ -137,7 +137,7 @@ LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
   return fuzz_main(Data, Size);
 }
 
-#else /* Not LLVM_FUZZ, so AFL. */
+#else /* !(defined(LLVM_FUZZ)) */
 
 int
 main(int argc, char **argv)
@@ -194,4 +194,4 @@ main(int argc, char **argv)
   return 0;
 }
 
-#endif
+#endif /* defined(LLVM_FUZZ) */
index 296238feeb53770ccb65be32e22178efe488b40a..a55ab437fa7679f63cfe413b523a253c56daed07 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (c) 2007-2019, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
-#include "ptr_helpers.h"
+#include "test/ptr_helpers.h"
 
 /**
  * Cast <b> (inptr_t value) to a void pointer.
index 67776b10060fea16d09d60b0c6bcd20c50dfd0e3..7349bddd5128d9ad29cbc6d3579b3e78fba64088 100644 (file)
@@ -20,4 +20,4 @@ cast_uintptr_to_voidstar(uintptr_t x);
 uintptr_t
 cast_voidstar_to_uintptr(void *x);
 
-#endif
+#endif /* !defined(TOR_PTR_HELPERS_H) */
index 43754ed1c278e3b61bbbe822c40527a330abf49a..3f952e484ff3af8e084ad5c53ea9d1f39bdce1e2 100644 (file)
@@ -49,7 +49,7 @@ const char *s = NULL;
  * us do bad things, such as access freed buffers, without crashing. */
 extern const char *malloc_options;
 const char *malloc_options = "sufjj";
-#endif
+#endif /* defined(OpenBSD) */
 
 static unsigned
 fill_a_buffer_memset(void)
index a2d192203e4db3e41fa9004757de17dfd0089ac0..236f4a192d445cc37637d0e9afe0094f9aff6f4b 100644 (file)
@@ -6,7 +6,7 @@
 #define CRYPT_PATH_PRIVATE
 
 #include "core/or/or.h"
-#include "test.h"
+#include "test/test.h"
 #include "lib/testsupport/testsupport.h"
 #include "core/or/connection_or.h"
 #include "core/or/channel.h"
@@ -2329,7 +2329,7 @@ test_circuitpadding_circuitsetup_machine(void *arg)
 
   return;
 }
-#endif
+#endif /* 0 */
 
 /** Helper function: Initializes a padding machine where every state uses the
  *  uniform probability distribution.  */
index 6cfb7b764b16a4763620253fae499f6aed21736f..12b78f806a7928280ad087eef260bd97b6eec2b3 100644 (file)
@@ -5066,7 +5066,7 @@ test_config_include_no_permission(void *data)
     chmod(dir, 0700);
   tor_free(dir);
 }
-#endif
+#endif /* !defined(_WIN32) */
 
 static void
 test_config_include_recursion_before_after(void *data)
@@ -5698,7 +5698,7 @@ test_config_compute_max_mem_in_queues(void *data)
 #else
   /* We are on a 32-bit system. */
   tt_u64_op(compute_real_max_mem_in_queues(0, 0), OP_EQ, GIGABYTE(1));
-#endif
+#endif /* SIZEOF_VOID_P >= 8 */
 
   /* We are able to detect the amount of RAM on the system. */
   total_system_memory_return = 0;
@@ -5739,7 +5739,7 @@ test_config_compute_max_mem_in_queues(void *data)
   /* We will at maximum get MAX_DEFAULT_MEMORY_QUEUE_SIZE here. */
   tt_u64_op(compute_real_max_mem_in_queues(0, 0), OP_EQ,
             MAX_DEFAULT_MEMORY_QUEUE_SIZE);
-#endif
+#endif /* SIZEOF_SIZE_T > 4 */
 
  done:
   UNMOCK(get_total_system_memory);
index 027e405d89ea41e92df901fe93f92fba2174e467..40121e6d38d53b834a0afcd95ef26be5f2138e8a 100644 (file)
@@ -14,4 +14,4 @@
 void test_conn_lookup_addr_helper(const char *address,
                                   int family, tor_addr_t *addr);
 
-#endif
+#endif /* !defined(TOR_TEST_CONNECTION_H) */
index 872da3d2c5239276d86af51160e6a35549562853..178a9a5097083154750188c5186548c65f920068 100644 (file)
@@ -32,7 +32,7 @@
 DISABLE_GCC_WARNING(redundant-decls)
 #include <openssl/dh.h>
 ENABLE_GCC_WARNING(redundant-decls)
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 /** Run unit tests for Diffie-Hellman functionality. */
 static void
@@ -190,7 +190,7 @@ test_crypto_dh(void *arg)
     DH_get0_key(dh4, &pk, &sk);
 #else
     pk = dh4->pub_key;
-#endif
+#endif /* defined(OPENSSL_1_1_API) */
     tt_assert(pk);
     tt_int_op(BN_num_bytes(pk), OP_LE, DH1024_KEY_LEN);
     tt_int_op(BN_num_bytes(pk), OP_GT, 0);
@@ -207,7 +207,7 @@ test_crypto_dh(void *arg)
     tt_int_op(s1len, OP_GT, 0);
     tt_mem_op(s1, OP_EQ, s2, s1len);
   }
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
  done:
   crypto_dh_free(dh1);
@@ -219,7 +219,7 @@ test_crypto_dh(void *arg)
     DH_free(dh4);
   if (pubkey_tmp)
     BN_free(pubkey_tmp);
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 }
 
 static void
@@ -248,7 +248,7 @@ test_crypto_openssl_version(void *arg)
   tt_int_op(a, OP_GE, 0);
   tt_int_op(b, OP_GE, 0);
   tt_int_op(c, OP_GE, 0);
-#endif
+#endif /* defined(ENABLE_NSS) */
 
  done:
   ;
index ab99ed36f42a9a06d2d083562fd7d7e1c8209f03..619dc83eb99c7edd63b266a9be9b750cb711df1b 100644 (file)
@@ -52,4 +52,4 @@ int dir_common_construct_vote_3(networkstatus_t **vote,
                         networkstatus_t **vote_out, int *n_vrs, time_t now,
                         int clear_rl);
 
-#endif
+#endif /* !defined(TOR_TEST_DIR_COMMON_H) */
index 231e6965f710fc0abee3c235c7d8f71813f1a7d4..51ff8729d08edfc838e88c885a4238f9330ece4a 100644 (file)
@@ -67,7 +67,7 @@ NS(test_main)(void *arg)
 
   tt_assert(tor_addr_family(nameserver_addr) == AF_INET);
   tt_assert(tor_addr_eq_ipv4h(nameserver_addr, 0x7f000001));
-#endif
+#endif /* !defined(_WIN32) */
 
   UNMOCK(get_options);
 
@@ -77,7 +77,7 @@ NS(test_main)(void *arg)
 }
 
 #undef NS_SUBMODULE
-#endif
+#endif /* defined(HAVE_EVDNS_BASE_GET_NAMESERVER_ADDR) */
 
 #define NS_SUBMODULE clip_ttl
 
index 4756c5014e6e90ff2d63e9db5f578f277b49d90f..bda9908e6c3eeec54becc8b6e8eb442f4408c9b7 100644 (file)
@@ -411,7 +411,7 @@ test_dos_bucket_refill(void *arg)
   }
   tt_uint_op(current_circ_count, OP_EQ, 0);
   tt_uint_op(dos_stats->cc_stats.circuit_bucket, OP_EQ, current_circ_count);
-#endif
+#endif /* SIZEOF_TIME_T == 8 */
 
  done:
   tor_free(chan);
index 4e4c86aa0ae3020c2c22f028ac6c66fbf62d499b..5e78e1ce4df6b4ad569f89ba783351c94e8d8b69 100644 (file)
@@ -948,7 +948,7 @@ test_link_handshake_send_authchallenge(void *arg)
 #else
   tt_int_op(36, OP_EQ, cell1->payload_len);
   tt_int_op(36, OP_EQ, cell2->payload_len);
-#endif
+#endif /* defined(HAVE_WORKING_TOR_TLS_GET_TLSSECRETS) */
   tt_int_op(0, OP_EQ, cell1->circ_id);
   tt_int_op(0, OP_EQ, cell2->circ_id);
   tt_int_op(CELL_AUTH_CHALLENGE, OP_EQ, cell1->command);
@@ -960,7 +960,7 @@ test_link_handshake_send_authchallenge(void *arg)
 #else
   tt_mem_op("\x00\x01\x00\x03", OP_EQ, cell1->payload + 32, 4);
   tt_mem_op("\x00\x01\x00\x03", OP_EQ, cell2->payload + 32, 4);
-#endif
+#endif /* defined(HAVE_WORKING_TOR_TLS_GET_TLSSECRETS) */
   tt_mem_op(cell1->payload, OP_NE, cell2->payload, 32);
 
  done:
index 961a8be698c298d71228ce99165f823ae328e29b..267156a908ff39760c2f7fc4f420e33aee5cd0ac 100644 (file)
@@ -108,7 +108,7 @@ test_pe_launch(void *arg)
     periodic_event_item_t *item = &periodic_events[i];
     tt_int_op(periodic_event_is_enabled(item), OP_EQ, 0);
   }
-#endif
+#endif /* 0 */
 
   initialize_periodic_events();
   periodic_events_connect_all();
index 7cc01d24427e2e506137869f557d3ccfafce1840..7836312761fbf123c385b4039e485c9ab061a60a 100644 (file)
@@ -594,7 +594,7 @@ test_unix(void *arg)
 
  done:
   process_free(process);
-#endif
+#endif /* !defined(_WIN32) */
 }
 
 static void
@@ -649,7 +649,7 @@ test_win32(void *arg)
  done:
   tor_free(joined_argv);
   process_free(process);
-#endif
+#endif /* defined(_WIN32) */
 }
 
 struct testcase_t process_tests[] = {
index 1322d7b833ca1e05b68a8bbb77aae5ea9fcb4945..91252c725d853f001ccb6784a70e834a8bea9801 100644 (file)
@@ -135,7 +135,7 @@ get_win32_test_binary_path(void)
  done:
   return NULL;
 }
-#endif
+#endif /* defined(_WIN32) */
 
 static void
 main_loop_timeout_cb(periodic_timer_t *timer, void *data)
index 63c508bd13a73576be31d6ef93dc4881db650d8d..1759aef97dd1b64c849153a031f4d641daa0ddda 100644 (file)
@@ -22,7 +22,7 @@ test_protover_parse(void *arg)
   tt_skip();
  done:
   ;
-#else
+#else /* !(defined(HAVE_RUST)) */
   char *re_encoded = NULL;
 
   const char *orig = "Foo=1,3 Bar=3 Baz= Quux=9-12,14,15-16,900";
@@ -89,7 +89,7 @@ test_protover_parse(void *arg)
     SMARTLIST_FOREACH(elts, proto_entry_t *, ent, proto_entry_free(ent));
   smartlist_free(elts);
   tor_free(re_encoded);
-#endif
+#endif /* defined(HAVE_RUST) */
 }
 
 static void
@@ -133,7 +133,7 @@ test_protover_parse_fail(void *arg)
                            "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
   tt_ptr_op(elts, OP_EQ, NULL);
 
-#endif
+#endif /* defined(HAVE_RUST) */
  done:
   ;
 }
@@ -335,7 +335,7 @@ test_protover_all_supported(void *arg)
                  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                  "aaaaaaaaaaaa=1-65536", &msg));
   tor_end_capture_bugs_();
-#endif
+#endif /* !defined(HAVE_RUST) */
 
  done:
   tor_end_capture_bugs_();
@@ -459,7 +459,7 @@ test_protover_supported_protocols(void *arg)
   tt_assert(protocol_list_supports_protocol(supported_protocols,
                                             PRT_LINKAUTH,
                                             PROTOVER_LINKAUTH_V1));
-#endif
+#endif /* defined(HAVE_WORKING_TOR_TLS_GET_TLSSECRETS) */
   /* Latest LinkAuth is not exposed in the headers. */
   tt_assert(protocol_list_supports_protocol(supported_protocols,
                                             PRT_LINKAUTH,
index c749de112a85479ef541867ad3931ba4d6c7d155..dcf08fff1da0ce6e96d70fc16ff03333e4b729ea 100644 (file)
@@ -46,7 +46,7 @@ main(int argc, char **argv)
       return 1;
     }
   }
-#endif
+#endif /* 0 */
 
   crypto_fast_rng_t *rng = crypto_fast_rng_new();
   while (1) {
index 9fb88b9bee7cdad00c422d2b7f239287fbd033d7..9c8703fa6fec1660cc3128fd3fa07dfd38234b71 100644 (file)
@@ -1367,7 +1367,7 @@ test_utils_auth(void *arg)
     sr_state_set_current_srv(sr_state_get_current_srv());
     sr_state_set_previous_srv(sr_state_get_previous_srv());
   }
-#endif
+#endif /* 0 */
 
  done:
   sr_state_free_all();
index 11e35be2fa4951008bd008a8e6b3a7e0f8573be1..5f87434f6a4afc380d57372aa4af81c7652f4a72 100644 (file)
@@ -219,7 +219,7 @@ test_tortls_tor_tls_get_error(void *data)
   crypto_pk_free(key2);
   tor_tls_free(tls);
 }
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 static void
 test_tortls_x509_cert_get_id_digests(void *ignored)
@@ -336,7 +336,7 @@ test_tortls_server_got_renegotiate(void *ignored)
  done:
   tor_free(tls);
 }
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 static void
 test_tortls_evaluate_ecgroup_for_tls(void *ignored)
@@ -526,7 +526,7 @@ struct testcase_t tortls_tests[] = {
   LOCAL_TEST_CASE(get_forced_write_size, 0),
   LOCAL_TEST_CASE(used_v1_handshake, TT_FORK),
   LOCAL_TEST_CASE(server_got_renegotiate, 0),
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
   LOCAL_TEST_CASE(evaluate_ecgroup_for_tls, 0),
   LOCAL_TEST_CASE(double_init, TT_FORK),
   LOCAL_TEST_CASE(address, TT_FORK),
index 1a8b117d0f7cfc4fc1a19010eb84ffecb3c1583b..4567b9f6a083700a0eeed54a76137bf159ede648 100644 (file)
@@ -10,4 +10,4 @@ extern const char *notCompletelyValidCertString;
 extern const char *validCertString;
 extern const char *caCertString;
 
-#endif
+#endif /* !defined(TEST_TORTLS_H) */
index 73041a871cca227568e3ddb3ee28daff8e89f632..81e2d3aa4f0d9be9cc11135c9b51d5ed88866314 100644 (file)
@@ -133,7 +133,7 @@ library_init(void)
 #else
   SSL_library_init();
   SSL_load_error_strings();
-#endif
+#endif /* defined(OPENSSL_1_1_API) */
 }
 
 static void
@@ -477,7 +477,7 @@ fake_x509_free(X509 *cert)
     tor_free(cert);
   }
 }
-#endif
+#endif /* !defined(OPENSSL_OPAQUE) */
 
 static tor_x509_cert_t *fixed_x509_cert = NULL;
 static tor_x509_cert_t *
index 79df2825be51a297beca62a238a5a4100f2beddd..2faadd4e19f278d4f183d6366b366796122076e7 100644 (file)
@@ -6116,9 +6116,9 @@ test_util_log_mallinfo(void *arg)
   } else {
     tt_u64_op(mem1, OP_LT, mem2);
   }
-#else
+#else /* !(defined(HAVE_MALLINFO)) */
   tt_skip();
-#endif
+#endif /* defined(HAVE_MALLINFO) */
  done:
   teardown_capture_of_logs();
   tor_free(log1);
@@ -6175,7 +6175,7 @@ test_util_map_anon_nofork(void *arg)
   tt_skip();
  done:
   ;
-#else
+#else /* !(defined(_WIN32)) */
   /* We have the right OS support.  We're going to try marking the buffer as
    * either zero-on-fork or as drop-on-fork, whichever is supported.  Then we
    * will fork and send a byte back to the parent process.  This will either
@@ -6236,7 +6236,7 @@ test_util_map_anon_nofork(void *arg)
      * implemented. */
     tt_skip();
   }
-#endif
+#endif /* !defined(NOINHERIT_CAN_FAIL) */
 
  done:
   tor_munmap_anonymous(ptr, sz);
@@ -6246,7 +6246,7 @@ test_util_map_anon_nofork(void *arg)
   if (pipefd[1] >= 0) {
     close(pipefd[1]);
   }
-#endif
+#endif /* defined(_WIN32) */
 }
 
 #define UTIL_LEGACY(name)                                               \
index 25113420df1da290d17936e4d6a6339547eeb0d9..ea96f41dbf5d911f185c43662f470f90512882e1 100644 (file)
@@ -31,7 +31,7 @@ DISABLE_GCC_WARNING(redundant-decls)
 #include <openssl/err.h>
 
 ENABLE_GCC_WARNING(redundant-decls)
-#endif
+#endif /* defined(ENABLE_OPENSSL) */
 
 #include <errno.h>