Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5159bc

Browse files
committed
Mark file-global function and variables as static.
1 parentdb48396 commitc5159bc

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-
voidfunc_call_1(void);
70-
voidfunc_call_2(void);
69+
staticvoidfunc_call_1(void);
70+
staticvoidfunc_call_2(void);
7171

7272
#defineTEMP_FILENAME_1 "/tmp/thread_test.1.XXXXXX"
7373
#defineTEMP_FILENAME_2 "/tmp/thread_test.2.XXXXXX"
7474

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

78-
pthread_mutex_tinit_mutex=PTHREAD_MUTEX_INITIALIZER;
78+
staticpthread_mutex_tinit_mutex=PTHREAD_MUTEX_INITIALIZER;
7979

80-
volatileintthread1_done=0;
81-
volatileintthread2_done=0;
80+
staticvolatileintthread1_done=0;
81+
staticvolatileintthread2_done=0;
8282

83-
volatileinterrno1_set=0;
84-
volatileinterrno2_set=0;
83+
staticvolatileinterrno1_set=0;
84+
staticvolatileinterrno2_set=0;
8585

8686
#ifndefHAVE_STRERROR_R
87-
char*strerror_p1;
88-
char*strerror_p2;
89-
boolstrerror_threadsafe= false;
87+
staticchar*strerror_p1;
88+
staticchar*strerror_p2;
89+
staticboolstrerror_threadsafe= false;
9090
#endif
9191

9292
#ifndefHAVE_GETPWUID_R
93-
structpasswd*passwd_p1;
94-
structpasswd*passwd_p2;
95-
boolgetpwuid_threadsafe= false;
93+
staticstructpasswd*passwd_p1;
94+
staticstructpasswd*passwd_p2;
95+
staticboolgetpwuid_threadsafe= false;
9696
#endif
9797

9898
#if !defined(HAVE_GETADDRINFO)&& !defined(HAVE_GETHOSTBYNAME_R)
99-
structhostent*hostent_p1;
100-
structhostent*hostent_p2;
101-
charmyhostname[MAXHOSTNAMELEN];
102-
boolgethostbyname_threadsafe= false;
99+
staticstructhostent*hostent_p1;
100+
staticstructhostent*hostent_p2;
101+
staticcharmyhostname[MAXHOSTNAMELEN];
102+
staticboolgethostbyname_threadsafe= false;
103103
#endif
104104

105-
boolplatform_is_threadsafe= true;
105+
staticboolplatform_is_threadsafe= true;
106106

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

233-
void
233+
staticvoid
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+
staticvoid
305305
func_call_2(void)
306306
{
307307
#if !defined(HAVE_GETPWUID_R)|| \

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp