提交 4802bb57 编写于 作者: N Neil Conway

Warning cleanups for ecpg tests. Avoid doing pointer arithmetic on void *,

remove old-style function declarations, and mark a function "static".
There are some remaining warnings, but this fixes most of them, anyway.
上级 175c25a4
......@@ -6,7 +6,7 @@
#include <pgtypes_interval.h>
int
main()
main(void)
{
exec sql begin declare section;
date date1;
......
......@@ -2,7 +2,7 @@
*
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
*
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/dyntest.pgc,v 1.10 2003/11/29 19:52:09 pgsql Exp $
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/dyntest.pgc,v 1.11 2005/06/30 07:08:59 neilc Exp $
*/
#include <stdio.h>
......@@ -12,7 +12,7 @@
exec sql include sql3types;
exec sql include sqlca;
static void error()
static void error(void)
{ printf("#%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
exit(1);
}
......
......@@ -2,7 +2,7 @@
*
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
*
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/dyntest2.pgc,v 1.5 2003/11/29 19:52:09 pgsql Exp $
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/dyntest2.pgc,v 1.6 2005/06/30 07:08:59 neilc Exp $
*/
#include <stdio.h>
......@@ -11,7 +11,7 @@
exec sql include sql3types;
exec sql include sqlca;
static void error()
static void error(void)
{
printf("\n#%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
exit(1);
......
......@@ -3,7 +3,7 @@
#include <decimal.h>
int
main()
main(void)
{
char *text="error\n";
numeric *value1, *value2, *res;
......
......@@ -21,7 +21,7 @@ print_result(long sec, long usec, char *text)
}
int
main ()
main (void)
{
exec sql begin declare section;
long i;
......
......@@ -27,7 +27,7 @@ exec sql type intarray is int[AMOUNT];
typedef int intarray[AMOUNT];
int
main ()
main(void)
{
exec sql begin declare section;
exec sql ifdef NAMELEN;
......
......@@ -16,7 +16,7 @@ exec sql declare cur cursor for
select name, born, age, married, children from meskes;
int
main ()
main (void)
{
exec sql struct birthinfo { long born; short age; };
exec sql begin declare section;
......
......@@ -9,7 +9,7 @@ exec sql type str is varchar[10];
#include <string.h>
int
main ()
main (void)
{
exec sql begin declare section;
typedef struct { long born; short age; } birthinfo;
......
......@@ -7,7 +7,7 @@ exec sql whenever sqlerror sqlprint;
exec sql include sqlca;
int
main ()
main (void)
{
EXEC SQL BEGIN DECLARE SECTION;
int i = 1;
......
......@@ -14,7 +14,7 @@ struct TBempl
};
EXEC SQL END DECLARE SECTION;
int main()
int main(void)
{
EXEC SQL BEGIN DECLARE SECTION;
struct TBempl empl;
......
EXEC SQL WHENEVER SQLERROR SQLPRINT;
int
main()
main(void)
{
EXEC SQL BEGIN DECLARE SECTION;
char *stmt1 = "INSERT INTO test1 VALUES (?, ?)";
......
#include "sqltypes.h"
void openit(void);
static void openit(void);
int main()
int main(void)
{
$int i = 14;
$decimal j, m, n;
......@@ -73,7 +73,7 @@ int main()
return 0;
}
void openit(void)
static void openit(void)
{
$open c;
}
......
exec sql include sqlca;
int fa() { return 2; }
int fa(void) { return 2; }
int fb(int x) { return x; }
int fc(const char *x) { return *x; }
int fd(const char *x,int i) { return (*x)*i; }
......@@ -22,7 +22,7 @@ namespace N
};
#endif
int main()
int main(void)
{ struct sa x,*y;
exec sql begin declare section;
int a=(int)2;
......
......@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
}
for( n = 0; n < nthreads; n++ )
{
pthread_create(&threads[n], NULL, test_thread, (void *)n + 1);
pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1));
}
/* wait for thread completion */
......
......@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
}
for( n = 0; n < nthreads; n++ )
{
pthread_create(&threads[n], NULL, test_thread, (void *)n + 1);
pthread_create(&threads[n], NULL, test_thread, (void *) (n + 1));
}
/* wait for thread completion */
......
......@@ -2,7 +2,7 @@
exec sql include sqlca;
#include <stdlib.h>
int main()
int main(void)
{
exec sql begin declare section;
char **cpp=0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册