[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Code Style: Delete PRIVATE defines that are never used



commit d8b868e483109e32780ec8bfdcefdfbd8355c172
Author: teor <teor@xxxxxxxxxxxxxx>
Date:   Tue Nov 26 09:07:47 2019 +1000

    Code Style: Delete PRIVATE defines that are never used
    
    Some ".c" files define *_PRIVATE macros, but those macros are
    not used in any header file. Delete them.
    
    These changes were created using the "make autostyle" from
    32522, and then split into commits.
---
 src/core/mainloop/connection.c               | 1 -
 src/core/or/circuitlist.c                    | 1 -
 src/feature/dirauth/guardfraction.h          | 2 +-
 src/feature/dircache/dirserv.c               | 1 -
 src/feature/dircommon/voting_schedule.c      | 1 -
 src/feature/hs/hs_config.c                   | 2 --
 src/feature/hs_common/shared_random_client.c | 1 -
 src/feature/relay/selftest.c                 | 2 --
 src/lib/crypt_ops/crypto_rand_fast.c         | 1 -
 src/lib/crypt_ops/crypto_util.c              | 2 --
 src/lib/net/socket.c                         | 1 -
 src/test/fakecircs.c                         | 1 -
 src/test/test_bridges.c                      | 2 --
 src/test/test_dir.c                          | 1 -
 src/test/test_procmon.c                      | 1 -
 src/test/test_pt.c                           | 1 -
 src/test/test_util.c                         | 3 ---
 src/test/test_util_format.c                  | 1 -
 src/test/test_util_process.c                 | 1 -
 19 files changed, 1 insertion(+), 25 deletions(-)

diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 368041f92..3693e1d71 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -66,7 +66,6 @@
  * part of a subclass (channel_tls_t).
  */
 #define TOR_CHANNEL_INTERNAL_
-#define CONNECTION_PRIVATE
 #include "app/config/config.h"
 #include "core/mainloop/connection.h"
 #include "core/mainloop/mainloop.h"
diff --git a/src/core/or/circuitlist.c b/src/core/or/circuitlist.c
index 49a63c50a..c67b19f06 100644
--- a/src/core/or/circuitlist.c
+++ b/src/core/or/circuitlist.c
@@ -99,7 +99,6 @@
 #include "lib/compress/compress_zstd.h"
 #include "lib/buf/buffers.h"
 
-#define OCIRC_EVENT_PRIVATE
 #include "core/or/ocirc_event.h"
 
 #include "ht.h"
diff --git a/src/feature/dirauth/guardfraction.h b/src/feature/dirauth/guardfraction.h
index 9f01ded83..cae477760 100644
--- a/src/feature/dirauth/guardfraction.h
+++ b/src/feature/dirauth/guardfraction.h
@@ -16,7 +16,7 @@
 STATIC int
 dirserv_read_guardfraction_file_from_str(const char *guardfraction_file_str,
                                       smartlist_t *vote_routerstatuses);
-#endif /* defined(DIRSERV_PRIVATE) */
+#endif
 
 int dirserv_read_guardfraction_file(const char *fname,
                                  smartlist_t *vote_routerstatuses);
diff --git a/src/feature/dircache/dirserv.c b/src/feature/dircache/dirserv.c
index 85331bfea..53bb9814a 100644
--- a/src/feature/dircache/dirserv.c
+++ b/src/feature/dircache/dirserv.c
@@ -3,7 +3,6 @@
  * Copyright (c) 2007-2019, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
-#define DIRSERV_PRIVATE
 #include "core/or/or.h"
 
 #include "app/config/config.h"
diff --git a/src/feature/dircommon/voting_schedule.c b/src/feature/dircommon/voting_schedule.c
index 5576ec69f..76915f6be 100644
--- a/src/feature/dircommon/voting_schedule.c
+++ b/src/feature/dircommon/voting_schedule.c
@@ -8,7 +8,6 @@
  *        tor. The full feature is built as part of the dirauth module.
  **/
 
-#define VOTING_SCHEDULE_PRIVATE
 #include "feature/dircommon/voting_schedule.h"
 
 #include "core/or/or.h"
diff --git a/src/feature/hs/hs_config.c b/src/feature/hs/hs_config.c
index ed577daf7..3c302e70b 100644
--- a/src/feature/hs/hs_config.c
+++ b/src/feature/hs/hs_config.c
@@ -23,8 +23,6 @@
  * every option that is common to all version (config_generic_service).
  **/
 
-#define HS_CONFIG_PRIVATE
-
 #include "feature/hs/hs_common.h"
 #include "feature/hs/hs_config.h"
 #include "feature/hs/hs_client.h"
diff --git a/src/feature/hs_common/shared_random_client.c b/src/feature/hs_common/shared_random_client.c
index f5328e6e1..999472a86 100644
--- a/src/feature/hs_common/shared_random_client.c
+++ b/src/feature/hs_common/shared_random_client.c
@@ -8,7 +8,6 @@
  *        as part of the dirauth module.
  **/
 
-#define SHARED_RANDOM_CLIENT_PRIVATE
 #include "feature/hs_common/shared_random_client.h"
 
 #include "app/config/config.h"
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
index f8b54ff45..abc87437d 100644
--- a/src/feature/relay/selftest.c
+++ b/src/feature/relay/selftest.c
@@ -12,8 +12,6 @@
  * their own bandwidth, before publishing.
  */
 
-#define SELFTEST_PRIVATE
-
 #include "core/or/or.h"
 
 #include "app/config/config.h"
diff --git a/src/lib/crypt_ops/crypto_rand_fast.c b/src/lib/crypt_ops/crypto_rand_fast.c
index 8625ebd1c..166c67c87 100644
--- a/src/lib/crypt_ops/crypto_rand_fast.c
+++ b/src/lib/crypt_ops/crypto_rand_fast.c
@@ -32,7 +32,6 @@
  * request.
  */
 
-#define CRYPTO_RAND_FAST_PRIVATE
 #define CRYPTO_PRIVATE
 
 #include "lib/crypt_ops/crypto_rand.h"
diff --git a/src/lib/crypt_ops/crypto_util.c b/src/lib/crypt_ops/crypto_util.c
index 5e3f4a87a..beb45792a 100644
--- a/src/lib/crypt_ops/crypto_util.c
+++ b/src/lib/crypt_ops/crypto_util.c
@@ -10,8 +10,6 @@
  * \brief Common cryptographic utilities.
  **/
 
-#define CRYPTO_UTIL_PRIVATE
-
 #include "lib/crypt_ops/crypto_util.h"
 #include "lib/cc/compat_compiler.h"
 
diff --git a/src/lib/net/socket.c b/src/lib/net/socket.c
index e1b82251e..b25be91f4 100644
--- a/src/lib/net/socket.c
+++ b/src/lib/net/socket.c
@@ -9,7 +9,6 @@
  *    sockets.
  **/
 
-#define SOCKET_PRIVATE
 #include "lib/net/socket.h"
 #include "lib/net/socketpair.h"
 #include "lib/net/address.h"
diff --git a/src/test/fakecircs.c b/src/test/fakecircs.c
index cb8dafc6b..369a85d7b 100644
--- a/src/test/fakecircs.c
+++ b/src/test/fakecircs.c
@@ -6,7 +6,6 @@
  * \brief Fake circuits API for unit test.
  **/
 
-#define CHANNEL_PRIVATE
 #define CIRCUITBUILD_PRIVATE
 #define CIRCUITLIST_PRIVATE
 #define CRYPT_PATH_PRIVATE
diff --git a/src/test/test_bridges.c b/src/test/test_bridges.c
index 879ae6636..5dd3d0554 100644
--- a/src/test/test_bridges.c
+++ b/src/test/test_bridges.c
@@ -550,8 +550,6 @@ test_bridges_get_transport_by_bridge_addrport_no_ptlist(void *arg)
   sweep_bridge_list();
 }
 
-#define PT_PRIVATE
-
 /**
  * Calling get_transport_by_bridge_addrport() with the address and port of a
  * configured bridge which uses a pluggable transport should return 0 and set
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 02465b07f..523c0719f 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -11,7 +11,6 @@
 #define CONTROL_GETINFO_PRIVATE
 #define DIRCACHE_PRIVATE
 #define DIRCLIENT_PRIVATE
-#define DIRSERV_PRIVATE
 #define DIRVOTE_PRIVATE
 #define DLSTATUS_PRIVATE
 #define HIBERNATE_PRIVATE
diff --git a/src/test/test_procmon.c b/src/test/test_procmon.c
index e23578f4f..4ade82470 100644
--- a/src/test/test_procmon.c
+++ b/src/test/test_procmon.c
@@ -1,7 +1,6 @@
 /* Copyright (c) 2010-2019, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
-#define PROCMON_PRIVATE
 #include "orconfig.h"
 #include "core/or/or.h"
 #include "test/test.h"
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index 0e391c1ba..268848b98 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -5,7 +5,6 @@
 
 #include "orconfig.h"
 #define PT_PRIVATE
-#define UTIL_PRIVATE
 #define STATEFILE_PRIVATE
 #define CONTROL_EVENTS_PRIVATE
 #define PROCESS_PRIVATE
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 5f46e4fcf..7f7e157c1 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -4,11 +4,8 @@
 /* See LICENSE for licensing information */
 
 #include "orconfig.h"
-#define COMPAT_PRIVATE
 #define COMPAT_TIME_PRIVATE
-#define UTIL_PRIVATE
 #define UTIL_MALLOC_PRIVATE
-#define SOCKET_PRIVATE
 #define PROCESS_WIN32_PRIVATE
 #include "lib/testsupport/testsupport.h"
 #include "core/or/or.h"
diff --git a/src/test/test_util_format.c b/src/test/test_util_format.c
index 2859da66b..57c3eee5b 100644
--- a/src/test/test_util_format.c
+++ b/src/test/test_util_format.c
@@ -7,7 +7,6 @@
 #include "test/test.h"
 
 #include "lib/crypt_ops/crypto_rand.h"
-#define UTIL_FORMAT_PRIVATE
 #include "lib/encoding/binascii.h"
 
 #define NS_MODULE util_format
diff --git a/src/test/test_util_process.c b/src/test/test_util_process.c
index 4d04eb6df..9c78a8c0e 100644
--- a/src/test/test_util_process.c
+++ b/src/test/test_util_process.c
@@ -1,7 +1,6 @@
 /* Copyright (c) 2010-2019, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
-#define UTIL_PROCESS_PRIVATE
 #include "orconfig.h"
 #include "core/or/or.h"
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits