aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-10-03 15:59:13 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-10-03 15:59:13 +0000
commit6cbb2353cbd4869fcd1581742da8db809dd57d40 (patch)
tree23f76a1d523f24bc09d148acc7cec51058241d3e
parent2b0e46eef008c53b87da62d1f5bce7718748346d (diff)
downloadpostgresql-6cbb2353cbd4869fcd1581742da8db809dd57d40.tar.gz
postgresql-6cbb2353cbd4869fcd1581742da8db809dd57d40.zip
Tweak recently-added tests to suppress scary-looking warnings on 64-bit
machines about casts between pointers and integers of different sizes. While they're harmless, we shouldn't expect users to have to go through and figure that out for themselves.
-rw-r--r--src/interfaces/ecpg/test/expected/thread-alloc.c4
-rw-r--r--src/interfaces/ecpg/test/expected/thread-prep.c4
-rw-r--r--src/interfaces/ecpg/test/expected/thread-thread.c2
-rw-r--r--src/interfaces/ecpg/test/expected/thread-thread_implicit.c2
-rw-r--r--src/interfaces/ecpg/test/thread/alloc.pgc4
-rw-r--r--src/interfaces/ecpg/test/thread/prep.pgc4
-rw-r--r--src/interfaces/ecpg/test/thread/thread.pgc2
-rw-r--r--src/interfaces/ecpg/test/thread/thread_implicit.pgc2
8 files changed, 12 insertions, 12 deletions
diff --git a/src/interfaces/ecpg/test/expected/thread-alloc.c b/src/interfaces/ecpg/test/expected/thread-alloc.c
index 0f2979a2550..aaa56f5f10c 100644
--- a/src/interfaces/ecpg/test/expected/thread-alloc.c
+++ b/src/interfaces/ecpg/test/expected/thread-alloc.c
@@ -145,7 +145,7 @@ static void* fn(void* arg)
#line 42 "alloc.pgc"
- value = (int)arg;
+ value = (long)arg;
sprintf(name, "Connection: %d", value);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , name, 0);
@@ -207,7 +207,7 @@ int main (int argc, char** argv)
CloseHandle(threads[i]);
#else
for (i = 0; i < THREADS; ++i)
- pthread_create(&threads[i], NULL, fn, (void*)i);
+ pthread_create(&threads[i], NULL, fn, (void *) (long) i);
for (i = 0; i < THREADS; ++i)
pthread_join(threads[i], NULL);
#endif
diff --git a/src/interfaces/ecpg/test/expected/thread-prep.c b/src/interfaces/ecpg/test/expected/thread-prep.c
index 90d9dbc4958..1afea9a349f 100644
--- a/src/interfaces/ecpg/test/expected/thread-prep.c
+++ b/src/interfaces/ecpg/test/expected/thread-prep.c
@@ -145,7 +145,7 @@ static void* fn(void* arg)
#line 42 "prep.pgc"
- value = (int)arg;
+ value = (long)arg;
sprintf(name, "Connection: %d", value);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , name, 0);
@@ -245,7 +245,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
CloseHandle(threads[i]);
#else
for (i = 0; i < THREADS; ++i)
- pthread_create(&threads[i], NULL, fn, (void*)i);
+ pthread_create(&threads[i], NULL, fn, (void *) (long) i);
for (i = 0; i < THREADS; ++i)
pthread_join(threads[i], NULL);
#endif
diff --git a/src/interfaces/ecpg/test/expected/thread-thread.c b/src/interfaces/ecpg/test/expected/thread-thread.c
index 183764ade91..eaf64d1262c 100644
--- a/src/interfaces/ecpg/test/expected/thread-thread.c
+++ b/src/interfaces/ecpg/test/expected/thread-thread.c
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
for( n = 0; n < nthreads; n++ )
{
#ifndef WIN32
- pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1));
+ pthread_create(&threads[n], NULL, test_thread, (void *) (long) (n + 1));
#else
threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)test_thread, (void *) (n + 1), 0, NULL);
#endif
diff --git a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
index 697a104f319..cdd90394d72 100644
--- a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
+++ b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
for( n = 0; n < nthreads; n++ )
{
#ifndef WIN32
- pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1));
+ pthread_create(&threads[n], NULL, test_thread, (void *) (long) (n + 1));
#else
threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_thread, (void *) (n+1), 0, NULL);
#endif
diff --git a/src/interfaces/ecpg/test/thread/alloc.pgc b/src/interfaces/ecpg/test/thread/alloc.pgc
index 9c56c070c53..1b28d3a5b60 100644
--- a/src/interfaces/ecpg/test/thread/alloc.pgc
+++ b/src/interfaces/ecpg/test/thread/alloc.pgc
@@ -41,7 +41,7 @@ static void* fn(void* arg)
char **r = NULL;
EXEC SQL END DECLARE SECTION;
- value = (int)arg;
+ value = (long)arg;
sprintf(name, "Connection: %d", value);
EXEC SQL CONNECT TO REGRESSDB1 AS :name;
@@ -78,7 +78,7 @@ int main (int argc, char** argv)
CloseHandle(threads[i]);
#else
for (i = 0; i < THREADS; ++i)
- pthread_create(&threads[i], NULL, fn, (void*)i);
+ pthread_create(&threads[i], NULL, fn, (void *) (long) i);
for (i = 0; i < THREADS; ++i)
pthread_join(threads[i], NULL);
#endif
diff --git a/src/interfaces/ecpg/test/thread/prep.pgc b/src/interfaces/ecpg/test/thread/prep.pgc
index 0e822bb3598..83e634610fa 100644
--- a/src/interfaces/ecpg/test/thread/prep.pgc
+++ b/src/interfaces/ecpg/test/thread/prep.pgc
@@ -41,7 +41,7 @@ static void* fn(void* arg)
char query[256] = "INSERT INTO T VALUES ( ? )";
EXEC SQL END DECLARE SECTION;
- value = (int)arg;
+ value = (long)arg;
sprintf(name, "Connection: %d", value);
EXEC SQL CONNECT TO REGRESSDB1 AS :name;
@@ -84,7 +84,7 @@ int main (int argc, char** argv)
CloseHandle(threads[i]);
#else
for (i = 0; i < THREADS; ++i)
- pthread_create(&threads[i], NULL, fn, (void*)i);
+ pthread_create(&threads[i], NULL, fn, (void *) (long) i);
for (i = 0; i < THREADS; ++i)
pthread_join(threads[i], NULL);
#endif
diff --git a/src/interfaces/ecpg/test/thread/thread.pgc b/src/interfaces/ecpg/test/thread/thread.pgc
index dd3a5d33ae4..bcb79b27e30 100644
--- a/src/interfaces/ecpg/test/thread/thread.pgc
+++ b/src/interfaces/ecpg/test/thread/thread.pgc
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
for( n = 0; n < nthreads; n++ )
{
#ifndef WIN32
- pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1));
+ pthread_create(&threads[n], NULL, test_thread, (void *) (long) (n + 1));
#else
threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)test_thread, (void *) (n + 1), 0, NULL);
#endif
diff --git a/src/interfaces/ecpg/test/thread/thread_implicit.pgc b/src/interfaces/ecpg/test/thread/thread_implicit.pgc
index 299f8e61186..64e837b6c2e 100644
--- a/src/interfaces/ecpg/test/thread/thread_implicit.pgc
+++ b/src/interfaces/ecpg/test/thread/thread_implicit.pgc
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
for( n = 0; n < nthreads; n++ )
{
#ifndef WIN32
- pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1));
+ pthread_create(&threads[n], NULL, test_thread, (void *) (long) (n + 1));
#else
threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_thread, (void *) (n+1), 0, NULL);
#endif