mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	Fix 5 issues reported by PVS studio
* src/sky.cpp 146 warn V519 The 'suncolor_f.r' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 142, 146. * src/sky.cpp 147 warn V519 The 'suncolor_f.g' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 143, 147. * src/sky.cpp 148 warn V519 The 'suncolor_f.b' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 144, 148. * src/threading/thread.cpp 63 err V730 Not all members of a class are initialized inside the constructor. Consider inspecting: m_thread_obj. * src/server.cpp 3243 err V595 The 'log' pointer was utilized before it was verified against nullptr. Check lines: 3243, 3258.
This commit is contained in:
		@@ -3237,7 +3237,8 @@ bool Server::rollbackRevertActions(const std::list<RollbackAction> &actions,
 | 
			
		||||
	ServerMap *map = (ServerMap*)(&m_env->getMap());
 | 
			
		||||
 | 
			
		||||
	// Fail if no actions to handle
 | 
			
		||||
	if(actions.empty()){
 | 
			
		||||
	if (actions.empty()) {
 | 
			
		||||
		assert(log);
 | 
			
		||||
		log->push_back("Nothing to do.");
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -141,9 +141,9 @@ void Sky::render()
 | 
			
		||||
		suncolor_f.g = MYMAX(0.3, MYMIN(1.0, 0.7 + m_time_brightness * 0.5));
 | 
			
		||||
		suncolor_f.b = MYMAX(0.0, m_brightness * 0.95);
 | 
			
		||||
		video::SColorf suncolor2_f(1, 1, 1, 1);
 | 
			
		||||
		suncolor_f.r = 1;
 | 
			
		||||
		suncolor_f.g = MYMAX(0.3, MYMIN(1.0, 0.85 + m_time_brightness * 0.5));
 | 
			
		||||
		suncolor_f.b = MYMAX(0.0, m_brightness);
 | 
			
		||||
		suncolor2_f.r = 1;
 | 
			
		||||
		suncolor2_f.g = MYMAX(0.3, MYMIN(1.0, 0.85 + m_time_brightness * 0.5));
 | 
			
		||||
		suncolor2_f.b = MYMAX(0.0, m_brightness);
 | 
			
		||||
 | 
			
		||||
		float moonsize = 0.04;
 | 
			
		||||
		video::SColorf mooncolor_f(0.50, 0.57, 0.65, 1);
 | 
			
		||||
 
 | 
			
		||||
@@ -152,7 +152,7 @@ private:
 | 
			
		||||
	std::mutex m_mutex;
 | 
			
		||||
	std::mutex m_start_finished_mutex;
 | 
			
		||||
 | 
			
		||||
	std::thread *m_thread_obj;
 | 
			
		||||
	std::thread *m_thread_obj = nullptr;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef _AIX
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user