From 319bc940b0c0e3b3ca0fa5cc3269f19240bca484 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 15 Feb 2010 04:03:24 +0000 Subject: [PATCH] gcc fixes --- src/common/gamecode/report.c | 1 - src/external/bson/platform_hacks.h | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 582333140..f80975460 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -1790,7 +1790,6 @@ nr_ship(FILE * F, const seen_region * sr, const ship * sh, const faction * f, co static void nr_building(FILE *F, const seen_region * sr, const building * b, const faction * f) { - region * r = sr->r; int i, bytes; const char * name, * bname, * billusion = NULL; const struct locale * lang = NULL; diff --git a/src/external/bson/platform_hacks.h b/src/external/bson/platform_hacks.h index e5570b1f0..8f6ca5f7b 100644 --- a/src/external/bson/platform_hacks.h +++ b/src/external/bson/platform_hacks.h @@ -7,6 +7,7 @@ #ifdef __GNUC__ #define MONGO_INLINE static __inline__ +#define MONGO_HAVE_STDINT #elif defined(_MSC_VER) #define MONGO_USE__INT64 #define MONGO_INLINE __inline @@ -71,8 +72,8 @@ MONGO_INLINE void bson_swap_endian32(void* outp, const void* inp){ #define bson_big_endian32(out, in) ( memcpy(out, &in, 4) ) #else #ifdef NDEBUG -#define bson_little_endian64(out, in) ( memcpy(out, &in, 8) ) -#define bson_little_endian32(out, in) ( memcpy(out, &in, 4) ) +#define bson_little_endian64(out, in) { *(int64_t*)out = in; } +#define bson_little_endian32(out, in) { *(int32_t*)out = in; } #define bson_big_endian64(out, in) ( bson_swap_endian64(out, &in) ) #define bson_big_endian32(out, in) ( bson_swap_endian32(out, &in) ) #else