Author: wyoung
Date: Thu Aug 13 15:59:19 2009
New Revision: 2562
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2562&view=rev
Log:
Still more warning squishers, mostly x64 int stuff again
Modified:
trunk/examples/dbinfo.cpp
trunk/examples/fieldinf.cpp
trunk/examples/multiquery.cpp
trunk/examples/printdata.cpp
trunk/examples/printdata.h
trunk/examples/ssqls6.cpp
trunk/lib/query.h
trunk/test/array_index.cpp
Modified: trunk/examples/dbinfo.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/dbinfo.cpp?rev=2562&r1=2561&r2=2562&view=diff
==============================================================================
--- trunk/examples/dbinfo.cpp (original)
+++ trunk/examples/dbinfo.cpp Thu Aug 13 15:59:19 2009
@@ -92,10 +92,10 @@
separator(cout, query.str());
mysqlpp::StoreQueryResult res = query.store();
- unsigned int columns = res.num_fields();
- vector<int> widths;
- for (unsigned int i = 0; i < columns; ++i) {
- string s = res.field_name(i);
+ size_t columns = res.num_fields();
+ vector<size_t> widths;
+ for (size_t i = 0; i < columns; ++i) {
+ string s = res.field_name(int(i));
if (s.compare("field") == 0) {
widths.push_back(22);
}
@@ -116,7 +116,8 @@
}
if (widths[i]) {
- cout << '|' << setw(widths[i]) <<
res.field_name(i) << '|';
+ cout << '|' << setw(widths[i]) <<
+ res.field_name(int(i)) << '|';
}
}
cout << endl;
Modified: trunk/examples/fieldinf.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/fieldinf.cpp?rev=2562&r1=2561&r2=2562&view=diff
==============================================================================
--- trunk/examples/fieldinf.cpp (original)
+++ trunk/examples/fieldinf.cpp Thu Aug 13 15:59:19 2009
@@ -67,11 +67,11 @@
for (size_t i = 0; i < res.field_names()->size(); i++) {
// Suppress C++ type name outputs when run under dtest,
// as they're system-specific.
- const char* cname = res.field_type(i).name();
- mysqlpp::FieldTypes::value_type ft = res.field_type(i);
+ const char* cname = res.field_type(int(i)).name();
+ mysqlpp::FieldTypes::value_type ft =
res.field_type(int(i));
ostringstream os;
os << ft.sql_name() << " (" << ft.id() << ')';
- cout << setw(widths[0]) << res.field_name(i).c_str() <<
+ cout << setw(widths[0]) <<
res.field_name(int(i)).c_str() <<
setw(widths[1]) << os.str() <<
setw(widths[2]) << cname <<
endl;
Modified: trunk/examples/multiquery.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/multiquery.cpp?rev=2562&r1=2561&r2=2562&view=diff
==============================================================================
--- trunk/examples/multiquery.cpp (original)
+++ trunk/examples/multiquery.cpp Thu Aug 13 15:59:19 2009
@@ -42,7 +42,7 @@
using namespace mysqlpp;
-typedef vector<int> IntVectorType;
+typedef vector<size_t> IntVectorType;
static void
@@ -50,7 +50,7 @@
{
cout << " |" << setfill(' ');
for (size_t i = 0; i < res.field_names()->size(); i++) {
- cout << " " << setw(widths.at(i)) << res.field_name(i) << " |";
+ cout << " " << setw(widths.at(i)) << res.field_name(int(i)) <<
" |";
}
cout << endl;
}
@@ -61,7 +61,7 @@
{
cout << " |" << setfill(' ');
for (size_t i = 0; i < row.size(); ++i) {
- cout << " " << setw(widths.at(i)) << row[i] << " |";
+ cout << " " << setw(widths.at(i)) << row[int(i)] << " |";
}
cout << endl;
}
@@ -94,7 +94,7 @@
// Figure out the widths of the result set's columns
IntVectorType widths;
- int size = res.num_fields();
+ size_t size = res.num_fields();
for (int i = 0; i < size; i++) {
widths.push_back(max(
res.field(i).max_length(),
Modified: trunk/examples/printdata.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/printdata.cpp?rev=2562&r1=2561&r2=2562&view=diff
==============================================================================
--- trunk/examples/printdata.cpp (original)
+++ trunk/examples/printdata.cpp Thu Aug 13 15:59:19 2009
@@ -37,7 +37,7 @@
// Display a header suitable for use with print_stock_rows().
void
-print_stock_header(int rows)
+print_stock_header(size_t rows)
{
cout << "Records found: " << rows << endl << endl;
cout.setf(ios::left);
Modified: trunk/examples/printdata.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/printdata.h?rev=2562&r1=2561&r2=2562&view=diff
==============================================================================
--- trunk/examples/printdata.h (original)
+++ trunk/examples/printdata.h Thu Aug 13 15:59:19 2009
@@ -30,7 +30,7 @@
#include <mysql++.h>
-void print_stock_header(int rows);
+void print_stock_header(size_t rows);
void print_stock_row(const mysqlpp::Row& r);
void print_stock_row(const mysqlpp::sql_char& item,
mysqlpp::sql_bigint num, mysqlpp::sql_double weight,
Modified: trunk/examples/ssqls6.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/ssqls6.cpp?rev=2562&r1=2561&r2=2562&view=diff
==============================================================================
--- trunk/examples/ssqls6.cpp (original)
+++ trunk/examples/ssqls6.cpp Thu Aug 13 15:59:19 2009
@@ -36,7 +36,7 @@
// Breaks a given text line of tab-separated fields up into a list of
// strings.
-static int
+static size_t
tokenize_line(const string& line, vector<mysqlpp::String>& strings)
{
string field;
Modified: trunk/lib/query.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.h?rev=2562&r1=2561&r2=2562&view=diff
==============================================================================
--- trunk/lib/query.h (original)
+++ trunk/lib/query.h Thu Aug 13 15:59:19 2009
@@ -1036,7 +1036,7 @@
typename InsertPolicy::access_controller ac(*conn_);
for (Iter it = first; it != last; ++it) {
- if (policy.can_add(tellp(), *it)) {
+ if (policy.can_add(int(tellp()), *it)) {
if (empty) {
MYSQLPP_QUERY_THISPTR <<
std::setprecision(16) <<
"INSERT INTO `" << it->table()
<< "` (" <<
@@ -1062,7 +1062,7 @@
}
// If we _still_ can't add, the policy is too
strict
- if (policy.can_add(tellp(), *it)) {
+ if (policy.can_add(int(tellp()), *it)) {
MYSQLPP_QUERY_THISPTR <<
std::setprecision(16) <<
"INSERT INTO `" << it->table()
<< "` (" <<
it->field_list() << ") VALUES
(" <<
Modified: trunk/test/array_index.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/test/array_index.cpp?rev=2562&r1=2561&r2=2562&view=diff
==============================================================================
--- trunk/test/array_index.cpp (original)
+++ trunk/test/array_index.cpp Thu Aug 13 15:59:19 2009
@@ -40,7 +40,7 @@
typeid(container).name() << '!' << std::endl;
return false;
}
- catch (const mysqlpp::BadIndex& e) {
+ catch (const mysqlpp::BadIndex&) {
return true;
}
catch (const mysqlpp::Exception& e) {
@@ -135,7 +135,7 @@
container["fred"];
return true;
}
- catch (const mysqlpp::BadFieldName& e) {
+ catch (const mysqlpp::BadFieldName&) {
std::cerr << "Exception not suppressed for nonexistent field "
"in " << typeid(container).name() << '!' <<
std::endl;
return false;
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits