← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2763: Another attempt at atomics (time to retire?)

 

------------------------------------------------------------
revno: 2763
committer: Jacek Sieka <arnetheduck@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Tue 2011-12-27 22:24:13 +0100
message:
  Another attempt at atomics (time to retire?)
modified:
  dcpp/QueueManager.cpp
  dcpp/atomic.h


--
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/QueueManager.cpp'
--- dcpp/QueueManager.cpp	2011-12-27 15:21:02 +0000
+++ dcpp/QueueManager.cpp	2011-12-27 21:24:13 +0000
@@ -731,7 +731,7 @@
 	{
 		Lock l(cs);
 
-		DirectoryItem::DirectoryPair dp = directories.equal_range(aUser);
+		auto dp = directories.equal_range(aUser);
 
 		for(auto i = dp.first; i != dp.second; ++i) {
 			if(Util::stricmp(aTarget.c_str(), i->second->getName().c_str()) == 0)
@@ -1529,6 +1529,7 @@
 	return onlineSources;
 }
 
+static const string sDownloads = "Downloads";
 static const string sDownload = "Download";
 static const string sTempTarget = "TempTarget";
 static const string sTarget = "Target";
@@ -1536,8 +1537,6 @@
 static const string sDownloaded = "Downloaded";
 static const string sPriority = "Priority";
 static const string sSource = "Source";
-static const string sNick = "Nick";
-static const string sDirectory = "Directory";
 static const string sAdded = "Added";
 static const string sTTH = "TTH";
 static const string sCID = "CID";
@@ -1547,7 +1546,7 @@
 
 void QueueLoader::startTag(const string& name, StringPairList& attribs, bool simple) {
 	QueueManager* qm = QueueManager::getInstance();
-	if(!inDownloads && name == "Downloads") {
+	if(!inDownloads && name == sDownloads) {
 		inDownloads = true;
 	} else if(inDownloads) {
 		if(cur == NULL && name == sDownload) {
@@ -1619,7 +1618,7 @@
 	if(inDownloads) {
 		if(name == sDownload) {
 			cur = NULL;
-		} else if(name == "Downloads") {
+		} else if(name == sDownloads) {
 			inDownloads = false;
 		}
 	}

=== modified file 'dcpp/atomic.h'
--- dcpp/atomic.h	2011-12-27 20:06:53 +0000
+++ dcpp/atomic.h	2011-12-27 21:24:13 +0000
@@ -21,9 +21,9 @@
 
 // GCC 4.6 and below has issues with atomic - see https://bugs.launchpad.net/dcplusplus/+bug/735512
 // MSVC 10 doesn't have atomic at all
-#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) || defined(_MSC_VER)
+#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)) || defined(_MSC_VER)
 
-#include <boost/atomic/atomic.h>
+#include <boost/atomic.hpp>
 
 namespace dcpp
 {