From 7bdc216cf61d525a573aad9b86af29f909a49b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Manuel=20de=20Morais=20Santos=20Costa?= Date: Thu, 21 Jan 2010 15:05:01 +0000 Subject: [PATCH 1/4] get rid of the 0x0x problem. --- C/write.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/C/write.c b/C/write.c index 64030aa26..b1c122867 100644 --- a/C/write.c +++ b/C/write.c @@ -172,9 +172,7 @@ wrputref(CODEADDR ref, int Quote_illegal, wrf writewch) /* writes a data base char s[256]; putAtom(AtomDBref, Quote_illegal, writewch); -#if SHORT_INTS - sprintf(s, "(0x%p,0)", ref); -#elif __linux__ +#if defined(__linux__) || defined(__APPLE__) sprintf(s, "(%p,0)", ref); #else sprintf(s, "(0x%p,0)", ref); From 3a0179ca9d90d6abcc589717ba6bc24c55d79b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Manuel=20de=20Morais=20Santos=20Costa?= Date: Thu, 21 Jan 2010 15:05:30 +0000 Subject: [PATCH 2/4] fix XOPEN_SOURCE complaint. --- H/Yap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/H/Yap.h b/H/Yap.h index 630326d71..7821833d1 100644 --- a/H/Yap.h +++ b/H/Yap.h @@ -145,8 +145,10 @@ #ifdef THREADS #if USE_PTHREAD_LOCKING +#ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 #endif +#endif #include #endif From 1187e58005f383190c83396ac232b0402aa7a478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Manuel=20de=20Morais=20Santos=20Costa?= Date: Thu, 21 Jan 2010 15:05:59 +0000 Subject: [PATCH 3/4] fix unnecessary unlocking (obs from Jiefei Ma). --- C/dbase.c | 1 - 1 file changed, 1 deletion(-) diff --git a/C/dbase.c b/C/dbase.c index defedf993..383853cec 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -2652,7 +2652,6 @@ new_lu_int_key(Int key) p->ArityOfPE = 3; p->OpcodeOfPred = Yap_opcode(_op_fail); p->cs.p_code.TrueCodeOfPred = p->CodeOfPred = FAILCODE; - WRITE_UNLOCK(ae->ARWLock); INT_LU_KEYS[hash_key] = p0; return p; } From a7c1e9afbadee817f1b736353d9c6557bc313d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Manuel=20de=20Morais=20Santos=20Costa?= Date: Thu, 21 Jan 2010 15:21:26 +0000 Subject: [PATCH 4/4] fix hashing over empty atoms (obs from Jose Santos). --- C/utilpreds.c | 4 ++++ packages/clpqr | 2 +- packages/jpl | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/C/utilpreds.c b/C/utilpreds.c index f35052384..bca2c62b1 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -1990,6 +1990,10 @@ AddAtomToHash(CELL *st, Atom at) } else { char *c = RepAtom(at)->StrOfAE; int ulen = strlen(c); + /* fix hashing over empty atom */ + if (!ulen) { + return st; + } start = (CELL *)c; if (ulen % CellSize == 0) { len = ulen/CellSize; diff --git a/packages/clpqr b/packages/clpqr index 0072deb51..e3ee70d59 160000 --- a/packages/clpqr +++ b/packages/clpqr @@ -1 +1 @@ -Subproject commit 0072deb511e839a2f2df6bfa170076f9c8ecb6bb +Subproject commit e3ee70d5971a5af8c9a2a3a5fe8a1892c3777f2b diff --git a/packages/jpl b/packages/jpl index 8192d5f9b..d661852f7 160000 --- a/packages/jpl +++ b/packages/jpl @@ -1 +1 @@ -Subproject commit 8192d5f9ba0bba55fdd96b4473d68d8cf57f51aa +Subproject commit d661852f76fe24441d983ef6f4e60ba90cfe17c4