1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Modernize src/c* src/d* and src/e* files (#6263)

* Modernize src/c* src/d* and src/e* files

* default operator
* redundant init
* delete default constructors on CraftDefinition childs (never used)
* fix some missing init values
* const ref fix reported by clang-tidy
* ranged-based for loops
* simple conditions & returns
* empty stl function instead of size
* emplace_back stl function instead of push_back + construct temp obj
* auto for some iterators
* code style fixes
* c++ stl headers instead of C stl headers (stdio.h -> cstdio)
This commit is contained in:
Loïc Blot 2017-08-17 23:02:50 +02:00 committed by GitHub
parent 921151d97a
commit 13e995b811
25 changed files with 298 additions and 343 deletions

View file

@ -21,8 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "porting.h"
#include "debug.h"
#include "exceptions.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <map>
#include <sstream>
@ -110,7 +110,7 @@ void DebugStack::print(FILE *file, bool everything)
os.str().c_str());
for (int i = 0; i < stack_max_i; i++) {
if (i == stack_i && everything == false)
if (i == stack_i && !everything)
break;
if (i < stack_i)
@ -128,7 +128,7 @@ void DebugStack::print(std::ostream &os, bool everything)
os<<"DEBUG STACK FOR THREAD "<<thread_id<<": "<<std::endl;
for(int i = 0; i < stack_max_i; i++) {
if(i == stack_i && everything == false)
if(i == stack_i && !everything)
break;
if (i < stack_i)
@ -193,7 +193,7 @@ DebugStacker::~DebugStacker()
{
MutexAutoLock lock(g_debug_stacks_mutex);
if (m_overflowed == true)
if (m_overflowed)
return;
m_stack->stack_i--;