--- deliantra/server/common/utils.C 2006/08/29 08:01:36 1.2 +++ deliantra/server/common/utils.C 2006/09/09 21:48:28 1.8 @@ -1,6 +1,6 @@ /* * static char *rcsid_utils_c = - * "$Id: utils.C,v 1.2 2006/08/29 08:01:36 root Exp $"; + * "$Id: utils.C,v 1.8 2006/09/09 21:48:28 root Exp $"; */ /* @@ -34,6 +34,8 @@ #include #include +#include + /* * The random functions here take luck into account when rolling random * dice or numbers. This function has less of an impact the larger the @@ -286,7 +288,7 @@ mt = name_to_material(op->materialname); if (!mt) { - LOG(llevError, "archetype '%s>%s' uses nonexistent material '%s'\n", op->arch->name, op->name, op->materialname); + LOG(llevError, "archetype '%s>%s' uses nonexistent material '%s'\n", &op->arch->name, &op->name, &op->materialname); return; } @@ -304,7 +306,9 @@ void set_materialname(object *op, int difficulty, materialtype_t *nmt) { materialtype_t *mt, *lmt; +#ifdef NEW_MATERIAL_CODE int j; +#endif if (op->materialname != NULL) return; @@ -338,7 +342,7 @@ if (lmt != NULL) { #ifndef NEW_MATERIAL_CODE - op->materialname = add_string(lmt->name); + op->materialname = lmt->name; return; #else @@ -482,3 +486,32 @@ else strcpy(input, tmp); return; } + +void * +zero_initialised::operator new (size_t s) +{ + //return calloc (1, s); + return g_slice_alloc0 (s); +} + +void * +zero_initialised::operator new [] (size_t s) +{ + //return calloc (1, s); + return g_slice_alloc0 (s); +} + +void +zero_initialised::operator delete (void *p, size_t s) +{ + //free (p); return; + g_slice_free1 (s, p); +} + +void +zero_initialised::operator delete [] (void *p, size_t s) +{ + //free (p); return; + g_slice_free1 (s, p); +} +