--- ELPH/sources/elph.cc.chris 2007-02-09 23:29:11.000000000 +0100
+++ ELPH/sources/elph.cc 2007-02-09 23:29:26.000000000 +0100
@@ -43,7 +43,7 @@
default = 500\n\
SGFNO=n : n = no of iterations to compute significance of motif;\n\
default = 1000\n\
- "
+"
/* I am eliminating the following option from help file because it has no effect because I am never shuffling the file
-z : when using the makov chain file generation, don't exhaust\n\
--- ELPH/sources/GBase.h.chris 2006-09-28 19:07:25.000000000 +0200
+++ ELPH/sources/GBase.h 2007-02-09 23:21:52.000000000 +0100
@@ -61,13 +61,16 @@
typedef void GFreeProc(pointer item); //usually just delete,
//but may also support structures with embedded dynamic members
-#define GMALLOC(ptr,size) if (!GMalloc((pointer*)(&ptr),size)) \
- GError(ERR_ALLOC)
-#define GCALLOC(ptr,size) if (!GCalloc((pointer*)(&ptr),size)) \
- GError(ERR_ALLOC)
-#define GREALLOC(ptr,size) if (!GRealloc((pointer*)(&ptr),size)) \
- GError(ERR_ALLOC)
-#define GFREE(ptr) GFree((pointer*)(&ptr))
+#define GMALLOC(ptr,size) \
+ if ((ptr = static_cast<typeof(ptr)>(malloc(size))) == NULL) \
+ GError(ERR_ALLOC)
+#define GCALLOC(ptr,size) \
+ if ((ptr = static_cast<typeof(ptr)>(calloc(size, 1))) == NULL) \
+ GError(ERR_ALLOC)
+#define GREALLOC(ptr,size) \
+ if ((ptr = static_cast<typeof(ptr)>(realloc(ptr,size))) == NULL && size != 0) \
+ GError(ERR_ALLOC)
+#define GFREE(ptr) free(ptr)