Permalink
Browse files

JK2: Remove mismatched allocator from std::map typedefs

The Allocator is meant to be one that is suitable for allocating
std::pair<key, value> instances, not value instances, and the
Standard C++ library provided by gcc 8 asserts that the types match.
The closest valid allocator here would be
std::allocator<std::pair<key, value>>, but that is the default for
this template anyway, so we can just omit it.

Closes: #985
Bug-Debian: https://bugs.debian.org/905477
Signed-off-by: Simon McVittie <smcv@debian.org>
  • Loading branch information...
smcv committed Aug 6, 2018
1 parent 8d51abf commit a4101774f388d44ff4d8d5df8632538636b129ae
Showing with 4 additions and 4 deletions.
  1. +1 −1 codeJK2/cgame/cg_main.cpp
  2. +2 −2 codeJK2/game/g_local.h
  3. +1 −1 codeJK2/game/g_spawn.cpp
@@ -31,7 +31,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "../code/qcommon/ojk_saved_game_helper.h"
//NOTENOTE: Be sure to change the mirrored code in g_shared.h
typedef std::map< sstring_t, unsigned char, std::less<sstring_t>, std::allocator< unsigned char > > namePrecache_m;
typedef std::map< sstring_t, unsigned char, std::less<sstring_t> > namePrecache_m;
extern namePrecache_m *as_preCacheMap;
extern void CG_RegisterNPCCustomSounds( clientInfo_t *ci );
extern qboolean G_AddSexToMunroString ( char *string, qboolean qDoBoth );
View
@@ -634,8 +634,8 @@ typedef struct pscript_s
long length;
} pscript_t;
typedef std::map < std::string, int, std::less<std::string>, std::allocator<int> > entlist_t;
typedef std::map < std::string, pscript_t*, std::less<std::string>, std::allocator<pscript_t*> > bufferlist_t;
typedef std::map < std::string, int, std::less<std::string> > entlist_t;
typedef std::map < std::string, pscript_t*, std::less<std::string> > bufferlist_t;
extern char *G_NewString( const char *string );
View
@@ -39,7 +39,7 @@ char spawnVarChars[MAX_SPAWN_VARS_CHARS];
#include "../../code/qcommon/sstring.h"
//NOTENOTE: Be sure to change the mirrored code in cgmain.cpp
typedef std::map< sstring_t, unsigned char, std::less<sstring_t>, std::allocator< unsigned char > > namePrecache_m;
typedef std::map< sstring_t, unsigned char, std::less<sstring_t> > namePrecache_m;
namePrecache_m *as_preCacheMap;
qboolean G_SpawnString( const char *key, const char *defaultString, char **out ) {

0 comments on commit a410177

Please sign in to comment.