Explorar o código

Apply suggestions from code review

Co-authored-by: Nordsoft91 <[email protected]>
Andrey Filipenkov %!s(int64=3) %!d(string=hai) anos
pai
achega
9f46bf5bff
Modificáronse 5 ficheiros con 7 adicións e 10 borrados
  1. 1 1
      client/lobby/SelectionTab.h
  2. 1 1
      lib/CThreadHelper.cpp
  3. 4 4
      lib/JsonNode.cpp
  4. 0 3
      lib/StartInfo.h
  5. 1 1
      server/CVCMIServer.cpp

+ 1 - 1
client/lobby/SelectionTab.h

@@ -90,7 +90,7 @@ private:
 	std::shared_ptr<CLabel> labelTabTitle;
 	std::shared_ptr<CLabel> labelMapSizes;
 	ESelectionScreen tabType;
-    Rect inputNameRect;
+	Rect inputNameRect;
 
 	void parseMaps(const std::unordered_set<ResourceID> & files);
 	void parseSaves(const std::unordered_set<ResourceID> & files);

+ 1 - 1
lib/CThreadHelper.cpp

@@ -87,7 +87,7 @@ void setThreadName(const std::string &name)
 #elif defined(__linux__)
 	prctl(PR_SET_NAME, name.c_str(), 0, 0, 0);
 #elif defined(VCMI_APPLE)
-    pthread_setname_np(name.c_str());
+	pthread_setname_np(name.c_str());
 #endif
 }
 

+ 4 - 4
lib/JsonNode.cpp

@@ -27,7 +27,7 @@ namespace
 template<typename Node>
 Node & resolvePointer(Node & in, const std::string & pointer)
 {
-	if (pointer.empty())
+	if(pointer.empty())
 		return in;
 	assert(pointer[0] == '/');
 
@@ -36,12 +36,12 @@ Node & resolvePointer(Node & in, const std::string & pointer)
 	std::string entry = pointer.substr(1, splitPos - 1);
 	std::string remainer = splitPos == std::string::npos ? "" : pointer.substr(splitPos);
 
-	if (in.getType() == VCMI_LIB_WRAP_NAMESPACE(JsonNode)::JsonType::DATA_VECTOR)
+	if(in.getType() == VCMI_LIB_WRAP_NAMESPACE(JsonNode)::JsonType::DATA_VECTOR)
 	{
-		if (entry.find_first_not_of("0123456789") != std::string::npos) // non-numbers in string
+		if(entry.find_first_not_of("0123456789") != std::string::npos) // non-numbers in string
 			throw std::runtime_error("Invalid Json pointer");
 
-		if (entry.size() > 1 && entry[0] == '0') // leading zeros are not allowed
+		if(entry.size() > 1 && entry[0] == '0') // leading zeros are not allowed
 			throw std::runtime_error("Invalid Json pointer");
 
 		size_t index = boost::lexical_cast<size_t>(entry);

+ 0 - 3
lib/StartInfo.h

@@ -177,8 +177,5 @@ struct DLL_LINKAGE LobbyInfo : public LobbyState
 	TeamID getPlayerTeamId(PlayerColor color);
 };
 
-class ExceptionMapMissing : public std::exception {};
-class ExceptionNoHuman : public std::exception {};
-class ExceptionNoTemplate : public std::exception {};
 
 VCMI_LIB_NAMESPACE_END

+ 1 - 1
server/CVCMIServer.cpp

@@ -927,7 +927,7 @@ int main(int argc, char * argv[])
 	logConfig.configureDefault();
 	logGlobal->info(SERVER_NAME);
 
-    boost::program_options::variables_map opts;
+	boost::program_options::variables_map opts;
 	handleCommandOptions(argc, argv, opts);
 	preinitDLL(console);
 	settings.init();