void *util_memory_a (unsigned int, unsigned int, const char *);
void util_memory_d (void *, unsigned int, const char *);
+void *util_memory_r (void *, unsigned int, unsigned int, const char *);
void util_meminfo ();
bool util_strupper (const char *);
size_t util_strtocmd (const char *, char *, size_t);
size_t util_strtononcmd (const char *, char *, size_t);
-uint32_t util_crc32(const char *, int, register const short);
+uint16_t util_crc16(uint16_t crc, const char *data, size_t len);
+uint32_t util_crc32(uint32_t crc, const char *data, size_t len);
#ifdef NOTRACK
-# define mem_a(x) malloc(x)
-# define mem_d(x) free (x)
+# define mem_a(x) malloc(x)
+# define mem_d(x) free (x)
+# define mem_r(x,y) realloc((x),(y))
#else
-# define mem_a(x) util_memory_a((x), __LINE__, __FILE__)
-# define mem_d(x) util_memory_d((x), __LINE__, __FILE__)
+# define mem_a(x) util_memory_a((x), __LINE__, __FILE__)
+# define mem_d(x) util_memory_d((x), __LINE__, __FILE__)
+# define mem_r(x,y) util_memory_r((x), (y), __LINE__, __FILE__)
#endif
/*
VECTOR_PROT(prog_section_function, code_functions );
VECTOR_PROT(int, code_globals );
VECTOR_PROT(char, code_chars );
+extern uint16_t code_crc;
typedef float qcfloat;
typedef int32_t qcint;
bool GMQCC_WARN Tself##_##mem##_append(Tself *s, Twhat *p, size_t c) \
{ \
Twhat *reall; \
+ size_t oldalloc; \
if (s->mem##_count+c > s->mem##_alloc) { \
if (!s->mem##_alloc) { \
s->mem##_alloc = c < 16 ? 16 : c; \
s->mem = (Twhat*)mem_a(sizeof(Twhat) * s->mem##_alloc); \
} else { \
+ oldalloc = s->mem##_alloc; \
s->mem##_alloc *= 2; \
if (s->mem##_count+c >= s->mem##_alloc) { \
s->mem##_alloc = s->mem##_count+c; \
} \
reall = (Twhat*)mem_a(sizeof(Twhat) * s->mem##_alloc); \
if (!reall) { \
+ s->mem##_alloc = oldalloc; \
return false; \
} \
memcpy(reall, s->mem, sizeof(Twhat) * s->mem##_count); \
memcpy(reall, s->mem, sizeof(Twhat) * c); \
mem_d(s->mem); \
s->mem = reall; \
+ s->mem##_alloc = c; \
} \
return true; \
}
extern bool opts_werror;
extern bool opts_forcecrc;
extern uint16_t opts_forced_crc;
+extern bool opts_pp_only;
/*===================================================================*/
#define OPTS_FLAG(i) (!! (opts_flags[(i)/32] & (1<< ((i)%32))))