From abf629b1f7711f7cf43685f6542e3ba53c1caa46 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Wed, 2 Jan 2019 17:40:59 +0000 Subject: [PATCH] Make some private symbols private. --- arc.m | 4 ++-- class_table.c | 2 +- eh_personality.c | 8 ++++---- hash_table.h | 6 +++--- protocol.c | 2 +- sarray2.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arc.m b/arc.m index a6e6849..ea79cf2 100644 --- a/arc.m +++ b/arc.m @@ -107,8 +107,8 @@ static inline struct arc_tls* getARCThreadData(void) return tls; #endif } -int count = 0; -int poolCount = 0; +static int count = 0; +static int poolCount = 0; static inline void release(id obj); /** diff --git a/class_table.c b/class_table.c index c3d85de..3a6f1aa 100644 --- a/class_table.c +++ b/class_table.c @@ -311,7 +311,7 @@ PRIVATE void objc_resolve_class_links(void) } } while (resolvedClass); } -void __objc_resolve_class_links(void) +PRIVATE void __objc_resolve_class_links(void) { static BOOL warned = NO; if (!warned) diff --git a/eh_personality.c b/eh_personality.c index 41d1675..7f2f1f1 100644 --- a/eh_personality.c +++ b/eh_personality.c @@ -533,19 +533,19 @@ struct thread_data #ifdef NO_PTHREADS static __thread struct thread_data thread_data; #else -void clean_tls(void *td) +static void clean_tls(void *td) { struct thread_data *data = td; } static pthread_key_t key; -void init_key(void) +static void init_key(void) { pthread_key_create(&key, clean_tls); } #endif -struct thread_data *get_thread_data(void) +static struct thread_data *get_thread_data(void) { #ifndef NO_PTHREADS static pthread_once_t once_control = PTHREAD_ONCE_INIT; @@ -566,7 +566,7 @@ struct thread_data *get_thread_data(void) #endif } -struct thread_data *get_thread_data_fast(void) +static struct thread_data *get_thread_data_fast(void) { #ifndef NO_PTHREADS struct thread_data *td = pthread_getspecific(key); diff --git a/hash_table.h b/hash_table.h index 072fcf6..10c4a2b 100644 --- a/hash_table.h +++ b/hash_table.h @@ -116,7 +116,7 @@ typedef struct PREFIX(_table_struct) struct PREFIX(_table_cell_struct) *table; } PREFIX(_table); -struct PREFIX(_table_cell_struct) *PREFIX(alloc_cells)(PREFIX(_table) *table, int count) +static struct PREFIX(_table_cell_struct) *PREFIX(alloc_cells)(PREFIX(_table) *table, int count) { # if defined(ENABLE_GC) && defined(MAP_TABLE_TYPES_BITMAP) return GC_CALLOC_EXPLICITLY_TYPED(count, @@ -126,7 +126,7 @@ struct PREFIX(_table_cell_struct) *PREFIX(alloc_cells)(PREFIX(_table) *table, in # endif } -PREFIX(_table) *PREFIX(_create)(uint32_t capacity) +static PREFIX(_table) *PREFIX(_create)(uint32_t capacity) { PREFIX(_table) *table = CALLOC(1, sizeof(PREFIX(_table))); # ifndef MAP_TABLE_NO_LOCK @@ -143,7 +143,7 @@ PREFIX(_table) *PREFIX(_create)(uint32_t capacity) return table; } -void PREFIX(_initialize)(PREFIX(_table) **table, uint32_t capacity) +static void PREFIX(_initialize)(PREFIX(_table) **table, uint32_t capacity) { #ifdef ENABLE_GC GC_add_roots(table, table+1); diff --git a/protocol.c b/protocol.c index 7df24f9..88e46bb 100644 --- a/protocol.c +++ b/protocol.c @@ -31,7 +31,7 @@ static int protocol_hash(const struct objc_protocol *protocol) static protocol_table *known_protocol_table; mutex_t protocol_table_lock; -void init_protocol_table(void) +PRIVATE void init_protocol_table(void) { protocol_initialize(&known_protocol_table, 128); INIT_LOCK(protocol_table_lock); diff --git a/sarray2.c b/sarray2.c index 4822b83..5f50f6d 100644 --- a/sarray2.c +++ b/sarray2.c @@ -18,7 +18,7 @@ const static SparseArray EmptyArray24 = { 24, 0, .data[0 ... 255] = (void*)&Empt #define base_shift 8 #define base_mask ((1<