linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06307
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3142: fix some warnings
------------------------------------------------------------
revno: 3142
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2012-11-23 20:54:06 +0100
message:
fix some warnings
added:
test/testtext.cpp
modified:
dcpp/HttpDownload.cpp
dcpp/Text.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/HttpDownload.cpp'
--- dcpp/HttpDownload.cpp 2012-10-20 16:10:39 +0000
+++ dcpp/HttpDownload.cpp 2012-11-23 19:54:06 +0000
@@ -23,8 +23,7 @@
HttpDownload::HttpDownload(const string& address, CompletionFunc f, bool coralize) :
c(coralize),
-f(f),
-buf("")
+f(f)
{
c.addListener(this);
c.downloadFile(address);
@@ -32,8 +31,7 @@
HttpDownload::HttpDownload(const string& address, const StringMap& data, CompletionFunc f, bool coralize) :
c(coralize),
-f(f),
-buf("")
+f(f)
{
c.addListener(this);
c.postData(address, data);
=== modified file 'dcpp/Text.cpp'
--- dcpp/Text.cpp 2012-03-03 19:33:45 +0000
+++ dcpp/Text.cpp 2012-11-23 19:54:06 +0000
@@ -270,9 +270,9 @@
wchar_t toLower(wchar_t c) noexcept {
#ifdef _WIN32
- return static_cast<wchar_t>(reinterpret_cast<ptrdiff_t>(CharLowerW((LPWSTR)c)));
+ return *CharLowerW(&c);
#else
- return (wchar_t)towlower(c);
+ return (wchar_t)towlower(c);
#endif
}
=== added file 'test/testtext.cpp'
--- test/testtext.cpp 1970-01-01 00:00:00 +0000
+++ test/testtext.cpp 2012-11-23 19:54:06 +0000
@@ -0,0 +1,15 @@
+#include "testbase.h"
+
+#include <dcpp/Text.h>
+
+using namespace dcpp;
+
+TEST(testtext, test_tolower)
+{
+ Text::initialize();
+
+ ASSERT_EQ("abcd1", Text::toLower("ABCd1"));
+ ASSERT_EQ(_T("abcd1"), Text::toLower(_T("ABCd1")));
+
+ ASSERT_EQ('a', Text::toLower('A'));
+}