Author: wyoung
Date: Thu Aug 13 15:47:32 2009
New Revision: 2561
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2561&view=rev
Log:
More warning squishers
Modified:
trunk/lib/dbdriver.cpp
trunk/lib/dbdriver.h
trunk/lib/field_names.cpp
trunk/lib/options.cpp
trunk/lib/options.h
trunk/ssx/parsev2.cpp
trunk/ssx/parsev2.h
Modified: trunk/lib/dbdriver.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/dbdriver.cpp?rev=2561&r1=2560&r2=2561&view=diff
==============================================================================
--- trunk/lib/dbdriver.cpp (original)
+++ trunk/lib/dbdriver.cpp Thu Aug 13 15:47:32 2009
@@ -140,6 +140,11 @@
#if defined(HAVE_MYSQL_SSL_SET)
return mysql_ssl_set(&mysql_, key, cert, ca, capath, cipher) == 0;
#else
+ (void)key;
+ (void)cert;
+ (void)ca;
+ (void)capath;
+ (void)cipher;
return false;
#endif
}
@@ -281,6 +286,10 @@
case Option::err_connected:
os << "Option can only be set before connection is
established";
break;
+
+ case Option::err_disconnected:
+ os << "Option can only be set while the connection is
established";
+ break;
}
return os.str();
Modified: trunk/lib/dbdriver.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/dbdriver.h?rev=2561&r1=2560&r2=2561&view=diff
==============================================================================
--- trunk/lib/dbdriver.h (original)
+++ trunk/lib/dbdriver.h Thu Aug 13 15:47:32 2009
@@ -3,7 +3,7 @@
/***********************************************************************
Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
- (c) 2004-2008 by Educational Technology Resources, Inc. Others may
+ (c) 2004-2009 by Educational Technology Resources, Inc. Others may
also hold copyrights on code in this file. See the CREDITS.txt file
in the top directory of the distribution for details.
@@ -197,7 +197,7 @@
size_t escape_string(char* to, const char* from, size_t length)
{
return mysql_real_escape_string(&mysql_, to, from,
- (unsigned long)length);
+ static_cast<unsigned long>(length));
}
/// \brief Return a SQL-escaped version of a character buffer
@@ -251,7 +251,8 @@
static size_t escape_string_no_conn(char* to, const char* from,
size_t length)
{
- return mysql_escape_string(to, from, (unsigned long)length);
+ return mysql_escape_string(to, from,
+ static_cast<unsigned long>(length));
}
/// \brief SQL-escapes the given string without reference to the
@@ -267,7 +268,8 @@
/// Wraps \c mysql_real_query() in the MySQL C API.
bool execute(const char* qstr, size_t length)
{
- return !mysql_real_query(&mysql_, qstr, (unsigned long)length);
+ return !mysql_real_query(&mysql_, qstr,
+ static_cast<unsigned long>(length));
}
/// \brief Returns the next raw C API row structure from the given
@@ -303,7 +305,8 @@
MYSQL_FIELD* fetch_field(MYSQL_RES* res, size_t i = UINT_MAX) const
{
return i == UINT_MAX ? mysql_fetch_field(res) :
- mysql_fetch_field_direct(res, (unsigned int)i);
+ mysql_fetch_field_direct(res,
+ static_cast<unsigned int>(i));
}
/// \brief Jumps to the given field within the result set
Modified: trunk/lib/field_names.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/field_names.cpp?rev=2561&r1=2560&r2=2561&view=diff
==============================================================================
--- trunk/lib/field_names.cpp (original)
+++ trunk/lib/field_names.cpp Thu Aug 13 15:47:32 2009
@@ -2,7 +2,7 @@
field_names.cpp - Implements the FieldNames class.
Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
- (c) 2004-2007 by Educational Technology Resources, Inc. Others may
+ (c) 2004-2009 by Educational Technology Resources, Inc. Others may
also hold copyrights on code in this file. See the CREDITS.txt file
in the top directory of the distribution for details.
@@ -42,7 +42,7 @@
size_t num = res->num_fields();
reserve(num);
- for (int i = 0; i < num; i++) {
+ for (size_t i = 0; i < num; i++) {
std::string p(res->fields().at(i).name());
internal::str_to_lwr(p);
push_back(p);
Modified: trunk/lib/options.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/options.cpp?rev=2561&r1=2560&r2=2561&view=diff
==============================================================================
--- trunk/lib/options.cpp (original)
+++ trunk/lib/options.cpp Thu Aug 13 15:47:32 2009
@@ -1,9 +1,9 @@
/***********************************************************************
options.cpp - Implements the Option class hierarchy.
- Copyright (c) 2007 by Educational Technology Resources, Inc. Others
- may also hold copyrights on code in this file. See the CREDITS
- file in the top directory of the distribution for details.
+ Copyright (c) 2007-2009 by Educational Technology Resources, Inc.
+ Others may also hold copyrights on code in this file. See the
+ CREDITS file in the top directory of the distribution for details.
This file is part of MySQL++.
@@ -326,6 +326,7 @@
cipher_.size() ? cipher_.c_str() : 0) ?
Option::err_NONE : Option::err_api_reject;
#else
+ (void)dbd;
return Option::err_api_limit;
#endif
}
Modified: trunk/lib/options.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/options.h?rev=2561&r1=2560&r2=2561&view=diff
==============================================================================
--- trunk/lib/options.h (original)
+++ trunk/lib/options.h Thu Aug 13 15:47:32 2009
@@ -9,9 +9,9 @@
/// totally out of proprortion to the importance of options.
/***********************************************************************
- Copyright (c) 2007 by Educational Technology Resources, Inc. Others
- may also hold copyrights on code in this file. See the CREDITS
- file in the top directory of the distribution for details.
+ Copyright (c) 2007-2009 by Educational Technology Resources, Inc.
+ Others may also hold copyrights on code in this file. See the
+ CREDITS file in the top directory of the distribution for details.
This file is part of MySQL++.
@@ -63,7 +63,7 @@
err_api_limit, ///< option not supported by underlying C API
err_api_reject, ///< underlying C API returned error when
setting option
err_connected, ///< can't set the given option while connected
- err_disconnected,///< can only set the given option while
connected
+ err_disconnected///< can only set the given option while
connected
};
virtual ~Option() { } ///< Destroy
object
Modified: trunk/ssx/parsev2.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/ssx/parsev2.cpp?rev=2561&r1=2560&r2=2561&view=diff
==============================================================================
--- trunk/ssx/parsev2.cpp (original)
+++ trunk/ssx/parsev2.cpp Thu Aug 13 15:47:32 2009
@@ -54,7 +54,6 @@
{
// For each line in the file, read it in and try to make sense of it
// based on the indent level and the leading verb.
- size_t count = 0;
string line;
bool subdirective;
while (file_.read_line(line, subdirective)) {
@@ -134,6 +133,7 @@
ostringstream o;
o << "unknown accessor style '" << style << '\'';
file.parse_error(o);
+ return unknown;
}
}
@@ -479,6 +479,7 @@
ostringstream o;
o << "unknown option '" << name << '\'';
file.parse_error(o);
+ return 0;
}
}
Modified: trunk/ssx/parsev2.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/ssx/parsev2.h?rev=2561&r1=2560&r2=2561&view=diff
==============================================================================
--- trunk/ssx/parsev2.h (original)
+++ trunk/ssx/parsev2.h Thu Aug 13 15:47:32 2009
@@ -395,6 +395,7 @@
/// each implemented as a subclass, but that's seems excessively
/// OO-dogmatic.
enum Type {
+ unknown, ///< bad style value
found in .ssqls file
camel_case_lower, ///< generate accessors like \c
getX()
camel_case_upper, ///< generate accessors like \c
GetX()
stroustrup ///< generate accessors
like \c get_x()
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits