summaryrefslogtreecommitdiffstats
path: root/src/dal
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-01-09 13:23:43 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-01-09 13:23:43 +0100
commit16074a7c2c8197a061281a6880ddbc3967d8ea0c (patch)
treebd0cc650944aaeb38e87d43b94e43c1ab94bb2c7 /src/dal
parent562b403a66a6a96d883620b27455564d50e3d49b (diff)
downloadmanaserv-16074a7c2c8197a061281a6880ddbc3967d8ea0c.tar.gz
manaserv-16074a7c2c8197a061281a6880ddbc3967d8ea0c.tar.xz
manaserv-16074a7c2c8197a061281a6880ddbc3967d8ea0c.zip
Replaced 'unsigned int' with 'unsigned'
Same thing, but shorter.
Diffstat (limited to 'src/dal')
-rw-r--r--src/dal/mysqldataprovider.cpp14
-rw-r--r--src/dal/mysqldataprovider.h2
-rw-r--r--src/dal/pqdataprovider.cpp8
-rw-r--r--src/dal/recordset.cpp16
-rw-r--r--src/dal/recordset.h10
5 files changed, 25 insertions, 25 deletions
diff --git a/src/dal/mysqldataprovider.cpp b/src/dal/mysqldataprovider.cpp
index 1303646..9f9c4a9 100644
--- a/src/dal/mysqldataprovider.cpp
+++ b/src/dal/mysqldataprovider.cpp
@@ -32,7 +32,7 @@ const std::string MySqlDataProvider::CFGPARAM_MYSQL_USER ="mysql_username";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_PWD ="mysql_password";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_HOST_DEF = "localhost";
-const unsigned int MySqlDataProvider::CFGPARAM_MYSQL_PORT_DEF = 3306;
+const unsigned MySqlDataProvider::CFGPARAM_MYSQL_PORT_DEF = 3306;
const std::string MySqlDataProvider::CFGPARAM_MYSQL_DB_DEF = "mana";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_USER_DEF = "mana";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_PWD_DEF = "mana";
@@ -84,7 +84,7 @@ void MySqlDataProvider::connect()
= Configuration::getValue(CFGPARAM_MYSQL_USER, CFGPARAM_MYSQL_USER_DEF);
const std::string password
= Configuration::getValue(CFGPARAM_MYSQL_PWD, CFGPARAM_MYSQL_PWD_DEF);
- const unsigned int tcpPort
+ const unsigned tcpPort
= Configuration::getValue(CFGPARAM_MYSQL_PORT, CFGPARAM_MYSQL_PORT_DEF);
// allocate and initialize a new MySQL object suitable
@@ -158,10 +158,10 @@ const RecordSet &MySqlDataProvider::execSql(const std::string& sql,
throw DbSqlQueryExecFailure(mysql_error(mDb));
// set the field names.
- unsigned int nFields = mysql_num_fields(res);
+ unsigned nFields = mysql_num_fields(res);
MYSQL_FIELD* fields = mysql_fetch_fields(res);
Row fieldNames;
- for (unsigned int i = 0; i < nFields; ++i)
+ for (unsigned i = 0; i < nFields; ++i)
fieldNames.push_back(fields[i].name);
mRecordSet.setColumnHeaders(fieldNames);
@@ -172,7 +172,7 @@ const RecordSet &MySqlDataProvider::execSql(const std::string& sql,
{
Row r;
- for (unsigned int i = 0; i < nFields; ++i)
+ for (unsigned i = 0; i < nFields; ++i)
r.push_back(static_cast<char *>(row[i]));
mRecordSet.add(r);
@@ -411,13 +411,13 @@ const RecordSet &MySqlDataProvider::processSql()
res = mysql_stmt_result_metadata(mStmt);
// set the field names.
- unsigned int nFields = mysql_num_fields(res);
+ unsigned nFields = mysql_num_fields(res);
MYSQL_FIELD* fields = mysql_fetch_fields(res);
Row fieldNames;
resultBind = new MYSQL_BIND[mysql_num_fields(res)];
- unsigned int i = 0;
+ unsigned i = 0;
for (i = 0; i < mysql_num_fields(res); ++i)
{
resultBind[i].buffer_type = MYSQL_TYPE_STRING;
diff --git a/src/dal/mysqldataprovider.h b/src/dal/mysqldataprovider.h
index 945b284..6f8de3a 100644
--- a/src/dal/mysqldataprovider.h
+++ b/src/dal/mysqldataprovider.h
@@ -192,7 +192,7 @@ class MySqlDataProvider: public DataProvider
/** defines the default value of the CFGPARAM_MYSQL_HOST parameter */
static const std::string CFGPARAM_MYSQL_HOST_DEF;
/** defines the default value of the CFGPARAM_MYSQL_PORT parameter */
- static const unsigned int CFGPARAM_MYSQL_PORT_DEF;
+ static const unsigned CFGPARAM_MYSQL_PORT_DEF;
/** defines the default value of the CFGPARAM_MYSQL_DB parameter */
static const std::string CFGPARAM_MYSQL_DB_DEF;
/** defines the default value of the CFGPARAM_MYSQL_USER parameter */
diff --git a/src/dal/pqdataprovider.cpp b/src/dal/pqdataprovider.cpp
index 5895912..34dd548 100644
--- a/src/dal/pqdataprovider.cpp
+++ b/src/dal/pqdataprovider.cpp
@@ -100,22 +100,22 @@ const RecordSet &PqDataProvider::execSql(const std::string& sql,
}
// get field count
- unsigned int nFields = PQnfields(res);
+ unsigned nFields = PQnfields(res);
// fill column names
Row fieldNames;
- for (unsigned int i = 0; i < nFields; i++)
+ for (unsigned i = 0; i < nFields; i++)
{
fieldNames.push_back(PQfname(res, i));
}
mRecordSet.setColumnHeaders(fieldNames);
// fill rows
- for (unsigned int r = 0; r < PQntuples(res); r++)
+ for (unsigned r = 0; r < PQntuples(res); r++)
{
Row row;
- for (unsigned int i = 0; i < nFields; i++)
+ for (unsigned i = 0; i < nFields; i++)
row.push_back(PQgetvalue(res, r, i));
mRecordSet.add(row);
diff --git a/src/dal/recordset.cpp b/src/dal/recordset.cpp
index 065bbd7..0529325 100644
--- a/src/dal/recordset.cpp
+++ b/src/dal/recordset.cpp
@@ -61,7 +61,7 @@ bool RecordSet::isEmpty() const
*
* @return the number of rows.
*/
-unsigned int RecordSet::rows() const
+unsigned RecordSet::rows() const
{
return mRows.size();
}
@@ -71,7 +71,7 @@ unsigned int RecordSet::rows() const
*
* @return the number of columns.
*/
-unsigned int RecordSet::cols() const
+unsigned RecordSet::cols() const
{
return mHeaders.size();
}
@@ -93,7 +93,7 @@ void RecordSet::setColumnHeaders(const Row &headers)
*/
void RecordSet::add(const Row &row)
{
- const unsigned int nCols = mHeaders.size();
+ const unsigned nCols = mHeaders.size();
if (nCols == 0) {
throw RsColumnHeadersNotSet();
@@ -110,8 +110,8 @@ void RecordSet::add(const Row &row)
mRows.push_back(row);
}
-const std::string &RecordSet::operator()(const unsigned int row,
- const unsigned int col) const
+const std::string &RecordSet::operator()(const unsigned row,
+ const unsigned col) const
{
if ((row >= mRows.size()) || (col >= mHeaders.size())) {
std::ostringstream os;
@@ -125,7 +125,7 @@ const std::string &RecordSet::operator()(const unsigned int row,
return mRows[row][col];
}
-const std::string &RecordSet::operator()(const unsigned int row,
+const std::string &RecordSet::operator()(const unsigned row,
const std::string& name) const
{
if (row >= mRows.size()) {
@@ -147,8 +147,8 @@ const std::string &RecordSet::operator()(const unsigned int row,
}
// find the field index.
- const unsigned int nCols = mHeaders.size();
- unsigned int i;
+ const unsigned nCols = mHeaders.size();
+ unsigned i;
for (i = 0; i < nCols; ++i) {
if (mHeaders[i] == name) {
break;
diff --git a/src/dal/recordset.h b/src/dal/recordset.h
index 80c2e68..91b434d 100644
--- a/src/dal/recordset.h
+++ b/src/dal/recordset.h
@@ -67,14 +67,14 @@ class RecordSet
*
* @return the number of rows.
*/
- unsigned int rows() const;
+ unsigned rows() const;
/**
* Get the number of columns.
*
* @return the number of columns.
*/
- unsigned int cols() const;
+ unsigned cols() const;
/**
* Set the column headers.
@@ -115,8 +115,8 @@ class RecordSet
* @exception std::invalid_argument if the recordset is empty.
*/
const std::string&
- operator()(const unsigned int row,
- const unsigned int col) const;
+ operator()(const unsigned row,
+ const unsigned col) const;
/**
@@ -134,7 +134,7 @@ class RecordSet
* the recordset is empty.
*/
const std::string&
- operator()(const unsigned int row,
+ operator()(const unsigned row,
const std::string &name) const;