Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fcc2fba

Browse files
author
Michael Meskes
committed
Reverted changes made by pgindent
Made show.pgc set all variables before displaying them.
1 parent f99a569 commit fcc2fba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2575
-4111
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@
1313
#include <stdlib.h>
1414
#include <sqltypes.h>
1515

16-
int
17-
main(void)
16+
int main(void)
1817
{
19-
char t1[] = "abc def ghi ";
20-
21-
/* 123456789012345 */
22-
char buf[50];
23-
int k;
18+
char t1[] = "abc def ghi ";
19+
/* 123456789012345 */
20+
char buf[50];
21+
int k;
2422

2523
printf("t1: _%s_\n", t1);
2624
rupshift(t1);

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

Lines changed: 50 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -44,36 +44,31 @@ NOTE: This file has a different expect file for regression tests on MinGW32
4444
ECPG_INFORMIX_BAD_EXPONENT ?
4545
*/
4646

47-
char *decs[] = {"2E394", "-2", ".794", "3.44", "592.49E21", "-32.84e4",
48-
"2E-394", ".1E-2", "+.0", "-592.49E-07", "+32.84e-4",
49-
".500001", "-.5000001",
50-
"1234567890123456789012345678.91", /* 30 digits should fit into decimal */
51-
"1234567890123456789012345678.921", /* 31 digits should NOT fit into
52-
* decimal */
53-
"not a number",
54-
NULL};
47+
char* decs[] = { "2E394", "-2", ".794", "3.44", "592.49E21", "-32.84e4",
48+
"2E-394", ".1E-2", "+.0", "-592.49E-07", "+32.84e-4",
49+
".500001", "-.5000001",
50+
"1234567890123456789012345678.91", /* 30 digits should fit
51+
into decimal */
52+
"1234567890123456789012345678.921", /* 31 digits should NOT
53+
fit into decimal */
54+
"not a number",
55+
NULL};
5556

5657

5758
static void
58-
check_errno(void);
59+
check_errno(void);
5960

6061
#define BUFSIZE 200
6162

6263
int
6364
main(void)
6465
{
65-
decimal *dec,
66-
*din;
67-
char buf[BUFSIZE];
68-
long l;
69-
int i,
70-
j,
71-
k,
72-
q,
73-
r,
74-
count = 0;
75-
double dbl;
76-
decimal **decarr = (decimal **) calloc(1, sizeof(decimal));
66+
decimal *dec, *din;
67+
char buf[BUFSIZE];
68+
long l;
69+
int i, j, k, q, r, count = 0;
70+
double dbl;
71+
decimal **decarr = (decimal **) calloc(1, sizeof(decimal));
7772

7873
ECPGdebug(1, stderr);
7974

@@ -90,62 +85,52 @@ main(void)
9085
decarr = realloc(decarr, sizeof(decimal *) * (count + 1));
9186
decarr[count++] = dec;
9287

93-
r = dectoasc(dec, buf, BUFSIZE - 1, -1);
94-
if (r < 0)
95-
check_errno();
88+
r = dectoasc(dec, buf, BUFSIZE-1, -1);
89+
if (r < 0) check_errno();
9690
printf("dec[%d,1]: r: %d, %s\n", i, r, buf);
9791

98-
r = dectoasc(dec, buf, BUFSIZE - 1, 0);
99-
if (r < 0)
100-
check_errno();
92+
r = dectoasc(dec, buf, BUFSIZE-1, 0);
93+
if (r < 0) check_errno();
10194
printf("dec[%d,2]: r: %d, %s\n", i, r, buf);
102-
r = dectoasc(dec, buf, BUFSIZE - 1, 1);
103-
if (r < 0)
104-
check_errno();
95+
r = dectoasc(dec, buf, BUFSIZE-1, 1);
96+
if (r < 0) check_errno();
10597
printf("dec[%d,3]: r: %d, %s\n", i, r, buf);
106-
r = dectoasc(dec, buf, BUFSIZE - 1, 2);
107-
if (r < 0)
108-
check_errno();
98+
r = dectoasc(dec, buf, BUFSIZE-1, 2);
99+
if (r < 0) check_errno();
109100
printf("dec[%d,4]: r: %d, %s\n", i, r, buf);
110101

111102
din = PGTYPESdecimal_new();
112-
r = dectoasc(din, buf, BUFSIZE - 1, 2);
113-
if (r < 0)
114-
check_errno();
103+
r = dectoasc(din, buf, BUFSIZE-1, 2);
104+
if (r < 0) check_errno();
115105
printf("dec[%d,5]: r: %d, %s\n", i, r, buf);
116106

117107
r = dectolong(dec, &l);
118-
if (r)
119-
check_errno();
120-
printf("dec[%d,6]: %ld (r: %d)\n", i, r ? 0L : l, r);
108+
if (r) check_errno();
109+
printf("dec[%d,6]: %ld (r: %d)\n", i, r?0L:l, r);
121110
if (r == 0)
122111
{
123112
r = deccvlong(l, din);
124-
if (r)
125-
check_errno();
126-
dectoasc(din, buf, BUFSIZE - 1, 2);
113+
if (r) check_errno();
114+
dectoasc(din, buf, BUFSIZE-1, 2);
127115
q = deccmp(dec, din);
128116
printf("dec[%d,7]: %s (r: %d - cmp: %d)\n", i, buf, r, q);
129117
}
130118

131119
r = dectoint(dec, &k);
132-
if (r)
133-
check_errno();
134-
printf("dec[%d,8]: %d (r: %d)\n", i, r ? 0 : k, r);
120+
if (r) check_errno();
121+
printf("dec[%d,8]: %d (r: %d)\n", i, r?0:k, r);
135122
if (r == 0)
136123
{
137124
r = deccvint(k, din);
138-
if (r)
139-
check_errno();
140-
dectoasc(din, buf, BUFSIZE - 1, 2);
125+
if (r) check_errno();
126+
dectoasc(din, buf, BUFSIZE-1, 2);
141127
q = deccmp(dec, din);
142128
printf("dec[%d,9]: %s (r: %d - cmp: %d)\n", i, buf, r, q);
143129
}
144130

145131
r = dectodbl(dec, &dbl);
146-
if (r)
147-
check_errno();
148-
printf("dec[%d,10]: %g (r: %d)\n", i, r ? 0.0 : dbl, r);
132+
if (r) check_errno();
133+
printf("dec[%d,10]: %g (r: %d)\n", i, r?0.0:dbl, r);
149134

150135
PGTYPESdecimal_free(din);
151136
printf("\n");
@@ -156,29 +141,23 @@ main(void)
156141
decarr = realloc(decarr, sizeof(decimal *) * (count + 1));
157142
decarr[count++] = dec;
158143

159-
rsetnull(CDECIMALTYPE, (char *) decarr[count - 1]);
160-
printf("dec[%d]: %sNULL\n", count - 1,
161-
risnull(CDECIMALTYPE, (char *) decarr[count - 1]) ? "" : "NOT ");
144+
rsetnull(CDECIMALTYPE, (char *) decarr[count-1]);
145+
printf("dec[%d]: %sNULL\n", count-1,
146+
risnull(CDECIMALTYPE, (char *) decarr[count-1]) ? "" : "NOT ");
162147
printf("dec[0]: %sNULL\n",
163-
risnull(CDECIMALTYPE, (char *) decarr[0]) ? "" : "NOT ");
148+
risnull(CDECIMALTYPE, (char *) decarr[0]) ? "" : "NOT ");
164149

165150
r = dectoasc(decarr[3], buf, -1, -1);
166-
check_errno();
167-
printf("dectoasc with len == -1: r: %d\n", r);
151+
check_errno(); printf("dectoasc with len == -1: r: %d\n", r);
168152
r = dectoasc(decarr[3], buf, 0, -1);
169-
check_errno();
170-
printf("dectoasc with len == 0: r: %d\n", r);
153+
check_errno(); printf("dectoasc with len == 0: r: %d\n", r);
171154

172155
for (i = 0; i < count; i++)
173156
{
174157
for (j = 0; j < count; j++)
175158
{
176-
decimal a,
177-
s,
178-
m,
179-
d;
180-
int c;
181-
159+
decimal a, s, m, d;
160+
int c;
182161
c = deccmp(decarr[i], decarr[j]);
183162
printf("dec[c,%d,%d]: %d\n", i, j, c);
184163

@@ -190,7 +169,7 @@ main(void)
190169
}
191170
else
192171
{
193-
dectoasc(&a, buf, BUFSIZE - 1, -1);
172+
dectoasc(&a, buf, BUFSIZE-1, -1);
194173
printf("dec[a,%d,%d]: %s\n", i, j, buf);
195174
}
196175

@@ -202,7 +181,7 @@ main(void)
202181
}
203182
else
204183
{
205-
dectoasc(&s, buf, BUFSIZE - 1, -1);
184+
dectoasc(&s, buf, BUFSIZE-1, -1);
206185
printf("dec[s,%d,%d]: %s\n", i, j, buf);
207186
}
208187

@@ -214,7 +193,7 @@ main(void)
214193
}
215194
else
216195
{
217-
dectoasc(&m, buf, BUFSIZE - 1, -1);
196+
dectoasc(&m, buf, BUFSIZE-1, -1);
218197
printf("dec[m,%d,%d]: %s\n", i, j, buf);
219198
}
220199

@@ -226,15 +205,15 @@ main(void)
226205
}
227206
else
228207
{
229-
dectoasc(&d, buf, BUFSIZE - 1, -1);
208+
dectoasc(&d, buf, BUFSIZE-1, -1);
230209
printf("dec[d,%d,%d]: %s\n", i, j, buf);
231210
}
232211
}
233212
}
234213

235214
for (i = 0; i < count; i++)
236215
{
237-
dectoasc(decarr[i], buf, BUFSIZE - 1, -1);
216+
dectoasc(decarr[i], buf, BUFSIZE-1, -1);
238217
printf("%d: %s\n", i, buf);
239218
}
240219

@@ -244,7 +223,7 @@ main(void)
244223
static void
245224
check_errno(void)
246225
{
247-
switch (errno)
226+
switch(errno)
248227
{
249228
case 0:
250229
printf("(no errno set) - ");

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

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@
2121

2222

2323
static void
24-
check_return(int ret);
24+
check_return(int ret);
2525

2626
static void
2727
date_test_strdate(char *input)
2828
{
29-
static int i;
30-
date d;
31-
int r,
32-
q;
33-
char dbuf[11];
29+
static int i;
30+
date d;
31+
int r, q;
32+
char dbuf[11];
3433

3534
r = rstrdate(input, &d);
3635
printf("r: %d ", r);
@@ -52,11 +51,10 @@ date_test_strdate(char *input)
5251
static void
5352
date_test_defmt(char *fmt, char *input)
5453
{
55-
static int i;
56-
char dbuf[11];
57-
date d;
58-
int q,
59-
r;
54+
static int i;
55+
char dbuf[11];
56+
date d;
57+
int q, r;
6058

6159
r = rdefmtdate(&d, fmt, input);
6260
printf("r: %d ", r);
@@ -78,9 +76,9 @@ date_test_defmt(char *fmt, char *input)
7876
static void
7977
date_test_fmt(date d, char *fmt)
8078
{
81-
static int i;
82-
char buf[200];
83-
int r;
79+
static int i;
80+
char buf[200];
81+
int r;
8482

8583
r = rfmtdate(d, fmt, buf);
8684
printf("r: %d ", r);
@@ -94,10 +92,10 @@ date_test_fmt(date d, char *fmt)
9492
int
9593
main(void)
9694
{
97-
short mdy[3] = {11, 23, 1959};
98-
char dbuf[11];
99-
date d;
100-
int r;
95+
short mdy[3] = { 11, 23, 1959 };
96+
char dbuf[11];
97+
date d;
98+
int r;
10199

102100
ECPGdebug(1, stderr);
103101

@@ -166,7 +164,7 @@ main(void)
166164
static void
167165
check_return(int ret)
168166
{
169-
switch (ret)
167+
switch(ret)
170168
{
171169
case ECPG_INFORMIX_ENOTDMY:
172170
printf("(ECPG_INFORMIX_ENOTDMY)");

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121

2222

2323
static void
24-
check_return(int ret);
24+
check_return(int ret);
2525

2626
static void
2727
fmtlong(long lng, char *fmt)
2828
{
29-
static int i;
30-
int r;
31-
char buf[30];
29+
static int i;
30+
int r;
31+
char buf[30];
3232

3333
r = rfmtlong(lng, fmt, buf);
3434
printf("r: %d ", r);
@@ -62,7 +62,7 @@ main(void)
6262
static void
6363
check_return(int ret)
6464
{
65-
switch (ret)
65+
switch(ret)
6666
{
6767
case ECPG_INFORMIX_ENOTDMY:
6868
printf("(ECPG_INFORMIX_ENOTDMY)");

0 commit comments

Comments
 (0)