Author: wyoung
Date: Fri Jan 4 18:12:03 2008
New Revision: 2098
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2098&view=rev
Log:
- Updated VC++ GUI examples to track API changes
- Linking them to _d versions of libraries in debug mode
- Squished all new warnings
Modified:
trunk/README-Visual-C++.txt
trunk/examples/vstudio/mfc/mfc.vcproj
trunk/examples/vstudio/mfc/mfc_dlg.cpp
trunk/examples/vstudio/wforms/MainForm.h
trunk/examples/vstudio/wforms/wforms.vcproj
trunk/lib/common.h
trunk/lib/mystring.h
trunk/lib/sql_buffer.h
Modified: trunk/README-Visual-C++.txt
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/README-Visual-C%2B%2B.txt?rev=2098&r1=2097&r2=2098&view=diff
==============================================================================
--- trunk/README-Visual-C++.txt (original)
+++ trunk/README-Visual-C++.txt Fri Jan 4 18:12:03 2008
@@ -113,9 +113,17 @@
change the 'debug' directory names to 'opt'.
o Under Linker::Input add the following to "Additional
- Dependencies":
+ Dependencies" for the Debug configuration:
+
+ libmysql.lib wsock32.lib mysqlpp_d.lib
+
+ ...and then for the Release configuration:
libmysql.lib wsock32.lib mysqlpp.lib
+
+ This difference is because MySQL++'s Debug DLL and import
+ library have a _d suffix so you can have both installed
+ without conflicts.
You may want to study examples\vstudio\mfc\mfc.vcproj to see
this in action. Note that some of the paths will be different,
@@ -171,9 +179,10 @@
http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx
- You may want to study examples\vstudio\wforms\wforms.vcproj to see
- all this in action. Note that some of the paths will be different,
- because it can use relative paths for mysqlpp.dll.
+ You may want to study examples\vstudio\wforms\wforms.vcproj to
+ see all this in action. Note that some of the paths will be
+ different, because it can use relative paths for mysqlpp_d.dll
+ and mysqlpp.dll.
Working With Bakefile
Modified: trunk/examples/vstudio/mfc/mfc.vcproj
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/vstudio/mfc/mfc.vcproj?rev=2098&r1=2097&r2=2098&view=diff
==============================================================================
--- trunk/examples/vstudio/mfc/mfc.vcproj (original)
+++ trunk/examples/vstudio/mfc/mfc.vcproj Fri Jan 4 18:12:03 2008
@@ -68,7 +68,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="mysqlpp.lib
libmysql.lib"
+ AdditionalDependencies="mysqlpp_d.lib
libmysql.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\Debug,C:\Program Files\MySQL\MySQL
Server 5.0\lib\debug"
GenerateDebugInformation="true"
Modified: trunk/examples/vstudio/mfc/mfc_dlg.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/vstudio/mfc/mfc_dlg.cpp?rev=2098&r1=2097&r2=2098&view=diff
==============================================================================
--- trunk/examples/vstudio/mfc/mfc_dlg.cpp (original)
+++ trunk/examples/vstudio/mfc/mfc_dlg.cpp Fri Jan 4 18:12:03 2008
@@ -152,7 +152,7 @@
// Retrieve a subset of the sample stock table set up by resetdb
mysqlpp::Query query = con.query();
query << "select item from stock";
- mysqlpp::Result res = query.store();
+ mysqlpp::StoreQueryResult res = query.store();
if (res) {
// Display the result set
@@ -169,7 +169,7 @@
else {
// Retreive failed
AddMessage(_T("Failed to get item list:"));
- if (ToUCS2(awcTempBuf, kTempBufSize, query.error().c_str())) {
+ if (ToUCS2(awcTempBuf, kTempBufSize, query.error())) {
AddMessage(awcTempBuf);
}
}
Modified: trunk/examples/vstudio/wforms/MainForm.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/vstudio/wforms/MainForm.h?rev=2098&r1=2097&r2=2098&view=diff
==============================================================================
--- trunk/examples/vstudio/wforms/MainForm.h (original)
+++ trunk/examples/vstudio/wforms/MainForm.h Fri Jan 4 18:12:03 2008
@@ -99,7 +99,7 @@
// Retrieve a subset of the sample stock table set up
by resetdb
mysqlpp::Query query = con.query();
query << "select item from stock";
- mysqlpp::Result res = query.store();
+ mysqlpp::StoreQueryResult res = query.store();
if (res) {
// Display the result set
@@ -114,7 +114,7 @@
else {
// Retreive failed
AddMessage("Failed to get item list:");
- AddMessage(ToUCS2(query.error().c_str()));
+ AddMessage(ToUCS2(query.error()));
}
}
Modified: trunk/examples/vstudio/wforms/wforms.vcproj
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/vstudio/wforms/wforms.vcproj?rev=2098&r1=2097&r2=2098&view=diff
==============================================================================
--- trunk/examples/vstudio/wforms/wforms.vcproj (original)
+++ trunk/examples/vstudio/wforms/wforms.vcproj Fri Jan 4 18:12:03 2008
@@ -59,7 +59,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="mysqlpp.lib
libmysql.lib"
+ AdditionalDependencies="mysqlpp_d.lib
libmysql.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\Debug,C:\Program Files\MySQL\MySQL
Server 5.0\lib\debug"
GenerateDebugInformation="true"
Modified: trunk/lib/common.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/common.h?rev=2098&r1=2097&r2=2098&view=diff
==============================================================================
--- trunk/lib/common.h (original)
+++ trunk/lib/common.h Fri Jan 4 18:12:03 2008
@@ -68,15 +68,17 @@
# define MYSQLPP_HAVE_STD__NOINIT
# endif
+ // Disable complaints about STL data members: VC++ believes
+ // these need to be __declspec(dllexport) for some reason.
+# pragma warning(disable: 4251)
+ // Disable complaint that VC++ doesn't grok throw specs
+# pragma warning(disable: 4290)
// Disable whining about using 'this' as a member initializer
on VC++.
# pragma warning(disable: 4355)
// Disable whining about implicit conversions to bool
# pragma warning(disable: 4800)
// Disable nagging about new "secure" functions like strncpy_s()
# pragma warning(disable: 4996)
- // Disable complaints about STL data members: VC++ believes
- // these need to be __declspec(dllexport) for some reason.
-# pragma warning(disable: 4251)
// Call _snprintf() for VC++ version of snprintf() function
# define snprintf _snprintf
# endif
Modified: trunk/lib/mystring.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/mystring.h?rev=2098&r1=2097&r2=2098&view=diff
==============================================================================
--- trunk/lib/mystring.h (original)
+++ trunk/lib/mystring.h Fri Jan 4 18:12:03 2008
@@ -151,7 +151,8 @@
explicit String(const std::string& str,
mysql_type_info type = mysql_type_info::string_type,
bool is_null = false) :
- buffer_(new SQLBuffer(str.data(), str.length(), type, is_null))
+ buffer_(new SQLBuffer(str.data(), static_cast<size_type>(str.length()),
+ type, is_null))
{
}
@@ -165,7 +166,8 @@
explicit String(const char* str,
mysql_type_info type = mysql_type_info::string_type,
bool is_null = false) :
- buffer_(new SQLBuffer(str, strlen(str), type, is_null))
+ buffer_(new SQLBuffer(str, static_cast<size_type>(strlen(str)),
+ type, is_null))
{
}
@@ -195,7 +197,8 @@
mysql_type_info type = mysql_type_info::string_type,
bool is_null = false)
{
- buffer_ = new SQLBuffer(str.data(), str.length(), type,
is_null);
+ buffer_ = new SQLBuffer(str.data(),
+ static_cast<size_type>(str.length()), type,
is_null);
}
/// \brief Assign a C string to this object
@@ -208,7 +211,8 @@
mysql_type_info type = mysql_type_info::string_type,
bool is_null = false)
{
- buffer_ = new SQLBuffer(str, strlen(str), type, is_null);
+ buffer_ = new SQLBuffer(str,
static_cast<size_type>(strlen(str)),
+ type, is_null);
}
/// \brief Return a character within the string.
@@ -360,7 +364,8 @@
/// \brief Assignment operator, from C++ string
String& operator =(const std::string& rhs)
{
- buffer_ = new SQLBuffer(rhs.data(), rhs.length(),
+ buffer_ = new SQLBuffer(rhs.data(),
+ static_cast<size_type>(rhs.length()),
mysql_type_info::string_type, false);
return *this;
@@ -372,7 +377,8 @@
/// the pointer.
String& operator =(const char* str)
{
- buffer_ = new SQLBuffer(str, strlen(str),
+ buffer_ = new SQLBuffer(str,
+ static_cast<size_type>(strlen(str)),
mysql_type_info::string_type, false);
return *this;
@@ -576,6 +582,11 @@
oprsw(<<, other, conv) \
oprsw(>>, other, conv)
+// Squish more complaints about possible loss of data
+#if defined(MYSQLPP_PLATFORM_VISUAL_CPP)
+# pragma warning(disable: 4244)
+#endif
+
operator_binary(float, double)
operator_binary(double, double)
@@ -588,6 +599,10 @@
operator_binary_int(unsigned int, unsigned long int)
operator_binary_int(unsigned short int, unsigned long int)
operator_binary_int(unsigned long int, unsigned long int)
+
+#if defined(MYSQLPP_PLATFORM_VISUAL_CPP)
+# pragma warning(default: 4244)
+#endif
#if !defined(NO_LONG_LONGS)
operator_binary_int(longlong, longlong)
Modified: trunk/lib/sql_buffer.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/sql_buffer.h?rev=2098&r1=2097&r2=2098&view=diff
==============================================================================
--- trunk/lib/sql_buffer.h (original)
+++ trunk/lib/sql_buffer.h Fri Jan 4 18:12:03 2008
@@ -59,7 +59,9 @@
/// \brief Initialize object as a copy of a C++ string object
SQLBuffer(const std::string& s, mysql_type_info type, bool is_null) :
data_(), length_(), type_(type), is_null_(is_null)
- { replace_buffer(s.data(), s.length()); }
+ {
+ replace_buffer(s.data(), static_cast<size_type>(s.length()));
+ }
/// \brief Destructor
~SQLBuffer() { delete[] data_; }
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits