aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2013-02-26 01:57:59 -0500
committerkwolekr <mirrorisim@gmail.com>2013-02-26 01:57:59 -0500
commitd31f07bd4b83f858cce589faac56922e12ba670f (patch)
treed4044aa4aa782dc1cb9f57adfacb3b2fd8ecc4b2 /src
parent979ca23f1eae1adeb8b0083dffe7203c54d87395 (diff)
downloadminetest-d31f07bd4b83f858cce589faac56922e12ba670f.tar.gz
minetest-d31f07bd4b83f858cce589faac56922e12ba670f.tar.bz2
minetest-d31f07bd4b83f858cce589faac56922e12ba670f.zip
Fix most warnings, re-fix MSVC compile error
Diffstat (limited to 'src')
-rw-r--r--src/base64.h2
-rw-r--r--src/content_cso.cpp2
-rw-r--r--src/emerge.cpp10
-rw-r--r--src/emerge.h2
-rw-r--r--src/game.cpp4
-rw-r--r--src/map.cpp2
-rw-r--r--src/noise.cpp4
-rw-r--r--src/server.cpp2
-rw-r--r--src/test.cpp2
-rw-r--r--src/util/serialize.h11
10 files changed, 22 insertions, 19 deletions
diff --git a/src/base64.h b/src/base64.h
index 5f2d6743d..1cb175518 100644
--- a/src/base64.h
+++ b/src/base64.h
@@ -7,4 +7,4 @@ bool base64_is_valid(std::string const& s);
std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s);
-#endif // BASE64_HEADER \ No newline at end of file
+#endif // BASE64_HEADER
diff --git a/src/content_cso.cpp b/src/content_cso.cpp
index 20eb88b7d..73d5f2b48 100644
--- a/src/content_cso.cpp
+++ b/src/content_cso.cpp
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "map.h"
+/*
static void setBillboardTextureMatrix(scene::IBillboardSceneNode *bill,
float txs, float tys, int col, int row)
{
@@ -33,6 +34,7 @@ static void setBillboardTextureMatrix(scene::IBillboardSceneNode *bill,
matrix.setTextureTranslate(txs*col, tys*row);
matrix.setTextureScale(txs, tys);
}
+*/
class SmokePuffCSO: public ClientSimpleObject
{
diff --git a/src/emerge.cpp b/src/emerge.cpp
index 250c44fbb..6c6863eff 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -58,7 +58,7 @@ EmergeManager::EmergeManager(IGameDef *gamedef, BiomeDefManager *bdef) {
if (g_settings->get("num_emerge_threads").empty()) {
int nprocs = porting::getNumberOfProcessors();
// leave a proc for the main thread and one for some other misc threads
- nthreads = (nprocs > 2) ? nthreads = nprocs - 2 : 1;
+ nthreads = (nprocs > 2) ? nprocs - 2 : 1;
} else {
nthreads = g_settings->getU16("num_emerge_threads");
}
@@ -81,7 +81,7 @@ EmergeManager::EmergeManager(IGameDef *gamedef, BiomeDefManager *bdef) {
EmergeManager::~EmergeManager() {
- for (int i = 0; i != emergethread.size(); i++) {
+ for (unsigned int i = 0; i != emergethread.size(); i++) {
emergethread[i]->setRun(false);
emergethread[i]->qevent.signal();
emergethread[i]->stop();
@@ -101,7 +101,7 @@ void EmergeManager::initMapgens(MapgenParams *mgparams) {
return;
this->params = mgparams;
- for (int i = 0; i != emergethread.size(); i++) {
+ for (unsigned int i = 0; i != emergethread.size(); i++) {
mg = createMapgen(params->mg_name, 0, params);
if (!mg) {
infostream << "EmergeManager: falling back to mapgen v6" << std::endl;
@@ -152,7 +152,7 @@ bool EmergeManager::enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate
// insert into the EmergeThread queue with the least items
int lowestitems = emergethread[0]->blockqueue.size();
- for (int i = 1; i != emergethread.size(); i++) {
+ for (unsigned int i = 1; i != emergethread.size(); i++) {
int nitems = emergethread[i]->blockqueue.size();
if (nitems < lowestitems) {
idx = i;
@@ -259,7 +259,7 @@ void EmergeManager::setParamsToSettings(Settings *settings) {
}
-bool EmergeManager::registerMapgen(std::string mgname, MapgenFactory *mgfactory) {
+void EmergeManager::registerMapgen(std::string mgname, MapgenFactory *mgfactory) {
mglist.insert(std::make_pair(mgname, mgfactory));
infostream << "EmergeManager: registered mapgen " << mgname << std::endl;
}
diff --git a/src/emerge.h b/src/emerge.h
index e5014df58..70b67e731 100644
--- a/src/emerge.h
+++ b/src/emerge.h
@@ -75,7 +75,7 @@ public:
MapgenParams *createMapgenParams(std::string mgname);
bool enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate);
- bool registerMapgen(std::string name, MapgenFactory *mgfactory);
+ void registerMapgen(std::string name, MapgenFactory *mgfactory);
MapgenParams *getParamsFromSettings(Settings *settings);
void setParamsToSettings(Settings *settings);
diff --git a/src/game.cpp b/src/game.cpp
index 8ab0f3fe3..1ae29b13b 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -2816,12 +2816,12 @@ void the_game(
char temptext[300];
snprintf(temptext, 300,
"(% .1f, % .1f, % .1f)"
- " (yaw = %.1f) (seed = %lli)",
+ " (yaw = %.1f) (seed = %llu)",
player_position.X/BS,
player_position.Y/BS,
player_position.Z/BS,
wrapDegrees_0_360(camera_yaw),
- client.getMapSeed());
+ (unsigned long long)client.getMapSeed());
guitext2->setText(narrow_to_wide(temptext).c_str());
guitext2->setVisible(true);
diff --git a/src/map.cpp b/src/map.cpp
index 07af2676b..4be094326 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -3283,7 +3283,7 @@ void ServerMap::save(ModifiedState save_level)
block_count_all++;
- if(block->getModified() >= save_level)
+ if(block->getModified() >= (u32)save_level)
{
// Lazy beginSave()
if(!save_started){
diff --git a/src/noise.cpp b/src/noise.cpp
index d250882e8..49b5f7e58 100644
--- a/src/noise.cpp
+++ b/src/noise.cpp
@@ -507,7 +507,7 @@ void Noise::gradientMap3D(float x, float y, float z,
float *Noise::perlinMap2D(float x, float y) {
- float a = 0.0, f = 1.0, g = 1.0;
+ float f = 1.0, g = 1.0;
int i, j, index, oct;
x /= np->spread.X;
@@ -537,7 +537,7 @@ float *Noise::perlinMap2D(float x, float y) {
float *Noise::perlinMap3D(float x, float y, float z) {
- float a = 0.0, f = 1.0, g = 1.0;
+ float f = 1.0, g = 1.0;
int i, j, k, index, oct;
x /= np->spread.X;
diff --git a/src/server.cpp b/src/server.cpp
index 2d00cf4ac..41a7a4289 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -1652,7 +1652,7 @@ void Server::AsyncRunStep()
{
counter = 0.0;
- for (int i = 0; i != m_emerge->emergethread.size(); i++)
+ for (unsigned int i = 0; i != m_emerge->emergethread.size(); i++)
m_emerge->emergethread[i]->trigger();
// Update m_enable_rollback_recording here too
diff --git a/src/test.cpp b/src/test.cpp
index f988b34f7..d86868118 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -462,7 +462,7 @@ struct TestCompress: public TestBase
<<os_decompressed.str().size()<<std::endl;
std::string str_decompressed = os_decompressed.str();
UTEST(str_decompressed.size() == data_in.size(), "Output size not"
- " equal (output: %i, input: %i)",
+ " equal (output: %u, input: %u)",
str_decompressed.size(), data_in.size());
for(u32 i=0; i<size && i<str_decompressed.size(); i++){
UTEST(str_decompressed[i] == data_in[i],
diff --git a/src/util/serialize.h b/src/util/serialize.h
index b297786e6..bb44c7f96 100644
--- a/src/util/serialize.h
+++ b/src/util/serialize.h
@@ -208,11 +208,12 @@ inline void writeARGB8(u8 *data, video::SColor p)
inline video::SColor readARGB8(const u8 *data)
{
- video::SColor p;
- p.setAlpha(readU8(&data[0]));
- p.setRed(readU8(&data[1]));
- p.setGreen(readU8(&data[2]));
- p.setBlue(readU8(&data[3]));
+ video::SColor p(
+ readU8(&data[0]),
+ readU8(&data[1]),
+ readU8(&data[2]),
+ readU8(&data[3])
+ );
return p;
}