PageRenderTime 90ms CodeModel.GetById 24ms RepoModel.GetById 1ms 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. /* I am eliminating the following option from help file because it has no effect because I am never shuffling the file
  10. -z : when using the makov chain file generation, don't exhaust\n\
  11. --- ELPH/sources/GBase.h.chris 2006-09-28 19:07:25.000000000 +0200
  12. +++ ELPH/sources/GBase.h 2007-02-09 23:21:52.000000000 +0100
  13. @@ -61,13 +61,16 @@
  14. typedef void GFreeProc(pointer item); //usually just delete,
  15. //but may also support structures with embedded dynamic members
  16. -#define GMALLOC(ptr,size) if (!GMalloc((pointer*)(&ptr),size)) \
  17. - GError(ERR_ALLOC)
  18. -#define GCALLOC(ptr,size) if (!GCalloc((pointer*)(&ptr),size)) \
  19. - GError(ERR_ALLOC)
  20. -#define GREALLOC(ptr,size) if (!GRealloc((pointer*)(&ptr),size)) \
  21. - GError(ERR_ALLOC)
  22. -#define GFREE(ptr) GFree((pointer*)(&ptr))
  23. +#define GMALLOC(ptr,size) \
  24. + if ((ptr = static_cast<typeof(ptr)>(malloc(size))) == NULL) \
  25. + GError(ERR_ALLOC)
  26. +#define GCALLOC(ptr,size) \
  27. + if ((ptr = static_cast<typeof(ptr)>(calloc(size, 1))) == NULL) \
  28. + GError(ERR_ALLOC)
  29. +#define GREALLOC(ptr,size) \
  30. + if ((ptr = static_cast<typeof(ptr)>(realloc(ptr,size))) == NULL && size != 0) \
  31. + GError(ERR_ALLOC)
  32. +#define GFREE(ptr) free(ptr)