diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-18 18:14:28 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-18 18:14:28 +0200 |
commit | 1fd810c8cc2d166602374cf898b8f86e42e651e1 (patch) | |
tree | 64a05aeabca70ddc255e5a970ec25ec3a4f5d1a8 /lib/Plugins/Kerneloops.cpp | |
parent | 64be7b89afc0822cf24aeeec588ff5f5af5fe8b4 (diff) | |
download | abrt-1fd810c8cc2d166602374cf898b8f86e42e651e1.tar.gz abrt-1fd810c8cc2d166602374cf898b8f86e42e651e1.tar.xz abrt-1fd810c8cc2d166602374cf898b8f86e42e651e1.zip |
remove a few #include <iostream>'s
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Plugins/Kerneloops.cpp')
-rw-r--r-- | lib/Plugins/Kerneloops.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/Plugins/Kerneloops.cpp b/lib/Plugins/Kerneloops.cpp index 8e34392b..e01bb426 100644 --- a/lib/Plugins/Kerneloops.cpp +++ b/lib/Plugins/Kerneloops.cpp @@ -24,38 +24,38 @@ * Arjan van de Ven <arjan@linux.intel.com> */ +#include "abrtlib.h" #include "Kerneloops.h" #include "DebugDump.h" #include "ABRTException.h" #include "CommLayerInner.h" -#include <sstream> - #define FILENAME_KERNELOOPS "kerneloops" std::string CAnalyzerKerneloops::GetLocalUUID(const std::string& pDebugDumpDir) { - update_client(_("Getting local/global universal unique identification...")); + log(_("Getting local universal unique identification")); - std::string m_sOops; - std::stringstream m_sHash; - CDebugDump m_pDebugDump; - m_pDebugDump.Open(pDebugDumpDir); - m_pDebugDump.LoadText(FILENAME_KERNELOOPS, m_sOops); - m_pDebugDump.Close(); + std::string oops; + { + CDebugDump dd; + dd.Open(pDebugDumpDir); + dd.LoadText(FILENAME_KERNELOOPS, oops); + } /* An algorithm proposed by Donald E. Knuth in The Art Of Computer * Programming Volume 3, under the topic of sorting and search * chapter 6.4. */ - unsigned int m_nHash = static_cast<unsigned int>(m_sOops.length()); - for(std::size_t i = 0; i < m_sOops.length(); i++) + unsigned len = oops.length(); + unsigned hash = len; + for (unsigned i = 0; i < len; i++) { - m_nHash = ((m_nHash << 5) ^ (m_nHash >> 27)) ^ m_sOops[i]; + hash = ((hash << 5) ^ (hash >> 27)) ^ oops[i]; } - m_sHash << (m_nHash & 0x7FFFFFFF); + hash &= 0x7FFFFFFF; - return m_sHash.str(); + return to_string(hash); } std::string CAnalyzerKerneloops::GetGlobalUUID(const std::string& pDebugDumpDir) |