fix warnings

This commit is contained in:
Vítor Santos Costa 2014-06-19 15:09:44 +01:00
parent b111ed13f8
commit d4bffbaefd
3 changed files with 15 additions and 11 deletions

View File

@ -139,6 +139,11 @@
#undef HAVE_ENVIRON #undef HAVE_ENVIRON
#endif #endif
#endif #endif
#if __ANDROID__
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>
#include <android/log.h>
#endif
void init_sys(void); void init_sys(void);
@ -295,7 +300,8 @@ list_directory(void)
YAP_PutInSlot(sl,YAP_MkPairTerm(ti, YAP_GetFromSlot(sl))); YAP_PutInSlot(sl,YAP_MkPairTerm(ti, YAP_GetFromSlot(sl)));
} }
_findclose( hFile ); _findclose( hFile );
#elif __ANDROID__ #else
#if __ANDROID__
{ {
extern AAssetManager *assetManager; extern AAssetManager *assetManager;
const char *dirName = buf+strlen("/assets/"); const char *dirName = buf+strlen("/assets/");
@ -312,7 +318,8 @@ list_directory(void)
} }
AAssetDir_close(de); AAssetDir_close(de);
} }
#elif HAVE_OPENDIR #endif
#if HAVE_OPENDIR
{ {
DIR *de; DIR *de;
struct dirent *dp; struct dirent *dp;
@ -327,6 +334,7 @@ list_directory(void)
closedir(de); closedir(de);
} }
#endif /* HAVE_OPENDIR */ #endif /* HAVE_OPENDIR */
#endif
tf = YAP_GetFromSlot(sl); tf = YAP_GetFromSlot(sl);
return YAP_Unify(YAP_ARG2, tf); return YAP_Unify(YAP_ARG2, tf);
} }
@ -496,7 +504,7 @@ p_mktemp(void)
} }
return(YAP_Unify(YAP_ARG2,YAP_MkAtomTerm(YAP_LookupAtom(s)))); return(YAP_Unify(YAP_ARG2,YAP_MkAtomTerm(YAP_LookupAtom(s))));
#elif HAVE_MKSTEMP #elif HAVE_MKSTEMP
strcpy(tmp, "/tmp/TEST_tmpXXXXXXXX"); strcpy(tmp, "/tmp/YAP_tmpXXXXXXXX");
if(mkstemp(tmp) == -1) { if(mkstemp(tmp) == -1) {
/* return an error number */ /* return an error number */
return(YAP_Unify(YAP_ARG3, YAP_MkIntTerm(errno))); return(YAP_Unify(YAP_ARG3, YAP_MkIntTerm(errno)));
@ -519,8 +527,8 @@ static int
p_tmpnam(void) p_tmpnam(void)
{ {
#if HAVE_MKSTEMP #if HAVE_MKSTEMP
char s[22]; char s[21];
strcpy(s, "/tmp/TEST_tmpXXXXXXXX"); strcpy(s, "/tmp/YAP_tmpXXXXXXXX");
if(mkstemp(s) == -1) if(mkstemp(s) == -1)
return FALSE; return FALSE;
return YAP_Unify(YAP_ARG1,YAP_MkAtomTerm(YAP_LookupAtom(s))); return YAP_Unify(YAP_ARG1,YAP_MkAtomTerm(YAP_LookupAtom(s)));

View File

@ -493,13 +493,11 @@ setRandom(unsigned int *seedp)
#endif #endif
} }
#ifdef HAVE_SRANDOM #if HAVE_SRANDOM
srandom(seed); srandom(seed);
#else #elif HAVE_SRAND
#ifdef HAVE_SRAND
srand(seed); srand(seed);
#endif #endif
#endif
} }
uint64_t uint64_t

View File

@ -856,8 +856,6 @@ unify_prolog_flag_value(Module m, atom_t key, prolog_flag *f, term_t val)
{ case FT_BOOL: { case FT_BOOL:
if ( f->index >= 0 ) if ( f->index >= 0 )
{ unsigned int mask = (unsigned int)1 << (f->index-1); { unsigned int mask = (unsigned int)1 << (f->index-1);
char *s;
s=PL_atom_chars(key);
return PL_unify_bool_ex(val, truePrologFlag(mask) != FALSE); return PL_unify_bool_ex(val, truePrologFlag(mask) != FALSE);
} }
/*FALLTHROUGH*/ /*FALLTHROUGH*/