mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 18:59:09 +00:00
Convert custom HeadSpin integer types to standard types from stdint.h
This commit is contained in:
@ -74,7 +74,7 @@ struct SqlStmtHash {
|
||||
|
||||
SqlStmtHash ();
|
||||
SqlStmtHash (FSqlBindPrepare prepare);
|
||||
dword GetHash () const;
|
||||
uint32_t GetHash () const;
|
||||
bool operator== (const SqlStmtHash & rhs) const;
|
||||
};
|
||||
|
||||
@ -97,13 +97,13 @@ struct SqlStmt : SqlStmtHash {
|
||||
void * errHandlerParam;
|
||||
unsigned sequence;
|
||||
unsigned timeoutSecs;
|
||||
byte * data;
|
||||
wchar debug[128];
|
||||
uint8_t * data;
|
||||
wchar_t debug[128];
|
||||
|
||||
SqlStmt (SqlConn * conn);
|
||||
~SqlStmt ();
|
||||
SqlStmt & operator= (const SqlStmt &); // not impl.
|
||||
bool Initialize (const wchar connectStr[]);
|
||||
bool Initialize (const wchar_t connectStr[]);
|
||||
void Reset ();
|
||||
bool QueryDead (unsigned method);
|
||||
};
|
||||
@ -121,7 +121,7 @@ struct SqlConn {
|
||||
unsigned sequence;
|
||||
unsigned timeoutSecs;
|
||||
AsyncThreadTaskList * taskList;
|
||||
wchar * connectStr;
|
||||
wchar_t * connectStr;
|
||||
|
||||
LISTDECL(
|
||||
SqlStmt,
|
||||
@ -135,7 +135,7 @@ struct SqlConn {
|
||||
) freeStmts;
|
||||
|
||||
SqlConn (
|
||||
const wchar connectStr[],
|
||||
const wchar_t connectStr[],
|
||||
SQLHENV henv
|
||||
);
|
||||
~SqlConn ();
|
||||
@ -202,8 +202,8 @@ static void LogErr (
|
||||
int result,
|
||||
SQLSMALLINT handleType,
|
||||
SQLHANDLE handle,
|
||||
const wchar function[],
|
||||
const wchar command[]
|
||||
const wchar_t function[],
|
||||
const wchar_t command[]
|
||||
) {
|
||||
if (SQL_SUCCEEDED(result) && result != SQL_SUCCESS_WITH_INFO)
|
||||
return;
|
||||
@ -243,7 +243,7 @@ static void LogErr (
|
||||
static void LogStmtError (
|
||||
int result,
|
||||
SqlStmt * stmt,
|
||||
const wchar function[]
|
||||
const wchar_t function[]
|
||||
) {
|
||||
if (result == SQL_SUCCESS)
|
||||
return;
|
||||
@ -315,8 +315,8 @@ inline SqlStmtHash::SqlStmtHash (FSqlBindPrepare prepare)
|
||||
{}
|
||||
|
||||
//============================================================================
|
||||
inline dword SqlStmtHash::GetHash () const {
|
||||
return (dword) prepare;
|
||||
inline uint32_t SqlStmtHash::GetHash () const {
|
||||
return (uint32_t) prepare;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
@ -385,7 +385,7 @@ SqlStmt::~SqlStmt () {
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
bool SqlStmt::Initialize (const wchar connectStr[]) {
|
||||
bool SqlStmt::Initialize (const wchar_t connectStr[]) {
|
||||
ASSERT(!hdbc);
|
||||
|
||||
for (;;) {
|
||||
@ -544,7 +544,7 @@ bool SqlStmt::QueryDead (unsigned method) {
|
||||
|
||||
//============================================================================
|
||||
SqlConn::SqlConn (
|
||||
const wchar connectStr[],
|
||||
const wchar_t connectStr[],
|
||||
SQLHENV henv
|
||||
) : henv(henv)
|
||||
, flags(0)
|
||||
@ -751,7 +751,7 @@ void SqlConn::AsyncCheckDead_CS () {
|
||||
|
||||
//============================================================================
|
||||
SqlConn * SqlConnCreate (
|
||||
const wchar connectStr[],
|
||||
const wchar_t connectStr[],
|
||||
unsigned maxConnections,
|
||||
unsigned transTimeoutSeconds
|
||||
) {
|
||||
@ -915,7 +915,7 @@ SqlStmt * SqlConnAllocStmt (SqlConn * conn) {
|
||||
SqlStmt * SqlConnAllocStmt (
|
||||
SqlConn * conn,
|
||||
FSqlBindPrepare prepare,
|
||||
byte ** bindData // [OUT]
|
||||
uint8_t ** bindData // [OUT]
|
||||
) {
|
||||
ASSERT(prepare || !bindData);
|
||||
if (!conn)
|
||||
@ -1026,7 +1026,7 @@ SqlStmt * SqlConnAllocStmt (
|
||||
}
|
||||
|
||||
if (prepare) {
|
||||
ARRAY(byte) data;
|
||||
ARRAY(uint8_t) data;
|
||||
prepare(stmt, &data);
|
||||
stmt->prepare = prepare;
|
||||
stmt->data = data.Detach();
|
||||
@ -1289,13 +1289,13 @@ void SqlConnBindParameterStringA (
|
||||
//============================================================================
|
||||
int SqlConnExecDirect (
|
||||
SqlStmt * stmt,
|
||||
const wchar string[]
|
||||
const wchar_t string[]
|
||||
) {
|
||||
#ifdef LOG_SQL_STMTS
|
||||
LogMsg(kLogDebug, L"SQL: %s", string);
|
||||
#endif
|
||||
StrCopy(stmt->debug, string, arrsize(stmt->debug));
|
||||
int result = SQLExecDirectW(stmt->hstmt, const_cast<wchar *>(string), SQL_NTS);
|
||||
int result = SQLExecDirectW(stmt->hstmt, const_cast<wchar_t *>(string), SQL_NTS);
|
||||
LogStmtError(result, stmt, L"SqlExecute");
|
||||
return result;
|
||||
}
|
||||
@ -1303,7 +1303,7 @@ int SqlConnExecDirect (
|
||||
//============================================================================
|
||||
int SqlConnPrepare (
|
||||
SqlStmt * stmt,
|
||||
const wchar string[]
|
||||
const wchar_t string[]
|
||||
) {
|
||||
// Using {call ...} or {?= call ...} with SqlPrepare doesn't allow
|
||||
// the ODBC expression parser to perform escape sequence fixup for
|
||||
@ -1314,7 +1314,7 @@ int SqlConnPrepare (
|
||||
#endif
|
||||
|
||||
StrCopy(stmt->debug, string, arrsize(stmt->debug));
|
||||
int result = SQLPrepareW(stmt->hstmt, const_cast<wchar *>(string), SQL_NTS);
|
||||
int result = SQLPrepareW(stmt->hstmt, const_cast<wchar_t *>(string), SQL_NTS);
|
||||
LogStmtError(result, stmt, L"SqlPrepare");
|
||||
return result;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ struct SqlTrans;
|
||||
|
||||
typedef void (* FSqlBindPrepare)(
|
||||
SqlStmt * stmt,
|
||||
ARRAY(byte) * bindData
|
||||
ARRAY(uint8_t) * bindData
|
||||
);
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ typedef void (* FSqlBindPrepare)(
|
||||
***/
|
||||
|
||||
SqlConn * SqlConnCreate (
|
||||
const wchar connectStr[],
|
||||
const wchar_t connectStr[],
|
||||
unsigned maxConnections,
|
||||
unsigned transTimeoutMs
|
||||
);
|
||||
@ -120,7 +120,7 @@ void SqlStmtSetAttr (
|
||||
SqlStmt * SqlConnAllocStmt (
|
||||
SqlConn * conn,
|
||||
FSqlBindPrepare prepare,
|
||||
byte ** bindData // [OUT]
|
||||
uint8_t ** bindData // [OUT]
|
||||
);
|
||||
|
||||
|
||||
@ -132,8 +132,8 @@ SqlStmt * SqlConnAllocStmt (
|
||||
|
||||
typedef void (* FSqlConnErrorHandler)(
|
||||
int result,
|
||||
const wchar function[],
|
||||
const wchar command[],
|
||||
const wchar_t function[],
|
||||
const wchar_t command[],
|
||||
const char diagnostics[], // double-null terminated
|
||||
void * userParam
|
||||
);
|
||||
@ -238,11 +238,11 @@ void SqlConnBindParameterStringA (
|
||||
|
||||
int SqlConnExecDirect (
|
||||
SqlStmt * stmt,
|
||||
const wchar string[]
|
||||
const wchar_t string[]
|
||||
);
|
||||
int SqlConnPrepare (
|
||||
SqlStmt * stmt,
|
||||
const wchar string[]
|
||||
const wchar_t string[]
|
||||
);
|
||||
int SqlConnExecute (
|
||||
SqlStmt * stmt
|
||||
|
@ -105,7 +105,7 @@ void SqlConnBindParameterBigInt (
|
||||
inputOutputType,
|
||||
SQL_C_SBIGINT,
|
||||
SQL_BIGINT,
|
||||
sizeof(qword),
|
||||
sizeof(uint64_t),
|
||||
0,
|
||||
parameterValuePtr,
|
||||
0,
|
||||
@ -117,7 +117,7 @@ void SqlConnBindParameterBigInt (
|
||||
bool SqlConnGetBlobData (
|
||||
SqlStmt * stmt,
|
||||
unsigned colIndex,
|
||||
ARRAY(byte) * buffer,
|
||||
ARRAY(uint8_t) * buffer,
|
||||
unsigned * bytesAdded
|
||||
) {
|
||||
// Since a number of routines use this function, set the chunk size to be
|
||||
@ -184,12 +184,12 @@ bool SqlConnGetBlobData (
|
||||
int SqlConnPutBlobData (
|
||||
SqlStmt * stmt,
|
||||
unsigned bytes,
|
||||
const byte data[]
|
||||
const uint8_t data[]
|
||||
) {
|
||||
int result;
|
||||
SQLPOINTER putPtr;
|
||||
while (SQL_NEED_DATA == (result = SqlConnParamData(stmt, &putPtr))) {
|
||||
if (!SqlConnPutData(stmt, const_cast<byte *>(data), bytes))
|
||||
if (!SqlConnPutData(stmt, const_cast<uint8_t *>(data), bytes))
|
||||
return SQL_ERROR;
|
||||
}
|
||||
return result;
|
||||
|
@ -76,11 +76,11 @@ void SqlConnBindParameterBigInt (
|
||||
bool SqlConnGetBlobData (
|
||||
SqlStmt * stmt,
|
||||
unsigned colIndex,
|
||||
ARRAY(byte) * buffer,
|
||||
ARRAY(uint8_t) * buffer,
|
||||
unsigned * bytesAdded
|
||||
);
|
||||
int SqlConnPutBlobData (
|
||||
SqlStmt * stmt,
|
||||
unsigned bytes,
|
||||
const byte data[]
|
||||
const uint8_t data[]
|
||||
);
|
||||
|
Reference in New Issue
Block a user