From c5698f4985dacd540ce715cb1ed90037f63d9b5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kim=20Nguy=E1=BB=85n?= Date: Wed, 29 Feb 2012 11:07:19 +0100 Subject: [PATCH] Remove _FORTIFY_SOURCE=0 and outrageous -O9 from makefile. --- swcsa/Makefile | 3 ++- swcsa/utils/basics.h | 6 +++--- swcsa/utils/hash.c | 4 +--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/swcsa/Makefile b/swcsa/Makefile index cdd5672..6aa4906 100644 --- a/swcsa/Makefile +++ b/swcsa/Makefile @@ -2,7 +2,8 @@ SRCDIRUTILS = utils SRCDIRCSA = intIndex CC = g++ -export CFLAGS = -O9 -D_FORTIFY_SOURCE=0 +export CFLAGS = -O3 +# -D_FORTIFY_SOURCE=0 #export CFLAGS = -O9 -m32 -L. -g -D_FORTIFY_SOURCE=0 # Original settings: diff --git a/swcsa/utils/basics.h b/swcsa/utils/basics.h index 8e2f820..01741b5 100755 --- a/swcsa/utils/basics.h +++ b/swcsa/utils/basics.h @@ -27,9 +27,9 @@ extern "C" { //#define free(p) Free(p) //#define realloc(p,n) Realloc(p,n) -static void *Malloc (size_t n); -static void Free (void *p); -static void *Realloc (void *p, size_t n); + //static void *Malloc (size_t n); + //static void Free (void *p); + //static void *Realloc (void *p, size_t n); // Data types diff --git a/swcsa/utils/hash.c b/swcsa/utils/hash.c index a5be2d3..5512920 100755 --- a/swcsa/utils/hash.c +++ b/swcsa/utils/hash.c @@ -51,7 +51,7 @@ t_hash initialize_hash (unsigned long sizeVoc) { h->SIZE_HASH = sizeVoc; do { h->SIZE_HASH = NearestPrime(h->SIZE_HASH); - } while (h->SIZE_HASH < m); + } while (h->SIZE_HASH >= m); h->hash = (t_hashNode *) malloc(h->SIZE_HASH * sizeof(t_hashNode)); h->NumElem = 0; @@ -294,9 +294,7 @@ void insertElement (t_hash h, const unsigned char *aWord, register unsigned long if(h->NumElem >= h->SIZE_HASH/2) { - resize(h); - } //h->hash[*addr].word = (unsigned char*) malloc((len+1) * sizeof(unsigned char)); getMemoryBlock(h->_memMgr,( byte **)&(h->hash[*addr].word),len+1); -- 2.17.1