|
|
Choosing A Webhost: |
CVS update of odbsequoia/src (connect.cpp): msg#00116db.carob.cvs
Date: Wednesday, March 22, 2006 @ 16:03:52 Author: marc Path: /cvsroot/carob/odbsequoia/src Modified: connect.cpp (1.15 -> 1.16) !SQLGetPrivateProfileString becomes 0 >= SQLGetPrivateProfileString, clearer and safer. -------------+ connect.cpp | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) Index: odbsequoia/src/connect.cpp diff -u odbsequoia/src/connect.cpp:1.15 odbsequoia/src/connect.cpp:1.16 --- odbsequoia/src/connect.cpp:1.15 Wed Mar 22 15:35:04 2006 +++ odbsequoia/src/connect.cpp Wed Mar 22 16:03:52 2006 @@ -93,27 +93,28 @@ // when we require the user to provide a value. // TODO: call SQLInstallerError() to throw better diags + // BTW how could we fail when providing a default value? // Slurp DSN information from odbc.ini into ConnectionParameters - if (!SQLGetPrivateProfileString(cdsn, SERVER_INI, "localhost", - temp, MAX_VALUE_LEN, ODBC_INI)) + if (0 >= SQLGetPrivateProfileString(cdsn, SERVER_INI, "localhost", + temp, MAX_VALUE_LEN, ODBC_INI)) return SQL_ERROR; // TODO: diags. On the other hand it can hardly fail. std::wstring serverhost = fromString(std::string(temp)); - if (!SQLGetPrivateProfileString(cdsn, PORT_INI, "25322", - temp, MAX_VALUE_LEN, ODBC_INI)) + if (0 >= SQLGetPrivateProfileString(cdsn, PORT_INI, "25322", + temp, MAX_VALUE_LEN, ODBC_INI)) return SQL_ERROR; // TODO: diags. On the other hand it can hardly fail. in_port_t port = atoi(temp); - if (!SQLGetPrivateProfileString(cdsn, DATABASE_INI, "", - temp, MAX_VALUE_LEN, ODBC_INI)) + if (0 >= SQLGetPrivateProfileString(cdsn, DATABASE_INI, "", + temp, MAX_VALUE_LEN, ODBC_INI)) throw ODBSeqException(L"???", L"'" WIDENMACRO(DATABASE_INI) L"'" L" parameter not found in .ini file"); std::wstring vdbname = fromString(std::string(temp)); - if (!SQLGetPrivateProfileString(cdsn, BACKEND_IDS_INI, DEFAULT_BACKEND_IDS_INI, - temp, MAX_VALUE_LEN, ODBC_INI)) - return SQL_ERROR; // TODO: diags + if (0 >= SQLGetPrivateProfileString(cdsn, BACKEND_IDS_INI, DEFAULT_BACKEND_IDS_INI, + temp, MAX_VALUE_LEN, ODBC_INI)) + return SQL_ERROR; // TODO: diags. On the other hand it can hardly fail. this->backend_diagids = fromString(std::string(temp));
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS update of odbsequoia/src (connect.cpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
|---|---|
| Next by Date: | CVS update of carob/src (SQLDataSerialization.cpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Previous by Thread: | CVS update of odbsequoia/src (connect.cpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Next by Thread: | CVS update of odbsequoia/src (connect.cpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|