summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-24 16:27:15 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-24 16:34:07 +0200
commit609a81096ec95e56e4516e73529942e48ea7b23b (patch)
treeb166ef943a744962af812a6e61927b0dd87fe1b5 /src
parent2e1b6ac8453cd1579908f8712ca9a0069787b82f (diff)
downloadmanaserv-609a81096ec95e56e4516e73529942e48ea7b23b.tar.gz
manaserv-609a81096ec95e56e4516e73529942e48ea7b23b.tar.bz2
manaserv-609a81096ec95e56e4516e73529942e48ea7b23b.tar.xz
manaserv-609a81096ec95e56e4516e73529942e48ea7b23b.zip
Fixed compilation problem with GCC 4.4
Fix ported from the client.
Diffstat (limited to 'src')
-rw-r--r--src/scripting/lua.cpp1
-rw-r--r--src/utils/sha256.cpp12
-rw-r--r--src/utils/sha256.h2
3 files changed, 10 insertions, 5 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index b4bdb99b..0136210a 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -203,6 +203,7 @@ static int npc_end(lua_State *s)
MessageOut msg(GPMSG_NPC_CLOSE);
msg.writeShort(p->getPublicID());
gameHandler->sendTo(q, msg);
+ return 0;
}
/**
diff --git a/src/utils/sha256.cpp b/src/utils/sha256.cpp
index d2aebae8..4f292c9b 100644
--- a/src/utils/sha256.cpp
+++ b/src/utils/sha256.cpp
@@ -71,10 +71,14 @@
#include "sha256.h"
#include <memory.h>
-#ifdef HAS_STDINT
-#include <stdint.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
#endif
-#ifndef HAS_STDINT
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#else
+typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
#endif
@@ -269,7 +273,7 @@ std::string SHA256Hash(const char *src, int len)
return hash;
}
-std::string sha256(const std::string& string)
+std::string sha256(const std::string &string)
{
return SHA256Hash(string.c_str(), string.length());
}
diff --git a/src/utils/sha256.h b/src/utils/sha256.h
index f805c6cf..5e528744 100644
--- a/src/utils/sha256.h
+++ b/src/utils/sha256.h
@@ -32,6 +32,6 @@ static const unsigned int SHA256_HASH_LENGTH = 64;
* @param string the string to create the SHA-256 hash for
* @return the SHA-256 hash for the given string.
*/
-std::string sha256(const std::string& string);
+std::string sha256(const std::string &string);
#endif // _TMW_UTILS_SHA256_H_