Commit 89bdb2f4 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

odbc32: Use BOOL type where appropriate.

parent e2df0ab8
...@@ -194,9 +194,9 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv) ...@@ -194,9 +194,9 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv)
{ {
HKEY hODBCInst; HKEY hODBCInst;
LONG reg_ret; LONG reg_ret;
int success; BOOL success;
success = 0; success = FALSE;
TRACE ("Driver settings are not currently replicated to the registry\n"); TRACE ("Driver settings are not currently replicated to the registry\n");
if ((reg_ret = RegCreateKeyExA (HKEY_LOCAL_MACHINE, if ((reg_ret = RegCreateKeyExA (HKEY_LOCAL_MACHINE,
"Software\\ODBC\\ODBCINST.INI", 0, NULL, "Software\\ODBC\\ODBCINST.INI", 0, NULL,
...@@ -215,7 +215,7 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv) ...@@ -215,7 +215,7 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv)
CHAR desc [256]; CHAR desc [256];
SQLSMALLINT sizedesc; SQLSMALLINT sizedesc;
success = 1; success = TRUE;
dirn = SQL_FETCH_FIRST; dirn = SQL_FETCH_FIRST;
while ((sql_ret = SQLDrivers (hEnv, dirn, (SQLCHAR*)desc, sizeof(desc), while ((sql_ret = SQLDrivers (hEnv, dirn, (SQLCHAR*)desc, sizeof(desc),
&sizedesc, NULL, 0, NULL)) == SQL_SUCCESS || &sizedesc, NULL, 0, NULL)) == SQL_SUCCESS ||
...@@ -234,14 +234,14 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv) ...@@ -234,14 +234,14 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv)
{ {
TRACE ("Error %d replicating driver %s\n", TRACE ("Error %d replicating driver %s\n",
reg_ret, desc); reg_ret, desc);
success = 0; success = FALSE;
} }
} }
else if (reg_ret != ERROR_SUCCESS) else if (reg_ret != ERROR_SUCCESS)
{ {
TRACE ("Error %d checking for %s in drivers\n", TRACE ("Error %d checking for %s in drivers\n",
reg_ret, desc); reg_ret, desc);
success = 0; success = FALSE;
} }
if ((reg_ret = RegCreateKeyExA (hODBCInst, desc, 0, if ((reg_ret = RegCreateKeyExA (hODBCInst, desc, 0,
NULL, REG_OPTION_NON_VOLATILE, NULL, REG_OPTION_NON_VOLATILE,
...@@ -263,20 +263,20 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv) ...@@ -263,20 +263,20 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv)
{ {
TRACE ("Error %d ensuring driver key %s\n", TRACE ("Error %d ensuring driver key %s\n",
reg_ret, desc); reg_ret, desc);
success = 0; success = FALSE;
} }
} }
else else
{ {
WARN ("Unusually long driver name %s not replicated\n", WARN ("Unusually long driver name %s not replicated\n",
desc); desc);
success = 0; success = FALSE;
} }
} }
if (sql_ret != SQL_NO_DATA) if (sql_ret != SQL_NO_DATA)
{ {
TRACE ("Error %d enumerating drivers\n", (int)sql_ret); TRACE ("Error %d enumerating drivers\n", (int)sql_ret);
success = 0; success = FALSE;
} }
if ((reg_ret = RegCloseKey (hDrivers)) != ERROR_SUCCESS) if ((reg_ret = RegCloseKey (hDrivers)) != ERROR_SUCCESS)
{ {
...@@ -332,17 +332,17 @@ static void ODBC_ReplicateODBCToRegistry (int is_user, SQLHENV hEnv) ...@@ -332,17 +332,17 @@ static void ODBC_ReplicateODBCToRegistry (int is_user, SQLHENV hEnv)
SQLSMALLINT sizedsn; SQLSMALLINT sizedsn;
CHAR desc [256]; CHAR desc [256];
SQLSMALLINT sizedesc; SQLSMALLINT sizedesc;
int success; BOOL success;
const char *which = is_user ? "user" : "system"; const char *which = is_user ? "user" : "system";
success = 0; success = FALSE;
if ((reg_ret = RegCreateKeyExA ( if ((reg_ret = RegCreateKeyExA (
is_user ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, is_user ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
"Software\\ODBC\\ODBC.INI", 0, NULL, REG_OPTION_NON_VOLATILE, "Software\\ODBC\\ODBC.INI", 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS /* a couple more than we need */, NULL, &hODBC, KEY_ALL_ACCESS /* a couple more than we need */, NULL, &hODBC,
NULL)) == ERROR_SUCCESS) NULL)) == ERROR_SUCCESS)
{ {
success = 1; success = TRUE;
dirn = is_user ? SQL_FETCH_FIRST_USER : SQL_FETCH_FIRST_SYSTEM; dirn = is_user ? SQL_FETCH_FIRST_USER : SQL_FETCH_FIRST_SYSTEM;
while ((sql_ret = SQLDataSources (hEnv, dirn, while ((sql_ret = SQLDataSources (hEnv, dirn,
(SQLCHAR*)dsn, sizeof(dsn), &sizedsn, (SQLCHAR*)dsn, sizeof(dsn), &sizedsn,
...@@ -369,14 +369,14 @@ static void ODBC_ReplicateODBCToRegistry (int is_user, SQLHENV hEnv) ...@@ -369,14 +369,14 @@ static void ODBC_ReplicateODBCToRegistry (int is_user, SQLHENV hEnv)
{ {
TRACE ("Error %d replicating description of " TRACE ("Error %d replicating description of "
"%s(%s)\n", reg_ret, dsn, desc); "%s(%s)\n", reg_ret, dsn, desc);
success = 0; success = FALSE;
} }
} }
else if (reg_ret != ERROR_SUCCESS) else if (reg_ret != ERROR_SUCCESS)
{ {
TRACE ("Error %d checking for description of %s\n", TRACE ("Error %d checking for description of %s\n",
reg_ret, dsn); reg_ret, dsn);
success = 0; success = FALSE;
} }
if ((reg_ret = RegCloseKey (hDSN)) != ERROR_SUCCESS) if ((reg_ret = RegCloseKey (hDSN)) != ERROR_SUCCESS)
{ {
...@@ -388,21 +388,21 @@ static void ODBC_ReplicateODBCToRegistry (int is_user, SQLHENV hEnv) ...@@ -388,21 +388,21 @@ static void ODBC_ReplicateODBCToRegistry (int is_user, SQLHENV hEnv)
{ {
TRACE ("Error %d opening %s DSN key %s\n", TRACE ("Error %d opening %s DSN key %s\n",
reg_ret, which, dsn); reg_ret, which, dsn);
success = 0; success = FALSE;
} }
} }
else else
{ {
WARN ("Unusually long %s data source name %s (%s) not " WARN ("Unusually long %s data source name %s (%s) not "
"replicated\n", which, dsn, desc); "replicated\n", which, dsn, desc);
success = 0; success = FALSE;
} }
} }
if (sql_ret != SQL_NO_DATA) if (sql_ret != SQL_NO_DATA)
{ {
TRACE ("Error %d enumerating %s datasources\n", TRACE ("Error %d enumerating %s datasources\n",
(int)sql_ret, which); (int)sql_ret, which);
success = 0; success = FALSE;
} }
if ((reg_ret = RegCloseKey (hODBC)) != ERROR_SUCCESS) if ((reg_ret = RegCloseKey (hODBC)) != ERROR_SUCCESS)
{ {
...@@ -1981,7 +1981,7 @@ SQLRETURN WINAPI SQLSetScrollOptions( ...@@ -1981,7 +1981,7 @@ SQLRETURN WINAPI SQLSetScrollOptions(
return pSQLSetScrollOptions(statement_handle, f_concurrency, crow_keyset, crow_rowset); return pSQLSetScrollOptions(statement_handle, f_concurrency, crow_keyset, crow_rowset);
} }
static int SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType)
{ {
static const SQLUSMALLINT attrList[] = static const SQLUSMALLINT attrList[] =
{ {
...@@ -2006,9 +2006,9 @@ static int SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) ...@@ -2006,9 +2006,9 @@ static int SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType)
unsigned int i; unsigned int i;
for (i = 0; i < sizeof(attrList) / sizeof(SQLUSMALLINT); i++) { for (i = 0; i < sizeof(attrList) / sizeof(SQLUSMALLINT); i++) {
if (attrList[i] == fDescType) return 1; if (attrList[i] == fDescType) return TRUE;
} }
return 0; return FALSE;
} }
/************************************************************************* /*************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment