Skip to content

Commit d00e8bd

Browse files
committedMay 20, 2013
Fix nearly all warnings
1 parent 55a97f4 commit d00e8bd

15 files changed

+13
-30
lines changed
 

‎src/collision.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
298298
f32 distance = speed_f.getLength();
299299
std::vector<DistanceSortedActiveObject> clientobjects;
300300
c_env->getActiveObjects(pos_f,distance * 1.5,clientobjects);
301-
for (int i=0; i < clientobjects.size(); i++)
301+
for (size_t i=0; i < clientobjects.size(); i++)
302302
{
303303
if ((self == 0) || (self != clientobjects[i].obj)) {
304304
objects.push_back((ActiveObject*)clientobjects[i].obj);

‎src/emerge.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3131
infostream << "EmergeThread: " x << std::endl; }
3232

3333
class Mapgen;
34-
class MapgenParams;
35-
class MapgenFactory;
34+
struct MapgenParams;
35+
struct MapgenFactory;
3636
class Biome;
3737
class BiomeDefManager;
3838
class EmergeThread;

‎src/environment.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,6 @@ void ServerEnvironment::clearAllObjects()
910910
if(obj->getType() == ACTIVEOBJECT_TYPE_PLAYER)
911911
continue;
912912
u16 id = i->first;
913-
v3f objectpos = obj->getBasePosition();
914913
// Delete static object if block is loaded
915914
if(obj->m_static_exists){
916915
MapBlock *block = m_map->getBlockNoCreateNoEx(obj->m_static_block);
@@ -1031,8 +1030,6 @@ void ServerEnvironment::step(float dtime)
10311030
// Ignore disconnected players
10321031
if(player->peer_id == 0)
10331032
continue;
1034-
1035-
v3f playerpos = player->getPosition();
10361033

10371034
// Move
10381035
player->move(dtime, *m_map, 100*BS);
@@ -2072,8 +2069,6 @@ void ClientEnvironment::step(float dtime)
20722069
*/
20732070

20742071
{
2075-
v3f lplayerpos = lplayer->getPosition();
2076-
20772072
// Apply physics
20782073
if(free_move == false && is_climbing == false)
20792074
{
@@ -2197,7 +2192,6 @@ void ClientEnvironment::step(float dtime)
21972192
i != m_players.end(); ++i)
21982193
{
21992194
Player *player = *i;
2200-
v3f playerpos = player->getPosition();
22012195

22022196
/*
22032197
Handle non-local players

‎src/guiConfigureWorld.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ void GUIConfigureWorld::regenerateGui(v2u32 screensize)
165165
DesiredRect = rect;
166166
recalculateAbsolutePosition(false);
167167

168-
v2s32 size = rect.getSize();
169-
170168
v2s32 topleft = v2s32(10, 10);
171169

172170
/*

‎src/guiCreateWorld.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ void GUICreateWorld::regenerateGui(v2u32 screensize)
112112
DesiredRect = rect;
113113
recalculateAbsolutePosition(false);
114114

115-
v2s32 size = rect.getSize();
116-
117115
v2s32 topleft = v2s32(10+80, 10+70);
118116

119117
/*

‎src/guiPasswordChange.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
9595

9696
v2s32 size = rect.getSize();
9797
v2s32 topleft_client(40, 0);
98-
v2s32 size_client = size - v2s32(40, 0);
9998

10099
/*
101100
Add stuff

‎src/guiVolumeChange.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)
9696

9797
v2s32 size = rect.getSize();
9898
v2s32 topleft_client(40, 0);
99-
v2s32 size_client = size - v2s32(40, 0);
10099
int volume=(int)(g_settings->getFloat("sound_volume")*100);
101100
/*
102101
Add stuff

‎src/map.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ void Map::unspreadLight(enum LightBank bank,
288288
continue;
289289

290290
// Calculate relative position in block
291-
v3s16 relpos = pos - blockpos_last * MAP_BLOCKSIZE;
291+
//v3s16 relpos = pos - blockpos_last * MAP_BLOCKSIZE;
292292

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

296296
u8 oldlight = j->second;
297297

@@ -937,7 +937,7 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
937937
*/
938938

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

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

28332833
// Sector position on map in nodes
2834-
v2s16 nodepos2d = p2d * MAP_BLOCKSIZE;
2834+
//v2s16 nodepos2d = p2d * MAP_BLOCKSIZE;
28352835

28362836
/*
28372837
Insert to container

‎src/mapgen_v6.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,6 @@ void MapgenV6::makeChunk(BlockMakeData *data) {
375375
v3s16 blockpos = data->blockpos_requested;
376376
v3s16 blockpos_min = data->blockpos_min;
377377
v3s16 blockpos_max = data->blockpos_max;
378-
v3s16 blockpos_full_min = blockpos_min - v3s16(1,1,1);
379-
v3s16 blockpos_full_max = blockpos_max + v3s16(1,1,1);
380378

381379
// Area of central chunk
382380
node_min = blockpos_min*MAP_BLOCKSIZE;

‎src/mapgen_v7.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ void MapgenV7::makeChunk(BlockMakeData *data) {
152152

153153
v3s16 blockpos_min = data->blockpos_min;
154154
v3s16 blockpos_max = data->blockpos_max;
155-
v3s16 blockpos_full_min = blockpos_min - v3s16(1, 1, 1);
156-
v3s16 blockpos_full_max = blockpos_max + v3s16(1, 1, 1);
157155
node_min = blockpos_min * MAP_BLOCKSIZE;
158156
node_max = (blockpos_max + v3s16(1, 1, 1)) * MAP_BLOCKSIZE - v3s16(1, 1, 1);
159157
full_node_min = (blockpos_min - 1) * MAP_BLOCKSIZE;

‎src/player.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Map;
8787
class IGameDef;
8888
struct CollisionInfo;
8989
class PlayerSAO;
90-
class HudElement;
90+
struct HudElement;
9191

9292
class Player
9393
{

‎src/scriptapi_env.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ int EnvRef::l_get_node_light(lua_State *L)
227227
time_of_day = 24000.0 * lua_tonumber(L, 3);
228228
time_of_day %= 24000;
229229
u32 dnr = time_to_daynight_ratio(time_of_day, true);
230-
MapNode n = env->getMap().getNodeNoEx(pos);
231230
try{
232231
MapNode n = env->getMap().getNode(pos);
233232
INodeDefManager *ndef = env->getGameDef()->ndef();
@@ -373,7 +372,7 @@ int EnvRef::l_add_item(lua_State *L)
373372
ServerEnvironment *env = o->m_env;
374373
if(env == NULL) return 0;
375374
// pos
376-
v3f pos = checkFloatPos(L, 2);
375+
//v3f pos = checkFloatPos(L, 2);
377376
// item
378377
ItemStack item = read_item(L, 3);
379378
if(item.empty() || !item.isKnown(get_server(L)->idef()))

‎src/scriptapi_types.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ v3s16 check_v3s16(lua_State *L, int index)
147147

148148
video::SColor readARGB8(lua_State *L, int index)
149149
{
150-
video::SColor color;
150+
video::SColor color(0);
151151
luaL_checktype(L, index, LUA_TTABLE);
152152
lua_getfield(L, index, "a");
153153
if(lua_isnumber(L, -1))

‎src/test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ struct TestCompress: public TestBase
464464
std::string str_decompressed = os_decompressed.str();
465465
UTEST(str_decompressed.size() == data_in.size(), "Output size not"
466466
" equal (output: %u, input: %u)",
467-
str_decompressed.size(), data_in.size());
467+
(unsigned int)str_decompressed.size(), (unsigned int)data_in.size());
468468
for(u32 i=0; i<size && i<str_decompressed.size(); i++){
469469
UTEST(str_decompressed[i] == data_in[i],
470470
"index out[%i]=%i differs from in[%i]=%i",

‎src/voxel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void VoxelManipulator::clearFlag(u8 flags)
264264
// 0-1ms on moderate area
265265
TimeTaker timer("clearFlag", &clearflag_time);
266266

267-
v3s16 s = m_area.getExtent();
267+
//v3s16 s = m_area.getExtent();
268268

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

0 commit comments

Comments
 (0)
Please sign in to comment.