Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a5a1506

Browse files
author
Michael Meskes
committed
Removed compiler warning due to unneeded unsigned declaration.
Removed regression test that triggers those libc precision bugs on some archs.
1 parent 167fa70 commit a5a1506

File tree

9 files changed

+47
-18
lines changed

9 files changed

+47
-18
lines changed

src/interfaces/ecpg/ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -2155,3 +2155,10 @@ We 8. Nov 10:53:42 CET 2006
21552155
- Applied patch by Peter Harris to free auto_mem struct in ECPGconnect.
21562156
- Set ecpg library version to 5.2.
21572157
- Set ecpg version to 4.2.1.
2158+
2159+
Th 25. Jan 17:17:01 CET 2007
2160+
2161+
- Removed compiler warning due to unneeded unsigned declaration.
2162+
- Removed regression test that triggers those libc precision bugs on some archs.
2163+
- Set ecpg library version to 5.3.
2164+
- Set ecpg version to 4.3.1.

src/interfaces/ecpg/ecpglib/extern.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.21 2007/01/12 10:00:13 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.22 2007/01/25 16:45:25 meskes Exp $ */
22

33
#ifndef _ECPG_LIB_EXTERN_H
44
#define _ECPG_LIB_EXTERN_H
@@ -40,7 +40,7 @@ void ECPGfree(void *);
4040
bool ECPGinit(const struct connection *, const char *, const int);
4141
char *ECPGstrdup(const char *, int);
4242
const char *ECPGtype_name(enum ECPGttype);
43-
unsigned int ECPGDynamicType(Oid);
43+
int ECPGDynamicType(Oid);
4444
void ECPGfree_auto_mem(void);
4545
void ECPGclear_auto_mem(void);
4646

src/interfaces/ecpg/ecpglib/typename.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/typename.c,v 1.10 2003/11/29 19:52:08 pgsql Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/typename.c,v 1.11 2007/01/25 16:45:25 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -66,7 +66,7 @@ ECPGtype_name(enum ECPGttype typ)
6666
return NULL;
6767
}
6868

69-
unsigned int
69+
int
7070
ECPGDynamicType(Oid type)
7171
{
7272
switch (type)

src/interfaces/ecpg/test/compat_informix/dec_test.pgc

+8-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,14 @@ main(void)
108108
printf("dec[%d,9]: %s (r: %d - cmp: %d)\n", i, buf, r, q);
109109
}
110110

111-
r = dectodbl(dec, &dbl);
112-
if (r) check_errno();
113-
printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r);
111+
if (i != 6)
112+
{
113+
/* underflow does not work reliable on several archs, so not testing it here */
114+
/* this is a libc problem since we only call strtod() */
115+
r = dectodbl(dec, &dbl);
116+
if (r) check_errno();
117+
printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r);
118+
}
114119

115120
PGTYPESdecimal_free(din);
116121
printf("\n");

src/interfaces/ecpg/test/expected/compat_informix-dec_test.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,14 @@ main(void)
129129
printf("dec[%d,9]: %s (r: %d - cmp: %d)\n", i, buf, r, q);
130130
}
131131

132-
r = dectodbl(dec, &dbl);
133-
if (r) check_errno();
134-
printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r);
132+
if (i != 6)
133+
{
134+
/* underflow does not work reliable on several archs, so not testing it here */
135+
/* this is a libc problem since we only call strtod() */
136+
r = dectodbl(dec, &dbl);
137+
if (r) check_errno();
138+
printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r);
139+
}
135140

136141
PGTYPESdecimal_free(din);
137142
printf("\n");

src/interfaces/ecpg/test/expected/compat_informix-dec_test.stdout

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ dec[6,6]: 0 (r: 0)
6969
dec[6,7]: 0.00 (r: 0 - cmp: 1)
7070
dec[6,8]: 0 (r: 0)
7171
dec[6,9]: 0.00 (r: 0 - cmp: 1)
72-
(errno == PGTYPES_NUM_UNDERFLOW) - dec[6,10]: 0 (r: -1)
7372

7473
dec[7,1]: r: 0, 0.001
7574
dec[7,2]: r: 0, 0

src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c

+10-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,16 @@ main(void)
120120
free(text);
121121
}
122122

123-
r = PGTYPESnumeric_to_double(num, &d);
124-
if (r) check_errno();
125-
printf("num[%d,10]: %g (r: %d)\n", i, r?0.0:d, r);
123+
if (i != 6)
124+
{
125+
/* underflow does not work reliable on several archs, so not testing it here */
126+
/* this is a libc problem since we only call strtod() */
127+
128+
r = PGTYPESnumeric_to_double(num, &d);
129+
if (r) check_errno();
130+
printf("num[%d,10]: %g (r: %d)\n", i, r?0.0:d, r);
131+
}
132+
126133
/* do not test double to numeric because
127134
* - extra digits are different on different architectures
128135
* - PGTYPESnumeric_from_double internally calls PGTYPESnumeric_from_asc anyway

src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.stdout

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ num[6,6]: 0 (r: 0)
8888
num[6,7]: 0.00 (r: 0 - cmp: 1)
8989
num[6,8]: 0 (r: 0)
9090
num[6,9]: 0.00 (r: 0 - cmp: 1)
91-
(errno == PGTYPES_NUM_UNDERFLOW) - num[6,10]: 0 (r: -1)
9291
num[6,11]: - (r: 0)
9392
num[6,12]: 0.00 (r: 0 - cmp: 0)
9493

src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc

+10-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,16 @@ main(void)
101101
free(text);
102102
}
103103

104-
r = PGTYPESnumeric_to_double(num, &d);
105-
if (r) check_errno();
106-
printf("num[%d,10]: %g (r: %d)\n", i, r?0.0:d, r);
104+
if (i != 6)
105+
{
106+
/* underflow does not work reliable on several archs, so not testing it here */
107+
/* this is a libc problem since we only call strtod() */
108+
109+
r = PGTYPESnumeric_to_double(num, &d);
110+
if (r) check_errno();
111+
printf("num[%d,10]: %g (r: %d)\n", i, r?0.0:d, r);
112+
}
113+
107114
/* do not test double to numeric because
108115
* - extra digits are different on different architectures
109116
* - PGTYPESnumeric_from_double internally calls PGTYPESnumeric_from_asc anyway

0 commit comments

Comments
 (0)