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

[tor-commits] [tor/master] Rename `zlib_compression_level_t` to `compression_level_t`.



commit e8b025dfc30ef0008cb44feb56ab3c740d2bae9b
Author: Alexander Færøy <ahf@xxxxxxxxxxxxxx>
Date:   Mon Apr 17 14:22:13 2017 +0200

    Rename `zlib_compression_level_t` to `compression_level_t`.
    
    See https://bugs.torproject.org/21663
---
 src/common/torgzip.c | 6 +++---
 src/common/torgzip.h | 4 ++--
 src/or/directory.c   | 2 +-
 src/or/directory.h   | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index 223cd30..a6909ce 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -74,7 +74,7 @@ tor_zlib_get_header_version_str(void)
 
 /** Return the 'bits' value to tell zlib to use <b>method</b>.*/
 static inline int
-method_bits(compress_method_t method, zlib_compression_level_t level)
+method_bits(compress_method_t method, compression_level_t level)
 {
   /* Bits+16 means "use gzip" in zlib >= 1.2 */
   const int flag = method == GZIP_METHOD ? 16 : 0;
@@ -87,7 +87,7 @@ method_bits(compress_method_t method, zlib_compression_level_t level)
 }
 
 static inline int
-get_memlevel(zlib_compression_level_t level)
+get_memlevel(compression_level_t level)
 {
   switch (level) {
     default:
@@ -419,7 +419,7 @@ struct tor_zlib_state_t {
  * decompression. */
 tor_zlib_state_t *
 tor_zlib_new(int compress_, compress_method_t method,
-             zlib_compression_level_t compression_level)
+             compression_level_t compression_level)
 {
   tor_zlib_state_t *out;
   int bits, memlevel;
diff --git a/src/common/torgzip.h b/src/common/torgzip.h
index 42b45ab..cbcbb99 100644
--- a/src/common/torgzip.h
+++ b/src/common/torgzip.h
@@ -25,7 +25,7 @@ typedef enum {
  **/
 typedef enum {
   HIGH_COMPRESSION, MEDIUM_COMPRESSION, LOW_COMPRESSION
-} zlib_compression_level_t;
+} compression_level_t;
 
 int
 tor_gzip_compress(char **out, size_t *out_len,
@@ -54,7 +54,7 @@ typedef enum {
 /** Internal state for an incremental zlib compression/decompression. */
 typedef struct tor_zlib_state_t tor_zlib_state_t;
 tor_zlib_state_t *tor_zlib_new(int compress, compress_method_t method,
-                               zlib_compression_level_t level);
+                               compression_level_t level);
 
 tor_zlib_output_t tor_zlib_process(tor_zlib_state_t *state,
                                    char **out, size_t *out_len,
diff --git a/src/or/directory.c b/src/or/directory.c
index 1b999ee..bbe071b 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2845,7 +2845,7 @@ client_likes_consensus(networkstatus_t *v, const char *want_url)
 
 /** Return the compression level we should use for sending a compressed
  * response of size <b>n_bytes</b>. */
-STATIC zlib_compression_level_t
+STATIC compression_level_t
 choose_compression_level(ssize_t n_bytes)
 {
   if (! have_been_under_memory_pressure()) {
diff --git a/src/or/directory.h b/src/or/directory.h
index 0c5db3e..4c52c24 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -181,7 +181,7 @@ STATIC int handle_post_hs_descriptor(const char *url, const char *body);
 STATIC char* authdir_type_to_string(dirinfo_type_t auth);
 STATIC const char * dir_conn_purpose_to_string(int purpose);
 STATIC int should_use_directory_guards(const or_options_t *options);
-STATIC zlib_compression_level_t choose_compression_level(ssize_t n_bytes);
+STATIC compression_level_t choose_compression_level(ssize_t n_bytes);
 STATIC const smartlist_t *find_dl_schedule(download_status_t *dls,
                                            const or_options_t *options);
 STATIC void find_dl_min_and_max_delay(download_status_t *dls,



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