ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/utils.C
(Generate patch)

Comparing deliantra/server/common/utils.C (file contents):
Revision 1.4 by root, Mon Sep 4 11:07:59 2006 UTC vs.
Revision 1.8 by root, Sat Sep 9 21:48:28 2006 UTC

1/* 1/*
2 * static char *rcsid_utils_c = 2 * static char *rcsid_utils_c =
3 * "$Id: utils.C,v 1.4 2006/09/04 11:07:59 root Exp $"; 3 * "$Id: utils.C,v 1.8 2006/09/09 21:48:28 root Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
304 304
305/* set the materialname and type for an item */ 305/* set the materialname and type for an item */
306void set_materialname(object *op, int difficulty, materialtype_t *nmt) 306void set_materialname(object *op, int difficulty, materialtype_t *nmt)
307{ 307{
308 materialtype_t *mt, *lmt; 308 materialtype_t *mt, *lmt;
309#ifdef NEW_MATERIAL_CODE
309 int j; 310 int j;
311#endif
310 312
311 if (op->materialname != NULL) 313 if (op->materialname != NULL)
312 return; 314 return;
313 315
314 316
483 } 485 }
484 else strcpy(input, tmp); 486 else strcpy(input, tmp);
485 return; 487 return;
486} 488}
487 489
488//TODO: overhead due to specifying size twice
489void * 490void *
490zero_initialised::operator new (size_t s) 491zero_initialised::operator new (size_t s)
491{ 492{
493 //return calloc (1, s);
492 return g_slice_alloc0 (s); 494 return g_slice_alloc0 (s);
493} 495}
494 496
495void * 497void *
496zero_initialised::operator new [] (size_t s) 498zero_initialised::operator new [] (size_t s)
497{ 499{
500 //return calloc (1, s);
498 return g_slice_alloc0 (s); 501 return g_slice_alloc0 (s);
499} 502}
500 503
501void 504void
502zero_initialised::operator delete (void *p, size_t s) 505zero_initialised::operator delete (void *p, size_t s)
503{ 506{
507 //free (p); return;
504 g_slice_free1 (s, p); 508 g_slice_free1 (s, p);
505} 509}
506 510
507void 511void
508zero_initialised::operator delete [] (void *p, size_t s) 512zero_initialised::operator delete [] (void *p, size_t s)
509{ 513{
514 //free (p); return;
510 g_slice_free1 (s, p); 515 g_slice_free1 (s, p);
511} 516}
512 517

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines