Commit 6cbb2353 authored by Tom Lane's avatar Tom Lane

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.
parent 2b0e46ee
...@@ -145,7 +145,7 @@ static void* fn(void* arg) ...@@ -145,7 +145,7 @@ static void* fn(void* arg)
#line 42 "alloc.pgc" #line 42 "alloc.pgc"
value = (int)arg; value = (long)arg;
sprintf(name, "Connection: %d", value); sprintf(name, "Connection: %d", value);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , name, 0); { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , name, 0);
...@@ -207,7 +207,7 @@ int main (int argc, char** argv) ...@@ -207,7 +207,7 @@ int main (int argc, char** argv)
CloseHandle(threads[i]); CloseHandle(threads[i]);
#else #else
for (i = 0; i < THREADS; ++i) 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) for (i = 0; i < THREADS; ++i)
pthread_join(threads[i], NULL); pthread_join(threads[i], NULL);
#endif #endif
......
...@@ -145,7 +145,7 @@ static void* fn(void* arg) ...@@ -145,7 +145,7 @@ static void* fn(void* arg)
#line 42 "prep.pgc" #line 42 "prep.pgc"
value = (int)arg; value = (long)arg;
sprintf(name, "Connection: %d", value); sprintf(name, "Connection: %d", value);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , name, 0); { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , name, 0);
...@@ -245,7 +245,7 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -245,7 +245,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
CloseHandle(threads[i]); CloseHandle(threads[i]);
#else #else
for (i = 0; i < THREADS; ++i) 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) for (i = 0; i < THREADS; ++i)
pthread_join(threads[i], NULL); pthread_join(threads[i], NULL);
#endif #endif
......
...@@ -96,7 +96,7 @@ int main(int argc, char *argv[]) ...@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
for( n = 0; n < nthreads; n++ ) for( n = 0; n < nthreads; n++ )
{ {
#ifndef WIN32 #ifndef WIN32
pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1)); pthread_create(&threads[n], NULL, test_thread, (void *) (long) (n + 1));
#else #else
threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)test_thread, (void *) (n + 1), 0, NULL); threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)test_thread, (void *) (n + 1), 0, NULL);
#endif #endif
......
...@@ -97,7 +97,7 @@ int main(int argc, char *argv[]) ...@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
for( n = 0; n < nthreads; n++ ) for( n = 0; n < nthreads; n++ )
{ {
#ifndef WIN32 #ifndef WIN32
pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1)); pthread_create(&threads[n], NULL, test_thread, (void *) (long) (n + 1));
#else #else
threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_thread, (void *) (n+1), 0, NULL); threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_thread, (void *) (n+1), 0, NULL);
#endif #endif
......
...@@ -41,7 +41,7 @@ static void* fn(void* arg) ...@@ -41,7 +41,7 @@ static void* fn(void* arg)
char **r = NULL; char **r = NULL;
EXEC SQL END DECLARE SECTION; EXEC SQL END DECLARE SECTION;
value = (int)arg; value = (long)arg;
sprintf(name, "Connection: %d", value); sprintf(name, "Connection: %d", value);
EXEC SQL CONNECT TO REGRESSDB1 AS :name; EXEC SQL CONNECT TO REGRESSDB1 AS :name;
...@@ -78,7 +78,7 @@ int main (int argc, char** argv) ...@@ -78,7 +78,7 @@ int main (int argc, char** argv)
CloseHandle(threads[i]); CloseHandle(threads[i]);
#else #else
for (i = 0; i < THREADS; ++i) 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) for (i = 0; i < THREADS; ++i)
pthread_join(threads[i], NULL); pthread_join(threads[i], NULL);
#endif #endif
......
...@@ -41,7 +41,7 @@ static void* fn(void* arg) ...@@ -41,7 +41,7 @@ static void* fn(void* arg)
char query[256] = "INSERT INTO T VALUES ( ? )"; char query[256] = "INSERT INTO T VALUES ( ? )";
EXEC SQL END DECLARE SECTION; EXEC SQL END DECLARE SECTION;
value = (int)arg; value = (long)arg;
sprintf(name, "Connection: %d", value); sprintf(name, "Connection: %d", value);
EXEC SQL CONNECT TO REGRESSDB1 AS :name; EXEC SQL CONNECT TO REGRESSDB1 AS :name;
...@@ -84,7 +84,7 @@ int main (int argc, char** argv) ...@@ -84,7 +84,7 @@ int main (int argc, char** argv)
CloseHandle(threads[i]); CloseHandle(threads[i]);
#else #else
for (i = 0; i < THREADS; ++i) 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) for (i = 0; i < THREADS; ++i)
pthread_join(threads[i], NULL); pthread_join(threads[i], NULL);
#endif #endif
......
...@@ -64,7 +64,7 @@ int main(int argc, char *argv[]) ...@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
for( n = 0; n < nthreads; n++ ) for( n = 0; n < nthreads; n++ )
{ {
#ifndef WIN32 #ifndef WIN32
pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1)); pthread_create(&threads[n], NULL, test_thread, (void *) (long) (n + 1));
#else #else
threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)test_thread, (void *) (n + 1), 0, NULL); threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)test_thread, (void *) (n + 1), 0, NULL);
#endif #endif
......
...@@ -65,7 +65,7 @@ int main(int argc, char *argv[]) ...@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
for( n = 0; n < nthreads; n++ ) for( n = 0; n < nthreads; n++ )
{ {
#ifndef WIN32 #ifndef WIN32
pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1)); pthread_create(&threads[n], NULL, test_thread, (void *) (long) (n + 1));
#else #else
threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_thread, (void *) (n+1), 0, NULL); threads[n] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_thread, (void *) (n+1), 0, NULL);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment