[colobot] 227/377: Fixed some errors reported by colobot-lint

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:34:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 048534e89d8f0c946ff55cac86678576c2a9d0be
Author: krzys-h <krzys_h at interia.pl>
Date:   Sat Jan 23 20:58:03 2016 +0100

    Fixed some errors reported by colobot-lint
---
 src/CBot/CBotDebug.cpp                     | 3 ++-
 src/CBot/CBotEnums.h                       | 3 ++-
 src/CBot/CBotExternalCall.cpp              | 2 +-
 src/CBot/CBotToken.cpp                     | 3 ++-
 src/CBot/CBotUtils.h                       | 6 ++++--
 src/CBot/stdlib/FileFunctions.cpp          | 3 ++-
 src/script/scriptfunc.cpp                  | 2 +-
 test/unit/CBot/CBotToken_test.cpp          | 5 +++--
 test/unit/CBot/{CBot.cpp => CBot_test.cpp} | 5 +++--
 test/unit/CMakeLists.txt                   | 2 +-
 10 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/CBot/CBotDebug.cpp b/src/CBot/CBotDebug.cpp
index fc8c874..986da85 100644
--- a/src/CBot/CBotDebug.cpp
+++ b/src/CBot/CBotDebug.cpp
@@ -55,7 +55,8 @@ void CBotDebug::DumpCompiledProgram(CBotProgram* program)
     }
 
     std::set<CBotInstr*> finished;
-    std::function<void(CBotInstr*)> DumpInstr = [&](CBotInstr* instr) {
+    std::function<void(CBotInstr*)> DumpInstr = [&](CBotInstr* instr)
+    {
         if (finished.find(instr) != finished.end()) return;
         finished.insert(instr);
 
diff --git a/src/CBot/CBotEnums.h b/src/CBot/CBotEnums.h
index 8f6d691..5d9c161 100644
--- a/src/CBot/CBotEnums.h
+++ b/src/CBot/CBotEnums.h
@@ -170,7 +170,8 @@ enum TokenId
 /**
  * \brief Types of tokens
  */
-enum TokenType {
+enum TokenType
+{
     TokenTypNone = 0,
     TokenTypKeyWord = 1, //!< keyword of the language (see TokenKeyWord)
     TokenTypNum = 2,     //!< number
diff --git a/src/CBot/CBotExternalCall.cpp b/src/CBot/CBotExternalCall.cpp
index 54ab787..e0ebd17 100644
--- a/src/CBot/CBotExternalCall.cpp
+++ b/src/CBot/CBotExternalCall.cpp
@@ -168,4 +168,4 @@ bool CBotExternalCallDefault::Run(CBotVar* thisVar, CBotStack* pStack)
     return true;
 }
 
-}
\ No newline at end of file
+}
diff --git a/src/CBot/CBotToken.cpp b/src/CBot/CBotToken.cpp
index aff8431..13ac888 100644
--- a/src/CBot/CBotToken.cpp
+++ b/src/CBot/CBotToken.cpp
@@ -117,7 +117,8 @@ static const std::map<TokenId, const std::string> KEYWORDS = {
     {TX_NAN,        "not a number"}
 };
 
-namespace {
+namespace
+{
 static const std::string emptyString = "";
 }
 const std::string& LoadString(TokenId id)
diff --git a/src/CBot/CBotUtils.h b/src/CBot/CBotUtils.h
index a56a646..b19d61d 100644
--- a/src/CBot/CBotUtils.h
+++ b/src/CBot/CBotUtils.h
@@ -96,7 +96,8 @@ long GetNumInt(const std::string& str);
  */
 float GetNumFloat(const std::string& str);
 
-template<typename T> class CBotLinkedList {
+template<typename T> class CBotLinkedList
+{
 public:
     /**
      * \brief Destructor. Be careful, destroys the whole linked list!
@@ -134,7 +135,8 @@ protected:
     T* m_next = nullptr;
 };
 
-template<typename T> class CBotDoublyLinkedList {
+template<typename T> class CBotDoublyLinkedList
+{
 public:
     /**
      * \brief Destructor. Be careful, destroys the whole linked list!
diff --git a/src/CBot/stdlib/FileFunctions.cpp b/src/CBot/stdlib/FileFunctions.cpp
index ebc52e6..43ba4bf 100644
--- a/src/CBot/stdlib/FileFunctions.cpp
+++ b/src/CBot/stdlib/FileFunctions.cpp
@@ -28,7 +28,8 @@
 namespace CBot
 {
 
-namespace {
+namespace
+{
 std::unique_ptr<CBotFileAccessHandler> g_fileHandler;
 std::unordered_map<int, std::unique_ptr<CBotFile>> g_files;
 int g_nextFileId = 1;
diff --git a/src/script/scriptfunc.cpp b/src/script/scriptfunc.cpp
index 4e16d40..39f8b0d 100644
--- a/src/script/scriptfunc.cpp
+++ b/src/script/scriptfunc.cpp
@@ -3448,4 +3448,4 @@ void CScriptFunctions::DestroyObjectVar(CBotVar* botVar, bool permanent)
 bool CScriptFunctions::CheckOpenFiles()
 {
     return CBotFileColobot::m_numFilesOpen > 0;
-}
\ No newline at end of file
+}
diff --git a/test/unit/CBot/CBotToken_test.cpp b/test/unit/CBot/CBotToken_test.cpp
index 517cfb5..883a759 100644
--- a/test/unit/CBot/CBotToken_test.cpp
+++ b/test/unit/CBot/CBotToken_test.cpp
@@ -51,7 +51,8 @@ protected:
         CBotToken* token = tokens.get()->GetNext(); // TODO: why do we always have to skip the first one :/
         ASSERT_TRUE(token != nullptr);
         unsigned int i = 0;
-        do {
+        do
+        {
             ASSERT_LT(i, data.size()) << "too many tokens processed";
 
             TokenTest correct = data[i];
@@ -120,4 +121,4 @@ TEST_F(CBotTokenUT, BasicProgram)
         {";",           ID_SEP},
         {"}",           ID_CLBLK},
     });
-}
\ No newline at end of file
+}
diff --git a/test/unit/CBot/CBot.cpp b/test/unit/CBot/CBot_test.cpp
similarity index 99%
rename from test/unit/CBot/CBot.cpp
rename to test/unit/CBot/CBot_test.cpp
index 23c0bb4..f7b2539 100644
--- a/test/unit/CBot/CBot.cpp
+++ b/test/unit/CBot/CBot_test.cpp
@@ -39,7 +39,8 @@ public:
     }
 
 private:
-    class CBotTestFail : public std::runtime_error {
+    class CBotTestFail : public std::runtime_error
+    {
     public:
         CBotTestFail(const std::string& message) : runtime_error(message)
         {
@@ -982,4 +983,4 @@ TEST_F(CBotUT, DISABLED_TestNANParam_Issue642)
         "    ASSERT(test(nan) == nan);\n"
         "}\n"
     );
-}
\ No newline at end of file
+}
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index cbf6956..446834f 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -10,7 +10,7 @@ set(UT_SOURCES
     main.cpp
     app/app_test.cpp
     CBot/CBotToken_test.cpp
-    CBot/CBot.cpp
+    CBot/CBot_test.cpp
     common/config_file_test.cpp
     graphics/engine/lightman_test.cpp
     math/func_test.cpp

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list