Skip to content

Commit

Permalink
Fix nearly all warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kwolekr committed May 20, 2013
1 parent 55a97f4 commit d00e8bd
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/collision.cpp
Expand Up @@ -298,7 +298,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
f32 distance = speed_f.getLength();
std::vector<DistanceSortedActiveObject> clientobjects;
c_env->getActiveObjects(pos_f,distance * 1.5,clientobjects);
for (int i=0; i < clientobjects.size(); i++)
for (size_t i=0; i < clientobjects.size(); i++)
{
if ((self == 0) || (self != clientobjects[i].obj)) {
objects.push_back((ActiveObject*)clientobjects[i].obj);
Expand Down
4 changes: 2 additions & 2 deletions src/emerge.h
Expand Up @@ -31,8 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
infostream << "EmergeThread: " x << std::endl; }

class Mapgen;
class MapgenParams;
class MapgenFactory;
struct MapgenParams;
struct MapgenFactory;
class Biome;
class BiomeDefManager;
class EmergeThread;
Expand Down
6 changes: 0 additions & 6 deletions src/environment.cpp
Expand Up @@ -910,7 +910,6 @@ void ServerEnvironment::clearAllObjects()
if(obj->getType() == ACTIVEOBJECT_TYPE_PLAYER)
continue;
u16 id = i->first;
v3f objectpos = obj->getBasePosition();
// Delete static object if block is loaded
if(obj->m_static_exists){
MapBlock *block = m_map->getBlockNoCreateNoEx(obj->m_static_block);
Expand Down Expand Up @@ -1031,8 +1030,6 @@ void ServerEnvironment::step(float dtime)
// Ignore disconnected players
if(player->peer_id == 0)
continue;

v3f playerpos = player->getPosition();

// Move
player->move(dtime, *m_map, 100*BS);
Expand Down Expand Up @@ -2072,8 +2069,6 @@ void ClientEnvironment::step(float dtime)
*/

{
v3f lplayerpos = lplayer->getPosition();

// Apply physics
if(free_move == false && is_climbing == false)
{
Expand Down Expand Up @@ -2197,7 +2192,6 @@ void ClientEnvironment::step(float dtime)
i != m_players.end(); ++i)
{
Player *player = *i;
v3f playerpos = player->getPosition();

/*
Handle non-local players
Expand Down
2 changes: 0 additions & 2 deletions src/guiConfigureWorld.cpp
Expand Up @@ -165,8 +165,6 @@ void GUIConfigureWorld::regenerateGui(v2u32 screensize)
DesiredRect = rect;
recalculateAbsolutePosition(false);

v2s32 size = rect.getSize();

v2s32 topleft = v2s32(10, 10);

/*
Expand Down
2 changes: 0 additions & 2 deletions src/guiCreateWorld.cpp
Expand Up @@ -112,8 +112,6 @@ void GUICreateWorld::regenerateGui(v2u32 screensize)
DesiredRect = rect;
recalculateAbsolutePosition(false);

v2s32 size = rect.getSize();

v2s32 topleft = v2s32(10+80, 10+70);

/*
Expand Down
1 change: 0 additions & 1 deletion src/guiPasswordChange.cpp
Expand Up @@ -95,7 +95,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)

v2s32 size = rect.getSize();
v2s32 topleft_client(40, 0);
v2s32 size_client = size - v2s32(40, 0);

/*
Add stuff
Expand Down
1 change: 0 additions & 1 deletion src/guiVolumeChange.cpp
Expand Up @@ -96,7 +96,6 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)

v2s32 size = rect.getSize();
v2s32 topleft_client(40, 0);
v2s32 size_client = size - v2s32(40, 0);
int volume=(int)(g_settings->getFloat("sound_volume")*100);
/*
Add stuff
Expand Down
10 changes: 5 additions & 5 deletions src/map.cpp
Expand Up @@ -288,10 +288,10 @@ void Map::unspreadLight(enum LightBank bank,
continue;

// Calculate relative position in block
v3s16 relpos = pos - blockpos_last * MAP_BLOCKSIZE;
//v3s16 relpos = pos - blockpos_last * MAP_BLOCKSIZE;

// Get node straight from the block
MapNode n = block->getNode(relpos);
//MapNode n = block->getNode(relpos);

u8 oldlight = j->second;

Expand Down Expand Up @@ -937,7 +937,7 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
*/

v3s16 toppos = p + v3s16(0,1,0);
v3s16 bottompos = p + v3s16(0,-1,0);
//v3s16 bottompos = p + v3s16(0,-1,0);

bool node_under_sunlight = true;
std::set<v3s16> light_sources;
Expand Down Expand Up @@ -1246,7 +1246,7 @@ void Map::removeNodeAndUpdate(v3s16 p,
// Get the brightest neighbour node and propagate light from it
v3s16 n2p = getBrightestNeighbour(bank, p);
try{
MapNode n2 = getNode(n2p);
//MapNode n2 = getNode(n2p);
lightNeighbors(bank, n2p, modified_blocks);
}
catch(InvalidPositionException &e)
Expand Down Expand Up @@ -2831,7 +2831,7 @@ ServerMapSector * ServerMap::createSector(v2s16 p2d)
sector = new ServerMapSector(this, p2d, m_gamedef);

// Sector position on map in nodes
v2s16 nodepos2d = p2d * MAP_BLOCKSIZE;
//v2s16 nodepos2d = p2d * MAP_BLOCKSIZE;

/*
Insert to container
Expand Down
2 changes: 0 additions & 2 deletions src/mapgen_v6.cpp
Expand Up @@ -375,8 +375,6 @@ void MapgenV6::makeChunk(BlockMakeData *data) {
v3s16 blockpos = data->blockpos_requested;
v3s16 blockpos_min = data->blockpos_min;
v3s16 blockpos_max = data->blockpos_max;
v3s16 blockpos_full_min = blockpos_min - v3s16(1,1,1);
v3s16 blockpos_full_max = blockpos_max + v3s16(1,1,1);

// Area of central chunk
node_min = blockpos_min*MAP_BLOCKSIZE;
Expand Down
2 changes: 0 additions & 2 deletions src/mapgen_v7.cpp
Expand Up @@ -152,8 +152,6 @@ void MapgenV7::makeChunk(BlockMakeData *data) {

v3s16 blockpos_min = data->blockpos_min;
v3s16 blockpos_max = data->blockpos_max;
v3s16 blockpos_full_min = blockpos_min - v3s16(1, 1, 1);
v3s16 blockpos_full_max = blockpos_max + v3s16(1, 1, 1);
node_min = blockpos_min * MAP_BLOCKSIZE;
node_max = (blockpos_max + v3s16(1, 1, 1)) * MAP_BLOCKSIZE - v3s16(1, 1, 1);
full_node_min = (blockpos_min - 1) * MAP_BLOCKSIZE;
Expand Down
2 changes: 1 addition & 1 deletion src/player.h
Expand Up @@ -87,7 +87,7 @@ class Map;
class IGameDef;
struct CollisionInfo;
class PlayerSAO;
class HudElement;
struct HudElement;

class Player
{
Expand Down
3 changes: 1 addition & 2 deletions src/scriptapi_env.cpp
Expand Up @@ -227,7 +227,6 @@ int EnvRef::l_get_node_light(lua_State *L)
time_of_day = 24000.0 * lua_tonumber(L, 3);
time_of_day %= 24000;
u32 dnr = time_to_daynight_ratio(time_of_day, true);
MapNode n = env->getMap().getNodeNoEx(pos);
try{
MapNode n = env->getMap().getNode(pos);
INodeDefManager *ndef = env->getGameDef()->ndef();
Expand Down Expand Up @@ -373,7 +372,7 @@ int EnvRef::l_add_item(lua_State *L)
ServerEnvironment *env = o->m_env;
if(env == NULL) return 0;
// pos
v3f pos = checkFloatPos(L, 2);
//v3f pos = checkFloatPos(L, 2);
// item
ItemStack item = read_item(L, 3);
if(item.empty() || !item.isKnown(get_server(L)->idef()))
Expand Down
2 changes: 1 addition & 1 deletion src/scriptapi_types.cpp
Expand Up @@ -147,7 +147,7 @@ v3s16 check_v3s16(lua_State *L, int index)

video::SColor readARGB8(lua_State *L, int index)
{
video::SColor color;
video::SColor color(0);
luaL_checktype(L, index, LUA_TTABLE);
lua_getfield(L, index, "a");
if(lua_isnumber(L, -1))
Expand Down
2 changes: 1 addition & 1 deletion src/test.cpp
Expand Up @@ -464,7 +464,7 @@ struct TestCompress: public TestBase
std::string str_decompressed = os_decompressed.str();
UTEST(str_decompressed.size() == data_in.size(), "Output size not"
" equal (output: %u, input: %u)",
str_decompressed.size(), data_in.size());
(unsigned int)str_decompressed.size(), (unsigned int)data_in.size());
for(u32 i=0; i<size && i<str_decompressed.size(); i++){
UTEST(str_decompressed[i] == data_in[i],
"index out[%i]=%i differs from in[%i]=%i",
Expand Down
2 changes: 1 addition & 1 deletion src/voxel.cpp
Expand Up @@ -264,7 +264,7 @@ void VoxelManipulator::clearFlag(u8 flags)
// 0-1ms on moderate area
TimeTaker timer("clearFlag", &clearflag_time);

v3s16 s = m_area.getExtent();
//v3s16 s = m_area.getExtent();

/*dstream<<"clearFlag clearing area of size "
<<""<<s.X<<"x"<<s.Y<<"x"<<s.Z<<""
Expand Down

0 comments on commit d00e8bd

Please sign in to comment.