Skip to content

Commit c5159bc

Browse files
committed
Mark file-global function and variables as static.
1 parent db48396 commit c5159bc

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/tools/thread/thread_test.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.36 2004/12/31 22:04:02 pgsql Exp $
9+
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.37 2005/03/11 15:25:31 momjian Exp $
1010
*
1111
* This program tests to see if your standard libc functions use
1212
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -66,43 +66,43 @@ main(int argc, char *argv[])
6666
/* This must be down here because this is the code that uses threads. */
6767
#include <pthread.h>
6868

69-
void func_call_1(void);
70-
void func_call_2(void);
69+
static void func_call_1(void);
70+
static void func_call_2(void);
7171

7272
#define TEMP_FILENAME_1 "/tmp/thread_test.1.XXXXXX"
7373
#define TEMP_FILENAME_2 "/tmp/thread_test.2.XXXXXX"
7474

75-
char *temp_filename_1;
76-
char *temp_filename_2;
75+
static char *temp_filename_1;
76+
static char *temp_filename_2;
7777

78-
pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
78+
static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
7979

80-
volatile int thread1_done = 0;
81-
volatile int thread2_done = 0;
80+
static volatile int thread1_done = 0;
81+
static volatile int thread2_done = 0;
8282

83-
volatile int errno1_set = 0;
84-
volatile int errno2_set = 0;
83+
static volatile int errno1_set = 0;
84+
static volatile int errno2_set = 0;
8585

8686
#ifndef HAVE_STRERROR_R
87-
char *strerror_p1;
88-
char *strerror_p2;
89-
bool strerror_threadsafe = false;
87+
static char *strerror_p1;
88+
static char *strerror_p2;
89+
static bool strerror_threadsafe = false;
9090
#endif
9191

9292
#ifndef HAVE_GETPWUID_R
93-
struct passwd *passwd_p1;
94-
struct passwd *passwd_p2;
95-
bool getpwuid_threadsafe = false;
93+
static struct passwd *passwd_p1;
94+
static struct passwd *passwd_p2;
95+
static bool getpwuid_threadsafe = false;
9696
#endif
9797

9898
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
99-
struct hostent *hostent_p1;
100-
struct hostent *hostent_p2;
101-
char myhostname[MAXHOSTNAMELEN];
102-
bool gethostbyname_threadsafe = false;
99+
static struct hostent *hostent_p1;
100+
static struct hostent *hostent_p2;
101+
static char myhostname[MAXHOSTNAMELEN];
102+
static bool gethostbyname_threadsafe = false;
103103
#endif
104104

105-
bool platform_is_threadsafe = true;
105+
static bool platform_is_threadsafe = true;
106106

107107
int
108108
main(int argc, char *argv[])
@@ -230,7 +230,7 @@ main(int argc, char *argv[])
230230
}
231231
}
232232

233-
void
233+
static void
234234
func_call_1(void)
235235
{
236236
#if !defined(HAVE_GETPWUID_R) || \
@@ -301,7 +301,7 @@ func_call_1(void)
301301
}
302302

303303

304-
void
304+
static void
305305
func_call_2(void)
306306
{
307307
#if !defined(HAVE_GETPWUID_R) || \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy