Cleanup: Unused alloca definitions and includes

pull/544/head
Charles Pigott 1 year ago committed by PeterN
parent b282664242
commit 6fc28d649e

@ -8,7 +8,6 @@
/** @file animated_tile.cpp Everything related to animated tiles. */
#include "stdafx.h"
#include "core/alloc_func.hpp"
#include "core/smallvec_type.hpp"
#include "tile_cmd.h"
#include "viewport_func.h"

@ -128,9 +128,4 @@ static inline T *ReallocT(T *t_ptr, size_t num_elements)
return t_ptr;
}
/** alloca() has to be called in the parent function, so define AllocaM() as a macro */
#define AllocaM(T, num_elements) \
(CheckAllocationConstraints<T>(num_elements), \
(T*)alloca((num_elements) * sizeof(T)))
#endif /* ALLOC_FUNC_HPP */

@ -10,7 +10,6 @@
#ifndef SMALLVEC_TYPE_HPP
#define SMALLVEC_TYPE_HPP
#include "alloc_func.hpp"
#include "mem_func.hpp"
#include <vector>

@ -10,6 +10,7 @@
#ifndef NEWGRF_STORAGE_H
#define NEWGRF_STORAGE_H
#include "core/alloc_func.hpp"
#include "core/pool_type.hpp"
#include "tile_type.h"

@ -10,7 +10,6 @@
#include "../../stdafx.h"
#include "../../crashlog.h"
#include "win32.h"
#include "../../core/alloc_func.hpp"
#include "../../core/math_func.hpp"
#include "../../string_func.h"
#include "../../fileio_func.h"

@ -13,7 +13,6 @@
#include "compat/animated_tile_sl_compat.h"
#include "../tile_type.h"
#include "../core/alloc_func.hpp"
#include "../core/smallvec_type.hpp"
#include "../safeguards.h"

@ -8,6 +8,7 @@
/** @file strings_sl.cpp Code handling saving and loading of strings */
#include "../stdafx.h"
#include "../core/alloc_func.hpp"
#include "../string_func.h"
#include "../strings_func.h"
#include "saveload_internal.h"

@ -10,6 +10,7 @@
#include "../../stdafx.h"
#include "script_cargo.hpp"
#include "../../economy_func.h"
#include "../../core/alloc_func.hpp"
#include "../../core/bitmath_func.hpp"
#include "../../strings_func.h"
#include "../../settings_type.h"

@ -11,7 +11,7 @@
#define SQUIRREL_HELPER_HPP
#include "squirrel.hpp"
#include "../core/smallvec_type.hpp"
#include "../core/alloc_func.hpp"
#include "../economy_type.h"
#include "../string_func.h"
#include "../tile_type.h"

@ -12,7 +12,6 @@
#include <sqstdmath.h>
#include "../debug.h"
#include "squirrel_std.hpp"
#include "../core/alloc_func.hpp"
#include "../core/math_func.hpp"
#include "../string_func.h"

@ -118,10 +118,6 @@
# define strcasecmp stricmp
#endif
#if defined(SUNOS) || defined(HPUX) || defined(__CYGWIN__)
# include <alloca.h>
#endif
/* Stuff for GCC */
#if defined(__GNUC__) || (defined(__clang__) && !defined(_MSC_VER))
# define NORETURN __attribute__ ((noreturn))
@ -172,10 +168,6 @@
# include <malloc.h>
#endif /* __WATCOMC__ */
#if defined(__MINGW32__)
# include <malloc.h> // alloca()
#endif
#if defined(_WIN32)
# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#endif
@ -199,7 +191,6 @@
# pragma warning(disable: 6011) // code analyzer: Dereferencing NULL pointer 'pfGetAddrInfo': Lines: 995, 996, 998, 999, 1001
# pragma warning(disable: 6326) // code analyzer: potential comparison of a constant with another constant
# pragma warning(disable: 6031) // code analyzer: Return value ignored: 'ReadFile'
# pragma warning(disable: 6255) // code analyzer: _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead
# pragma warning(disable: 6246) // code analyzer: Local declaration of 'statspec' hides declaration of the same name in outer scope. For additional information, see previous declaration at ...
# if (_MSC_VER == 1500) // Addresses item #13 on http://blogs.msdn.com/b/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx, for Visual Studio 2008
@ -207,7 +198,6 @@
# include <intrin.h>
# endif
# include <malloc.h> // alloca()
# define NORETURN __declspec(noreturn)
# if (_MSC_VER < 1900)
# define inline __forceinline

@ -8,6 +8,7 @@
/** @file strgen_base.cpp Tool to create computer readable (stand-alone) translation files. */
#include "../stdafx.h"
#include "../core/alloc_func.hpp"
#include "../core/endian_func.hpp"
#include "../string_func.h"
#include "../table/control_codes.h"

@ -8,6 +8,7 @@
/** @file stringfilter.cpp Searching and filtering using a stringterm. */
#include "stdafx.h"
#include "core/alloc_func.hpp"
#include "string_func.h"
#include "strings_func.h"
#include "stringfilter_type.h"

Loading…
Cancel
Save