From 9d9bc96bce4b03fc5c6a70e7e0c3e30d15fcffab Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Sun, 14 Sep 2014 22:54:27 +0200 Subject: [PATCH] cleanup warnings --- alib2algo/src/compare/string/CyclicStringCompare.cpp | 9 +++++---- alib2algo/src/compare/string/CyclicStringCompare.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/alib2algo/src/compare/string/CyclicStringCompare.cpp b/alib2algo/src/compare/string/CyclicStringCompare.cpp index 9c15baa629..0e8fc8b879 100644 --- a/alib2algo/src/compare/string/CyclicStringCompare.cpp +++ b/alib2algo/src/compare/string/CyclicStringCompare.cpp @@ -2,7 +2,7 @@ * CyclicStringCompare.cpp * * Created on: Oct 9, 2014 - * Author: RadomĂr Polcáh */ + * Author: Radomir Polach */ #include "CyclicStringCompare.h" @@ -11,7 +11,7 @@ namespace compare { bool CyclicStringCompare::equals(const string::LinearString& u, const string::LinearString& v) { int n = (int)u.getContent().size(); int i = -1, j = -1, k; - if (n != v.getContent().size()) return false; + if (n != (int) v.getContent().size()) return false; while(i < n - 1 && j < n - 1) { @@ -24,7 +24,7 @@ bool CyclicStringCompare::equals(const string::LinearString& u, const string::Li } int CyclicStringCompare::compare(const string::LinearString& u, const string::LinearString& v) { - int n = (int)u.getContent().size(), m = (int)v.getContent().size(); + int n = (int) u.getContent().size(), m = (int)v.getContent().size(); int i = -1, j = -1, k; bool last = 0; @@ -33,7 +33,8 @@ int CyclicStringCompare::compare(const string::LinearString& u, const string::Li k = 1; while(k <= n && u.getContent()[(i + k) % n] == v.getContent()[(j + k) % m]) k++; if (k > n) return 0; - if (last = u.getContent()[(i + k) % n] > v.getContent()[(j + k) % m]) i += k; else j += k; + last = u.getContent()[(i + k) % n] > v.getContent()[(j + k) % m]; + if (last) i += k; else j += k; } return last ? 1 : - 1; } diff --git a/alib2algo/src/compare/string/CyclicStringCompare.h b/alib2algo/src/compare/string/CyclicStringCompare.h index 5b8cb14518..18e0624321 100644 --- a/alib2algo/src/compare/string/CyclicStringCompare.h +++ b/alib2algo/src/compare/string/CyclicStringCompare.h @@ -2,7 +2,7 @@ * CyclicStringCompare.h * * Created on: Oct 14, 2014 - * Author: RadomĂr Polách + * Author: Radomir Polach */ #ifndef CYCLIC_STRING_COMPARE_H_ -- GitLab