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

Commit 5ad6274

Browse files
committed
More ODBC formatting cleanup.
1 parent 08265ef commit 5ad6274

21 files changed

+145
-363
lines changed

src/interfaces/odbc/bind.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
/* Bind parameters on a statement handle */
3737

38-
RETCODE SQL_API
38+
RETCODE SQL_API
3939
SQLBindParameter(
4040
HSTMT hstmt,
4141
UWORD ipar,
@@ -156,7 +156,7 @@ SQLBindParameter(
156156
/* - - - - - - - - - */
157157

158158
/* Associate a user-supplied buffer with a database column. */
159-
RETCODE SQL_API
159+
RETCODE SQL_API
160160
SQLBindCol(
161161
HSTMT hstmt,
162162
UWORD icol,
@@ -192,7 +192,6 @@ SQLBindCol(
192192
/* If the bookmark column is being bound, then just save it */
193193
if (icol == 0)
194194
{
195-
196195
if (rgbValue == NULL)
197196
{
198197
stmt->bookmark.buffer = NULL;
@@ -268,7 +267,7 @@ SQLBindCol(
268267
/* it is best to say this function is not supported and let the application assume a */
269268
/* data type (most likely varchar). */
270269

271-
RETCODE SQL_API
270+
RETCODE SQL_API
272271
SQLDescribeParam(
273272
HSTMT hstmt,
274273
UWORD ipar,
@@ -322,7 +321,7 @@ SQLDescribeParam(
322321

323322
/* Sets multiple values (arrays) for the set of parameter markers. */
324323

325-
RETCODE SQL_API
324+
RETCODE SQL_API
326325
SQLParamOptions(
327326
HSTMT hstmt,
328327
UDWORD crow,
@@ -345,7 +344,7 @@ SQLParamOptions(
345344
/* like it does for SQLDescribeParam is that some applications don't care and try */
346345
/* to call it anyway. */
347346
/* If the statement does not have parameters, it should just return 0. */
348-
RETCODE SQL_API
347+
RETCODE SQL_API
349348
SQLNumParams(
350349
HSTMT hstmt,
351350
SWORD FAR * pcpar)
@@ -382,10 +381,8 @@ SQLNumParams(
382381
}
383382
else
384383
{
385-
386384
for (i = 0; i < strlen(stmt->statement); i++)
387385
{
388-
389386
if (stmt->statement[i] == '?' && !in_quote)
390387
(*pcpar)++;
391388
else
@@ -436,7 +433,6 @@ extend_bindings(StatementClass * stmt, int num_columns)
436433
/* entries into the new structure */
437434
if (stmt->bindings_allocated < num_columns)
438435
{
439-
440436
new_bindings = create_empty_bindings(num_columns);
441437
if (!new_bindings)
442438
{
@@ -461,7 +457,6 @@ extend_bindings(StatementClass * stmt, int num_columns)
461457

462458
stmt->bindings = new_bindings;
463459
stmt->bindings_allocated = num_columns;
464-
465460
}
466461
/* There is no reason to zero out extra bindings if there are */
467462
/* more than needed. If an app has allocated extra bindings, */

src/interfaces/odbc/columninfo.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,20 @@ CI_read_fields(ColumnInfoClass * self, ConnectionClass * conn)
7777
/* now read in the descriptions */
7878
for (lf = 0; lf < new_num_fields; lf++)
7979
{
80-
8180
SOCK_get_string(sock, new_field_name, MAX_MESSAGE_LEN);
8281
new_adtid = (Oid) SOCK_get_int(sock, 4);
8382
new_adtsize = (Int2) SOCK_get_int(sock, 2);
8483

8584
/* If 6.4 protocol, then read the atttypmod field */
8685
if (PG_VERSION_GE(conn, 6.4))
8786
{
88-
8987
mylog("READING ATTTYPMOD\n");
9088
new_atttypmod = (Int4) SOCK_get_int(sock, 4);
9189

9290
/* Subtract the header length */
9391
new_atttypmod -= 4;
9492
if (new_atttypmod < 0)
9593
new_atttypmod = -1;
96-
9794
}
9895

9996
mylog("CI_read_fields: fieldname='%s', adtid=%d, adtsize=%d, atttypmod=%d\n", new_field_name, new_adtid, new_adtsize, new_atttypmod);
@@ -146,7 +143,6 @@ void
146143
CI_set_field_info(ColumnInfoClass * self, int field_num, char *new_name,
147144
Oid new_adtid, Int2 new_adtsize, Int4 new_atttypmod)
148145
{
149-
150146
/* check bounds */
151147
if ((field_num < 0) || (field_num >= self->num_fields))
152148
return;

src/interfaces/odbc/connection.c

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
extern GLOBAL_VALUES globals;
3535

3636

37-
RETCODE SQL_API
37+
RETCODE SQL_API
3838
SQLAllocConnect(
3939
HENV henv,
4040
HDBC FAR * phdbc)
@@ -75,7 +75,7 @@ SQLAllocConnect(
7575

7676
/* - - - - - - - - - */
7777

78-
RETCODE SQL_API
78+
RETCODE SQL_API
7979
SQLConnect(
8080
HDBC hdbc,
8181
UCHAR FAR * szDSN,
@@ -132,7 +132,7 @@ SQLConnect(
132132

133133
/* - - - - - - - - - */
134134

135-
RETCODE SQL_API
135+
RETCODE SQL_API
136136
SQLBrowseConnect(
137137
HDBC hdbc,
138138
UCHAR FAR * szConnStrIn,
@@ -151,7 +151,7 @@ SQLBrowseConnect(
151151
/* - - - - - - - - - */
152152

153153
/* Drop any hstmts open on hdbc and disconnect from database */
154-
RETCODE SQL_API
154+
RETCODE SQL_API
155155
SQLDisconnect(
156156
HDBC hdbc)
157157
{
@@ -191,7 +191,7 @@ SQLDisconnect(
191191

192192
/* - - - - - - - - - */
193193

194-
RETCODE SQL_API
194+
RETCODE SQL_API
195195
SQLFreeConnect(
196196
HDBC hdbc)
197197
{
@@ -239,7 +239,6 @@ CC_Constructor()
239239

240240
if (rv != NULL)
241241
{
242-
243242
rv->henv = NULL; /* not yet associated with an environment */
244243

245244
rv->errormsg = NULL;
@@ -280,7 +279,6 @@ CC_Constructor()
280279
/* Statements under this conn will inherit these options */
281280

282281
InitializeStatementOptions(&rv->stmtOptions);
283-
284282
}
285283
return rv;
286284
}
@@ -289,7 +287,6 @@ CC_Constructor()
289287
char
290288
CC_Destructor(ConnectionClass * self)
291289
{
292-
293290
mylog("enter CC_Destructor, self=%u\n", self);
294291

295292
if (self->status == CONN_EXECUTING)
@@ -380,7 +377,6 @@ CC_abort(ConnectionClass * self)
380377
QR_Destructor(res);
381378
else
382379
return FALSE;
383-
384380
}
385381

386382
return TRUE;
@@ -499,12 +495,10 @@ CC_connect(ConnectionClass * self, char do_password)
499495
mylog("%s: entering...\n", func);
500496

501497
if (do_password)
502-
503498
sock = self->sock; /* already connected, just authenticate */
504499

505500
else
506501
{
507-
508502
qlog("Global Options: Version='%s', fetch=%d, socket=%d, unknown_sizes=%d, max_varchar_size=%d, max_longvarchar_size=%d\n",
509503
POSTGRESDRIVERVERSION,
510504
globals.fetch_max,
@@ -606,7 +600,6 @@ CC_connect(ConnectionClass * self, char do_password)
606600

607601
do
608602
{
609-
610603
if (do_password)
611604
beresp = 'R';
612605
else
@@ -690,7 +683,6 @@ CC_connect(ConnectionClass * self, char do_password)
690683
self->errornumber = CONN_INVALID_AUTHENTICATION;
691684
return 0;
692685
}
693-
694686
} while (areq != AUTH_REQ_OK);
695687

696688
CC_clear_error(self); /* clear any password error */
@@ -738,7 +730,6 @@ CC_connect(ConnectionClass * self, char do_password)
738730
mylog("%s: returning...\n", func);
739731

740732
return 1;
741-
742733
}
743734

744735
char
@@ -955,7 +946,6 @@ CC_send_query(ConnectionClass * self, char *query, QueryInfo * qi)
955946
}
956947
else
957948
{
958-
959949
char clear = 0;
960950

961951
mylog("send_query: ok - 'C' - %s\n", cmdbuffer);
@@ -1187,7 +1177,6 @@ CC_send_function(ConnectionClass * self, int fnid, void *result_buf, int *actual
11871177

11881178
for (i = 0; i < nargs; ++i)
11891179
{
1190-
11911180
mylog(" arg[%d]: len = %d, isint = %d, integer = %d, ptr = %u\n", i, args[i].len, args[i].isint, args[i].u.integer, args[i].u.ptr);
11921181

11931182
SOCK_put_int(sock, args[i].len, 4);
@@ -1343,7 +1332,6 @@ CC_send_settings(ConnectionClass * self)
13431332
status = FALSE;
13441333

13451334
mylog("%s: result %d, status %d from set geqo\n", func, result, status);
1346-
13471335
}
13481336

13491337
/* KSQO */
@@ -1354,7 +1342,6 @@ CC_send_settings(ConnectionClass * self)
13541342
status = FALSE;
13551343

13561344
mylog("%s: result %d, status %d from set ksqo\n", func, result, status);
1357-
13581345
}
13591346

13601347
/* Global settings */

0 commit comments

Comments
 (0)