--- deliantra/server/include/util.h 2012/11/12 02:39:51 1.122 +++ deliantra/server/include/util.h 2018/11/14 22:52:13 1.125 @@ -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]) @@ -301,25 +301,25 @@ extern ssize_t slice_alloc; // statistics -void *salloc_ (int n) throw (std::bad_alloc); -void *salloc_ (int n, void *src) throw (std::bad_alloc); +void *salloc_ (int n); +void *salloc_ (int n, void *src); // strictly the same as g_slice_alloc, but never returns 0 template -inline T *salloc (int n = 1) throw (std::bad_alloc) { return (T *)salloc_ (n * sizeof (T)); } +inline T *salloc (int n = 1) { return (T *)salloc_ (n * sizeof (T)); } // also copies src into the new area, like "memdup" // if src is 0, clears the memory template -inline T *salloc (int n, T *src) throw (std::bad_alloc) { return (T *)salloc_ (n * sizeof (T), (void *)src); } +inline T *salloc (int n, T *src) { return (T *)salloc_ (n * sizeof (T), (void *)src); } // clears the memory template -inline T *salloc0(int n = 1) throw (std::bad_alloc) { return (T *)salloc_ (n * sizeof (T), 0); } +inline T *salloc0(int n = 1) { return (T *)salloc_ (n * sizeof (T), 0); } // for symmetry template -inline void sfree (T *ptr, int n = 1) throw () +inline void sfree (T *ptr, int n = 1) noexcept { if (expect_true (ptr)) { @@ -331,7 +331,7 @@ // nulls the pointer template -inline void sfree0 (T *&ptr, int n = 1) throw () +inline void sfree0 (T *&ptr, int n = 1) noexcept { sfree (ptr, n); ptr = 0; @@ -415,10 +415,10 @@ typedef slice_allocator other; }; - slice_allocator () throw () { } - slice_allocator (const slice_allocator &) throw () { } + slice_allocator () noexcept { } + slice_allocator (const slice_allocator &) noexcept { } template - slice_allocator (const slice_allocator &) throw () { } + slice_allocator (const slice_allocator &) noexcept { } ~slice_allocator () { } @@ -435,7 +435,7 @@ sfree (p, n); } - size_type max_size () const throw () + size_type max_size () const noexcept { return size_t (-1) / sizeof (Tp); }