From dee3774bbcad6d9db986912dd4752a0ef616ad20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 25 May 2014 20:50:07 +0100 Subject: [PATCH] fix small EClipse complaints --- C/threads.c | 4 ++-- H/Atoms.h | 3 ++- H/Tags_24bits.h | 45 ++++++++++++++++++----------------- H/Tags_32LowTag.h | 6 +++++ H/Tags_32Ops.h | 7 ++++++ H/Tags_32bits.h | 4 ++++ H/Tags_64bits.h | 6 +++++ H/Yap.h | 8 +++++++ H/clause.h | 2 +- H/inline-only.h | 2 +- H/nomachine.h | 33 ------------------------- H/threads.h | 10 +------- H/udi_private.h | 2 +- H/yapio.h | 2 +- library/dialect/swi/fli/swi.c | 4 ++-- 15 files changed, 65 insertions(+), 73 deletions(-) delete mode 100644 H/nomachine.h diff --git a/C/threads.c b/C/threads.c index 527e5777d..f79f17cc8 100755 --- a/C/threads.c +++ b/C/threads.c @@ -509,9 +509,9 @@ Yap_thread_self(void) } CELL -Yap_thread_create_engine(thread_attr *ops) +Yap_thread_create_engine(YAP_thread_attr *ops) { - thread_attr opsv; + YAP_thread_attr opsv; int new_id = allocate_new_tid(); Term t = TermNil; diff --git a/H/Atoms.h b/H/Atoms.h index d5a0f8316..152a365e5 100644 --- a/H/Atoms.h +++ b/H/Atoms.h @@ -18,12 +18,13 @@ #ifndef ATOMS_H #define ATOMS_H 1 -#undef EXTERN +#ifndef EXTERN #ifndef ADTDEFS_C #define EXTERN static #else #define EXTERN #endif +#endif #include diff --git a/H/Tags_24bits.h b/H/Tags_24bits.h index 17019fa04..4b6aa805b 100644 --- a/H/Tags_24bits.h +++ b/H/Tags_24bits.h @@ -66,9 +66,10 @@ #define YAP_PROTECTED_MASK 0x00000000L #include "inline-only.h" -INLINE_ONLY inline EXTERN int IsVarTerm (Term); -INLINE_ONLY inline EXTERN int +INLINE_ONLY int IsVarTerm (Term); + +INLINE_ONLY int IsVarTerm (Term t) { return (int) (Signed (t) >= 0); @@ -76,9 +77,9 @@ IsVarTerm (Term t) -INLINE_ONLY inline EXTERN int IsNonVarTerm (Term); +INLINE_ONLY int IsNonVarTerm (Term); -INLINE_ONLY inline EXTERN int +INLINE_ONLY int IsNonVarTerm (Term t) { return (int) (Signed (t) < 0); @@ -86,9 +87,9 @@ IsNonVarTerm (Term t) -INLINE_ONLY inline EXTERN Term *RepPair (Term); +INLINE_ONLY Term *RepPair (Term); -INLINE_ONLY inline EXTERN Term * +INLINE_ONLY Term * RepPair (Term t) { return (Term *) (NonTagPart (t)); @@ -96,9 +97,9 @@ RepPair (Term t) -INLINE_ONLY inline EXTERN Term AbsPair (Term *); +INLINE_ONLY Term AbsPair (Term *); -INLINE_ONLY inline EXTERN Term +INLINE_ONLY Term AbsPair (Term * p) { return (Term) (TAGGEDA (PairTag, (p))); @@ -106,9 +107,9 @@ AbsPair (Term * p) -INLINE_ONLY inline EXTERN Int IsPairTerm (Term); +INLINE_ONLY Int IsPairTerm (Term); -INLINE_ONLY inline EXTERN Int +INLINE_ONLY Int IsPairTerm (Term t) { return (Int) (BitOn (PairBit, (t))); @@ -116,9 +117,9 @@ IsPairTerm (Term t) -INLINE_ONLY inline EXTERN Term *RepAppl (Term); +INLINE_ONLY Term *RepAppl (Term); -INLINE_ONLY inline EXTERN Term * +INLINE_ONLY Term * RepAppl (Term t) { return (Term *) (NonTagPart (t)); @@ -126,9 +127,9 @@ RepAppl (Term t) -INLINE_ONLY inline EXTERN Term AbsAppl (Term *); +INLINE_ONLY Term AbsAppl (Term *); -INLINE_ONLY inline EXTERN Term +INLINE_ONLY Term AbsAppl (Term * p) { return (Term) (TAGGEDA (ApplTag, (p))); @@ -136,9 +137,9 @@ AbsAppl (Term * p) -INLINE_ONLY inline EXTERN Int IsApplTerm (Term); +INLINE_ONLY Int IsApplTerm (Term); -INLINE_ONLY inline EXTERN Int +INLINE_ONLY Int IsApplTerm (Term t) { return (Int) (BitOn (ApplBit, (t))); @@ -146,9 +147,9 @@ IsApplTerm (Term t) -INLINE_ONLY inline EXTERN Int IsAtomOrIntTerm (Term); +INLINE_ONLY Int IsAtomOrIntTerm (Term); -INLINE_ONLY inline EXTERN Int +INLINE_ONLY Int IsAtomOrIntTerm (Term t) { return (Int) (!(Unsigned (t) & CompBits)); @@ -157,9 +158,9 @@ IsAtomOrIntTerm (Term t) -INLINE_ONLY inline EXTERN Term AdjustPtr (Term t, Term off); +INLINE_ONLY Term AdjustPtr (Term t, Term off); -INLINE_ONLY inline EXTERN Term +INLINE_ONLY Term AdjustPtr (Term t, Term off) { return (Term) ((t) + off); @@ -167,9 +168,9 @@ AdjustPtr (Term t, Term off) -INLINE_ONLY inline EXTERN Term AdjustIDBPtr (Term t, Term off); +INLINE_ONLY Term AdjustIDBPtr (Term t, Term off); -INLINE_ONLY inline EXTERN Term +INLINE_ONLY Term AdjustIDBPtr (Term t, Term off) { return (Term) ((t) + off); diff --git a/H/Tags_32LowTag.h b/H/Tags_32LowTag.h index 563cb16f6..d6dbc1608 100644 --- a/H/Tags_32LowTag.h +++ b/H/Tags_32LowTag.h @@ -14,6 +14,8 @@ * version: $Id: Tags_32LowTag.h,v 1.4 2008-01-30 10:35:43 vsc Exp $ * *************************************************************************/ +#if FALSE /* not in use */ + #define TAG_LOW_BITS_32 1 /* Version for 32 bit addresses machines, @@ -196,3 +198,7 @@ IntOfTerm (Term t) { return (Int) (((Int) (t << 1)) >> (SHIFT_LOW_TAG + SHIFT_HIGH_TAG + 1)); } + +#endif /* currently not in use */ + + diff --git a/H/Tags_32Ops.h b/H/Tags_32Ops.h index cb9a8fa95..6c014d3f3 100644 --- a/H/Tags_32Ops.h +++ b/H/Tags_32Ops.h @@ -49,6 +49,8 @@ are now 1 in compound terms and structures. */ +#if SIZEOF_INT_P==4 + #define TAGS_FAST_OPS 1 #define SHIFT_HIGH_TAG 29 @@ -320,3 +322,8 @@ AdjustIDBPtr (Term t, Term off) #endif + +#endif /* SIZEOF_INT_P==4 */ + + + diff --git a/H/Tags_32bits.h b/H/Tags_32bits.h index 9b22bd861..325abb18d 100644 --- a/H/Tags_32bits.h +++ b/H/Tags_32bits.h @@ -37,6 +37,8 @@ property list */ +#if FALSE + #define SHIFT_HIGH_TAG 29 #define MKTAG(HI,LO) ((((UInt) (HI))<> (3 + 2)); } + +#endif /* NOT IN USE */ diff --git a/H/Tags_64bits.h b/H/Tags_64bits.h index 7eab07539..4f22e924a 100644 --- a/H/Tags_64bits.h +++ b/H/Tags_64bits.h @@ -21,6 +21,8 @@ * version: $Id: Tags_64bits.h,v 1.3 2008-05-15 13:41:46 vsc Exp $ * *************************************************************************/ +#if SIZEOF_INT_P==8 + #define TAG_64BITS 1 /* Version for 64 bit addresses machines, @@ -192,3 +194,7 @@ IntOfTerm (Term t) { return (Int) ((Int) (Unsigned (t) << 3) >> 6); } + +#endif /* 64 Bits */ + + diff --git a/H/Yap.h b/H/Yap.h index 8ecfe0b32..45689ea05 100755 --- a/H/Yap.h +++ b/H/Yap.h @@ -296,6 +296,14 @@ typedef pthread_rwlock_t rwlock_t; #define OUTSIDE(MIN,X,MAX) ((void *)(X) < (void *)(MIN) || (void *)(X) > (void *)(MAX)) #endif +/************************************************************************************************* + main exports in YapInterface.h +*************************************************************************************************/ + +/* Basic exports */ + +#include "YapDefs.h" + /************************************************************************************************* Atoms *************************************************************************************************/ diff --git a/H/clause.h b/H/clause.h index 82ddf657e..4dce4d03e 100644 --- a/H/clause.h +++ b/H/clause.h @@ -21,7 +21,7 @@ /* consulting files */ typedef union CONSULT_OBJ { - char *filename; + const char *filename; int mode; Prop p; UInt c; diff --git a/H/inline-only.h b/H/inline-only.h index da291a26b..74fea6cb4 100644 --- a/H/inline-only.h +++ b/H/inline-only.h @@ -5,7 +5,7 @@ #define INLINE_ONLY __attribute__((gnu_inline,always_inline)) //#define INLINE_ONLY #else -#define INLINE_ONLY +#define INLINE_ONLY inline EXTERN #endif #endif diff --git a/H/nomachine.h b/H/nomachine.h deleted file mode 100644 index b6fba8089..000000000 --- a/H/nomachine.h +++ /dev/null @@ -1,33 +0,0 @@ -#define SHORT_ADDRESSES 0 - -#undef SHORT_INTS - -#undef SHORT_SPACE - -#define FUNCTION_ADRESSES 0 - -#define ALIGN_LONGS 1 - -#undef LOW_ABSMI - -#define MSHIFTOFFS 1 - -#define HAVE_SIGNAL 1 - -#define UInt unsigned int -#define UShort unsigned short -#define Int int - -#define FFIEEE 1 - -#define Float float -#define FAFloat double - - -#define FunAdr(X) X - -#define MIPSEL - -#define HAVE_PROTO 1 - - diff --git a/H/threads.h b/H/threads.h index bef71e0a5..5cdad1fe1 100644 --- a/H/threads.h +++ b/H/threads.h @@ -3,20 +3,12 @@ #define THREADS_H 1 -typedef struct thread_attr_struct { - UInt ssize; - UInt tsize; - UInt sysize; - int (*cancel)(int thread); - Term egoal; -} thread_attr; - #ifdef THREADS Int Yap_thread_self(void); int Yap_get_thread_ref_count(int); void Yap_set_thread_ref_count(int,int); -CELL Yap_thread_create_engine(thread_attr *); +CELL Yap_thread_create_engine(YAP_thread_attr *); Int Yap_thread_attach_engine(int); Int Yap_thread_detach_engine(int); Int Yap_thread_destroy_engine(int); diff --git a/H/udi_private.h b/H/udi_private.h index df61dc182..699099bba 100644 --- a/H/udi_private.h +++ b/H/udi_private.h @@ -30,7 +30,7 @@ typedef struct udi_info *UdiInfo; /* to ease code for a UdiInfo hash table*/ #define HASH_FIND_UdiInfo(head,find,out) \ - HASH_FIND(hh,head,find,sizeof(PredEntry *),out) + HASH_FIND(hh,head,find,sizeof(PredEntry),out) #define HASH_ADD_UdiInfo(head,p,add) \ HASH_ADD_KEYPTR(hh,head,p,sizeof(PredEntry *),add) diff --git a/H/yapio.h b/H/yapio.h index 68d3b0560..8198a2d55 100644 --- a/H/yapio.h +++ b/H/yapio.h @@ -273,7 +273,7 @@ int Yap_GetFreeStreamDForReading(void); Term Yap_WStringToList(wchar_t *); Term Yap_WStringToListOfAtoms(wchar_t *); -Atom Yap_LookupWideAtom( wchar_t * ); +Atom Yap_LookupWideAtom( const wchar_t * ); #define YAP_INPUT_STREAM 0x01 #define YAP_OUTPUT_STREAM 0x02 diff --git a/library/dialect/swi/fli/swi.c b/library/dialect/swi/fli/swi.c index 79ec09c0b..4b31ee038 100755 --- a/library/dialect/swi/fli/swi.c +++ b/library/dialect/swi/fli/swi.c @@ -2655,7 +2655,7 @@ X_API int PL_thread_attach_engine(const PL_thread_attr_t *attr) yapt.ssize = attr->local_size; yapt.tsize = attr->global_size; - yapt.alias = (YAP_Term)attr->alias; + yapt.alias = MkAtomTerm(Yap_LookupAtom(attr->alias)); yapt.cancel = attr->cancel; wid = YAP_ThreadCreateEngine(&yapt); } else { @@ -2704,7 +2704,7 @@ PL_create_engine(const PL_thread_attr_t *attr) yapt.ssize = attr->local_size; yapt.tsize = attr->global_size; - yapt.alias = (YAP_Term)attr->alias; + yapt.alias = MkAtomTerm(Yap_LookupAtom(attr->alias)); yapt.cancel = attr->cancel; eng = YAP_ThreadCreateEngine(&yapt);