Warning fixes, source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31191 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -579,13 +579,13 @@ const wxChar *wxDb::convertUserID(const wxChar *userID, wxString &UserID)
|
|||||||
|
|
||||||
bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
||||||
{
|
{
|
||||||
int iIndex;
|
size_t iIndex;
|
||||||
|
|
||||||
// These are the possible SQL types we check for use against the datasource we are connected
|
// These are the possible SQL types we check for use against the datasource we are connected
|
||||||
// to for the purpose of determining which data type to use for the basic character strings
|
// to for the purpose of determining which data type to use for the basic character strings
|
||||||
// column types
|
// column types
|
||||||
//
|
//
|
||||||
// NOTE: The first type in this enumeration that is determined to be supported by the
|
// NOTE: The first type in this enumeration that is determined to be supported by the
|
||||||
// datasource/driver is the one that will be used.
|
// datasource/driver is the one that will be used.
|
||||||
SWORD PossibleSqlCharTypes[] = {
|
SWORD PossibleSqlCharTypes[] = {
|
||||||
#if wxUSE_UNICODE && defined(SQL_WVARCHAR)
|
#if wxUSE_UNICODE && defined(SQL_WVARCHAR)
|
||||||
@@ -602,7 +602,7 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
// to for the purpose of determining which data type to use for the basic non-floating point
|
// to for the purpose of determining which data type to use for the basic non-floating point
|
||||||
// column types
|
// column types
|
||||||
//
|
//
|
||||||
// NOTE: The first type in this enumeration that is determined to be supported by the
|
// NOTE: The first type in this enumeration that is determined to be supported by the
|
||||||
// datasource/driver is the one that will be used.
|
// datasource/driver is the one that will be used.
|
||||||
SWORD PossibleSqlIntegerTypes[] = {
|
SWORD PossibleSqlIntegerTypes[] = {
|
||||||
SQL_INTEGER
|
SQL_INTEGER
|
||||||
@@ -612,7 +612,7 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
// to for the purpose of determining which data type to use for the basic floating point number
|
// to for the purpose of determining which data type to use for the basic floating point number
|
||||||
// column types
|
// column types
|
||||||
//
|
//
|
||||||
// NOTE: The first type in this enumeration that is determined to be supported by the
|
// NOTE: The first type in this enumeration that is determined to be supported by the
|
||||||
// datasource/driver is the one that will be used.
|
// datasource/driver is the one that will be used.
|
||||||
SWORD PossibleSqlFloatTypes[] = {
|
SWORD PossibleSqlFloatTypes[] = {
|
||||||
SQL_DOUBLE,
|
SQL_DOUBLE,
|
||||||
@@ -625,7 +625,7 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
// These are the possible SQL types we check for use agains the datasource we are connected
|
// These are the possible SQL types we check for use agains the datasource we are connected
|
||||||
// to for the purpose of determining which data type to use for the date/time column types
|
// to for the purpose of determining which data type to use for the date/time column types
|
||||||
//
|
//
|
||||||
// NOTE: The first type in this enumeration that is determined to be supported by the
|
// NOTE: The first type in this enumeration that is determined to be supported by the
|
||||||
// datasource/driver is the one that will be used.
|
// datasource/driver is the one that will be used.
|
||||||
SWORD PossibleSqlDateTypes[] = {
|
SWORD PossibleSqlDateTypes[] = {
|
||||||
SQL_TIMESTAMP,
|
SQL_TIMESTAMP,
|
||||||
@@ -638,7 +638,7 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
// These are the possible SQL types we check for use agains the datasource we are connected
|
// These are the possible SQL types we check for use agains the datasource we are connected
|
||||||
// to for the purpose of determining which data type to use for the BLOB column types.
|
// to for the purpose of determining which data type to use for the BLOB column types.
|
||||||
//
|
//
|
||||||
// NOTE: The first type in this enumeration that is determined to be supported by the
|
// NOTE: The first type in this enumeration that is determined to be supported by the
|
||||||
// datasource/driver is the one that will be used.
|
// datasource/driver is the one that will be used.
|
||||||
SWORD PossibleSqlBlobTypes[] = {
|
SWORD PossibleSqlBlobTypes[] = {
|
||||||
SQL_LONGVARBINARY,
|
SQL_LONGVARBINARY,
|
||||||
@@ -691,8 +691,8 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
if (!getDbInfo(failOnDataTypeUnsupported))
|
if (!getDbInfo(failOnDataTypeUnsupported))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// --------------- Varchar - (Variable length character string) ---------------
|
// --------------- Varchar - (Variable length character string) ---------------
|
||||||
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlCharTypes) &&
|
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlCharTypes) &&
|
||||||
!getDataTypeInfo(PossibleSqlCharTypes[iIndex], typeInfVarchar); ++iIndex)
|
!getDataTypeInfo(PossibleSqlCharTypes[iIndex], typeInfVarchar); ++iIndex)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -701,8 +701,8 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
else if (failOnDataTypeUnsupported)
|
else if (failOnDataTypeUnsupported)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// --------------- Float ---------------
|
// --------------- Float ---------------
|
||||||
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlFloatTypes) &&
|
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlFloatTypes) &&
|
||||||
!getDataTypeInfo(PossibleSqlFloatTypes[iIndex], typeInfFloat); ++iIndex)
|
!getDataTypeInfo(PossibleSqlFloatTypes[iIndex], typeInfFloat); ++iIndex)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -712,7 +712,7 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// --------------- Integer -------------
|
// --------------- Integer -------------
|
||||||
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlIntegerTypes) &&
|
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlIntegerTypes) &&
|
||||||
!getDataTypeInfo(PossibleSqlIntegerTypes[iIndex], typeInfInteger); ++iIndex)
|
!getDataTypeInfo(PossibleSqlIntegerTypes[iIndex], typeInfInteger); ++iIndex)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -731,8 +731,8 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
typeInfInteger.FsqlType = typeInfFloat.FsqlType;
|
typeInfInteger.FsqlType = typeInfFloat.FsqlType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------- Date/Time ---------------
|
// --------------- Date/Time ---------------
|
||||||
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlDateTypes) &&
|
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlDateTypes) &&
|
||||||
!getDataTypeInfo(PossibleSqlDateTypes[iIndex], typeInfDate); ++iIndex)
|
!getDataTypeInfo(PossibleSqlDateTypes[iIndex], typeInfDate); ++iIndex)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -741,8 +741,8 @@ bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported)
|
|||||||
else if (failOnDataTypeUnsupported)
|
else if (failOnDataTypeUnsupported)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// --------------- BLOB ---------------
|
// --------------- BLOB ---------------
|
||||||
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlBlobTypes) &&
|
for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlBlobTypes) &&
|
||||||
!getDataTypeInfo(PossibleSqlBlobTypes[iIndex], typeInfBlob); ++iIndex)
|
!getDataTypeInfo(PossibleSqlBlobTypes[iIndex], typeInfBlob); ++iIndex)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@@ -792,7 +792,8 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
|||||||
else if (checkPrivileges)
|
else if (checkPrivileges)
|
||||||
{
|
{
|
||||||
// Verify the user has rights to access the table.
|
// Verify the user has rights to access the table.
|
||||||
bool hasPrivs = true;
|
bool hasPrivs wxDUMMY_INITIALIZE(true);
|
||||||
|
|
||||||
if (pDb->Dbms() == dbmsPOSTGRES)
|
if (pDb->Dbms() == dbmsPOSTGRES)
|
||||||
hasPrivs = pDb->TablePrivileges(tableName, wxT("SELECT"), pDb->GetUsername(), NULL, tablePath);
|
hasPrivs = pDb->TablePrivileges(tableName, wxT("SELECT"), pDb->GetUsername(), NULL, tablePath);
|
||||||
else
|
else
|
||||||
@@ -802,11 +803,11 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
|
|||||||
s = wxT("Connecting user does not have sufficient privileges to access this table.\n");
|
s = wxT("Connecting user does not have sufficient privileges to access this table.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!s.IsEmpty())
|
if (!s.empty())
|
||||||
{
|
{
|
||||||
wxString p;
|
wxString p;
|
||||||
|
|
||||||
if (!tablePath.IsEmpty())
|
if (!tablePath.empty())
|
||||||
p.Printf(wxT("Error opening '%s/%s'.\n"),tablePath.c_str(),tableName.c_str());
|
p.Printf(wxT("Error opening '%s/%s'.\n"),tablePath.c_str(),tableName.c_str());
|
||||||
else
|
else
|
||||||
p.Printf(wxT("Error opening '%s'.\n"), tableName.c_str());
|
p.Printf(wxT("Error opening '%s'.\n"), tableName.c_str());
|
||||||
@@ -1313,7 +1314,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere,
|
|||||||
case SQL_C_CHAR:
|
case SQL_C_CHAR:
|
||||||
#ifndef __UNIX__
|
#ifndef __UNIX__
|
||||||
case SQL_C_WCHAR:
|
case SQL_C_WCHAR:
|
||||||
#endif
|
#endif
|
||||||
//case SQL_C_WXCHAR: SQL_C_WXCHAR is covered by either SQL_C_CHAR or SQL_C_WCHAR
|
//case SQL_C_WXCHAR: SQL_C_WXCHAR is covered by either SQL_C_CHAR or SQL_C_WCHAR
|
||||||
colValue.Printf(wxT("'%s'"), (UCHAR FAR *) colDefs[colNumber].PtrDataObj);
|
colValue.Printf(wxT("'%s'"), (UCHAR FAR *) colDefs[colNumber].PtrDataObj);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user