Merge commit 'b11720a'

This commit is contained in:
proller committed 2016-08-26 10:34:37 +03:00
commit 4d8a601f41
3 files changed
+43 -8

No files matched your search

+1 -1
View File
@@ -824,7 +824,7 @@ void Client::initLocalMapSaving(const Address &address,
return;
}
std::string address_replaced = hostname + "_" + to_string(address.getPort());
std::string address_replaced = hostname + "_" + std::to_string(address.getPort());
replace( address_replaced.begin(), address_replaced.end(), ':', '_' );
const std::string world_path = porting::path_user
+41 -6
View File
@@ -31,6 +31,7 @@ along with Freeminer. If not, see <http://www.gnu.org/licenses/>.
#include <map>
#include <sstream>
#include "SColor.h"
#include <iomanip>
#include <cctype>
#define STRINGIFY(x) #x
@@ -364,23 +365,57 @@ inline T from_string(const std::string &str)
/// Returns a 64-bit signed value represented by the string \p str (decimal).
inline s64 stoi64(const std::string &str) { return from_string<s64>(str); }
// TODO: Replace with C++11 std::to_string.
#if __cplusplus < 201103L
namespace std {
/// Returns a string representing the value \p val.
template <typename T>
inline std::string to_string(T val)
inline string to_string(T val)
{
std::ostringstream oss;
ostringstream oss;
oss << val;
return oss.str();
}
#define DEFINE_STD_TOSTRING_FLOATINGPOINT(T) \
template <> \
inline string to_string<T>(T val) \
{ \
ostringstream oss; \
oss << std::fixed \
<< std::setprecision(6) \
<< val; \
return oss.str(); \
}
DEFINE_STD_TOSTRING_FLOATINGPOINT(float)
DEFINE_STD_TOSTRING_FLOATINGPOINT(double)
DEFINE_STD_TOSTRING_FLOATINGPOINT(long double)
#undef DEFINE_STD_TOSTRING_FLOATINGPOINT
/// Returns a wide string representing the value \p val
template <typename T>
inline wstring to_wstring(T val)
{
return utf8_to_wide(to_string(val));
}
}
#endif
/// Returns a string representing the decimal value of the 32-bit value \p i.
inline std::string itos(s32 i) { return to_string(i); }
inline std::string itos(s32 i) { return std::to_string(i); }
/// Returns a string representing the decimal value of the 64-bit value \p i.
inline std::string i64tos(s64 i) { return to_string(i); }
inline std::string i64tos(s64 i) { return std::to_string(i); }
// std::to_string uses the '%.6f' conversion, which is inconsistent with
// std::ostream::operator<<() and impractical too. ftos() uses the
// more generic and std::ostream::operator<<()-compatible '%G' format.
/// Returns a string representing the decimal value of the float value \p f.
inline std::string ftos(float f) { return to_string(f); }
inline std::string ftos(float f)
{
std::ostringstream oss;
oss << f;
return oss.str();
}
/**
+1 -1
View File
@@ -5,7 +5,7 @@ cd ..
git remote add minetest https://github.com/minetest/minetest.git
git fetch --all
git pull
#( git merge --no-edit minetest/master | grep -i "conflict" ) && exit
( git merge --no-edit minetest/master | grep -i "conflict" ) && exit
#git submodule foreach --recursive "git pull||true"
cd games