Skip to content

Commit cec9a98

Browse files
authored
Clean up ODBC header (#16754)
Remove an unused field from globals, fix indentation.
1 parent dfba04e commit cec9a98

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

ext/odbc/php_odbc.c

-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@ PHP_MINIT_FUNCTION(odbc)
545545
/* {{{ PHP_RINIT_FUNCTION */
546546
PHP_RINIT_FUNCTION(odbc)
547547
{
548-
ODBCG(defConn) = -1;
549548
ODBCG(num_links) = ODBCG(num_persistent);
550549
memset(ODBCG(laststate), '\0', 6);
551550
memset(ODBCG(lasterrormsg), '\0', SQL_MAX_MESSAGE_LENGTH);

ext/odbc/php_odbc_includes.h

+9-10
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@
187187
#endif
188188

189189
typedef struct odbc_connection {
190-
ODBC_SQL_ENV_T henv;
191-
ODBC_SQL_CONN_T hdbc;
192-
char laststate[6];
193-
char lasterrormsg[SQL_MAX_MESSAGE_LENGTH];
190+
ODBC_SQL_ENV_T henv;
191+
ODBC_SQL_CONN_T hdbc;
192+
char laststate[6];
193+
char lasterrormsg[SQL_MAX_MESSAGE_LENGTH];
194194
HashTable results;
195195
} odbc_connection;
196196

@@ -239,12 +239,11 @@ ZEND_BEGIN_MODULE_GLOBALS(odbc)
239239
zend_long max_links;
240240
zend_long num_persistent;
241241
zend_long num_links;
242-
int defConn;
243-
zend_long defaultlrl;
244-
zend_long defaultbinmode;
245-
zend_long default_cursortype;
246-
char laststate[6];
247-
char lasterrormsg[SQL_MAX_MESSAGE_LENGTH];
242+
zend_long defaultlrl;
243+
zend_long defaultbinmode;
244+
zend_long default_cursortype;
245+
char laststate[6];
246+
char lasterrormsg[SQL_MAX_MESSAGE_LENGTH];
248247
/* Stores ODBC links throughout the duration of a request. The connection member may be either persistent or
249248
* non-persistent. In the former case, it is a pointer to an item in EG(persistent_list). This solution makes it
250249
* possible to properly free links during RSHUTDOWN (or when they are explicitly closed), while persistent

0 commit comments

Comments
 (0)