PageRenderTime 58ms CodeModel.GetById 52ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 0ms

/elph-chris.patch

#
Patch | 37 lines | 32 code | 5 blank | 0 comment | 0 complexity | 73c2ae71b5e9f7c6cb00d21e17646e69 MD5 | raw file
Possible License(s): LGPL-2.0
 1--- ELPH/sources/elph.cc.chris	2007-02-09 23:29:11.000000000 +0100
 2+++ ELPH/sources/elph.cc	2007-02-09 23:29:26.000000000 +0100
 3@@ -43,7 +43,7 @@
 4                    default = 500\n\
 5   SGFNO=n        : n = no of iterations to compute significance of motif;\n\
 6                    default = 1000\n\
 7- "
 8+"
 9 
10 /* I am eliminating the following option from help file because it has no effect because I am never shuffling the file
11   -z             : when using the makov chain file generation, don't exhaust\n\
12--- ELPH/sources/GBase.h.chris	2006-09-28 19:07:25.000000000 +0200
13+++ ELPH/sources/GBase.h	2007-02-09 23:21:52.000000000 +0100
14@@ -61,13 +61,16 @@
15 typedef void GFreeProc(pointer item); //usually just delete,
16       //but may also support structures with embedded dynamic members
17 
18-#define GMALLOC(ptr,size)  if (!GMalloc((pointer*)(&ptr),size)) \
19-                                     GError(ERR_ALLOC)
20-#define GCALLOC(ptr,size)  if (!GCalloc((pointer*)(&ptr),size)) \
21-                                     GError(ERR_ALLOC)
22-#define GREALLOC(ptr,size) if (!GRealloc((pointer*)(&ptr),size)) \
23-                                     GError(ERR_ALLOC)
24-#define GFREE(ptr)       GFree((pointer*)(&ptr))
25+#define GMALLOC(ptr,size) \
26+  if ((ptr = static_cast<typeof(ptr)>(malloc(size))) == NULL) \
27+    GError(ERR_ALLOC)
28+#define GCALLOC(ptr,size) \
29+  if ((ptr = static_cast<typeof(ptr)>(calloc(size, 1))) == NULL) \
30+    GError(ERR_ALLOC)
31+#define GREALLOC(ptr,size) \
32+  if ((ptr = static_cast<typeof(ptr)>(realloc(ptr,size))) == NULL && size != 0) \
33+    GError(ERR_ALLOC)
34+#define GFREE(ptr)       free(ptr)
35 
36 
37