--- deliantra/server/include/util.h 2012/11/11 01:27:44 1.121 +++ deliantra/server/include/util.h 2016/11/18 20:20:05 1.124 @@ -1,7 +1,7 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -57,7 +57,7 @@ // use C0X decltype for auto declarations until ISO C++ sanctifies them (if ever) #define auto(var,expr) decltype(expr) var = (expr) -#if cplusplus_does_not_suck +#if cplusplus_does_not_suck /* still sucks in codesize with gcc 6, although local types work now */ // does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) template static inline int array_length (const T (&arr)[N]) @@ -239,9 +239,9 @@ #else // and has a max. error of 9 in the range -100..+100. #endif -inline int +inline int idistance (int dx, int dy) -{ +{ unsigned int dx_ = abs (dx); unsigned int dy_ = abs (dy); @@ -409,7 +409,7 @@ typedef const Tp &const_reference; typedef Tp value_type; - template + template struct rebind { typedef slice_allocator other; @@ -599,7 +599,7 @@ // runs concurrently with the looping logic. // we modify the hash a bit to improve its distribution uint32_t hash = STRHSH_NULL; - + while (*s) hash = (hash ^ *s++) * 16777619U; @@ -610,7 +610,7 @@ memhsh (const char *s, size_t len) { uint32_t hash = STRHSH_NULL; - + while (len--) hash = (hash ^ *s++) * 16777619U;