--- deliantra/server/include/global.h 2006/09/11 01:49:03 1.16 +++ deliantra/server/include/global.h 2006/12/11 21:32:17 1.21 @@ -1,9 +1,4 @@ /* - * static char *rcsid_global_h = - * "$Id$"; - */ - -/* CrossFire, A Multiplayer game for X-windows Copyright (C) 2002 Mark Wedel & Crossfire Development Team @@ -35,77 +30,17 @@ #include "includes.h" - -/* Type defines for specific signed/unsigned variables of a certain number - * of bits. Not really used anyplace, but if a certain number of bits - * is required, these type defines should then be used. This will make - * porting to systems that have different sized data types easier. - * - * Note: The type defines should just mean that the data type has at - * least that many bits. if a uint16 is actually 32 bits, no big deal, - * it is just a waste of space. - * - * Note2: When using something that is normally stored in a character - * (ie strings), don't use the uint8/sint8 typdefs, use 'char' instead. - * The signedness for char is probably not universal, and using char - * will probably be more portable than sint8/unit8 - */ - - -typedef unsigned int uint32; - -#ifndef UINT32_MAX -#define UINT32_MAX 4294967295U -#endif - -typedef signed int sint32; -#define SINT32_MAX 2147483647 - -typedef unsigned short uint16; -#ifndef UINT16_MAX -#define UINT16_MAX 65535 -#endif - -typedef signed short sint16; -#define SINT16_MAX 32767 - -typedef unsigned char uint8; -#ifndef UINT8_MAX -#define UINT8_MAX 255 -#endif - -typedef signed char sint8; -#define SINT8_MAX 127 +typedef int8_t sint8; +typedef uint8_t uint8; +typedef int16_t sint16; +typedef uint16_t uint16; +typedef int32_t sint32; +typedef uint32_t uint32; +typedef int64_t sint64; +typedef uint64_t uint64; typedef unsigned short Fontindex; -#ifdef WIN32 -/* Python plugin stuff defines SIZEOF_LONG_LONG as 8, and besides __int64 is a 64b type on MSVC... - * So let's force the typedef */ -typedef unsigned __int64 uint64; -typedef signed __int64 sint64; -/* Needed for experience */ -#define atoll _atoi64 - -/* To reduce number of warnings */ -#pragma warning( disable: 4244 ) /* conversion from 'xxx' to 'yyy', possible loss of data */ -#pragma warning( disable: 4305 ) /* initializing float f = 0.05; instead of f = 0.05f; */ - -#else /* WIN32 */ - -#if SIZEOF_LONG == 8 -typedef unsigned long uint64; -typedef signed long sint64; -#elif SIZEOF_LONG_LONG == 8 -typedef unsigned long long uint64; -typedef signed long long sint64; -#else -#error do not know how to get a 64 bit value on this system. -#error correct and send mail to crossfire-devel on how to do this -#endif - -#endif - #include #define ACC_CLASS(name) @@ -146,10 +81,11 @@ * So far only used when dealing with artifacts. * (now used by alchemy and other code too. Nov 95 b.t). */ -typedef struct linked_char { +struct linked_char +{ shstr name; struct linked_char *next; -} linked_char; +}; /* Pull in artifacts */ #include "artifact.h" @@ -178,7 +114,7 @@ * These are the beginnings of linked lists: */ EXTERN player *first_player; -EXTERN mapstruct *first_map; +EXTERN maptile *first_map; EXTERN region *first_region; EXTERN treasurelist *first_treasurelist; EXTERN artifactlist *first_artifactlist; @@ -286,7 +222,6 @@ # define CFREE(x) free(x) #endif -#ifndef WIN32 /* ---win32 we define this stuff in win32.h */ #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) @@ -303,7 +238,6 @@ # include # endif #endif -#endif typedef struct Settings { char *logfilename; /* logfile to use */ @@ -410,7 +344,9 @@ void free (recipe *); void free (linked_char *); void free (godlink *); -void free (mapstruct *); +void free (objectlink *); +void free (oblinkpt *); +void free (maptile *); void free (key_value *); void free (treasure *); void free (materialtype_t *);