fix warnings

This commit is contained in:
Vítor Santos Costa 2015-02-04 12:32:38 +00:00
parent cc1702d4b5
commit e29b7afa1b
7 changed files with 201 additions and 96 deletions

View File

@ -116,6 +116,14 @@ close_tstring( char *p USES_REGS ) {
static inline seq_type_t
mod_to_type( Term mod USES_REGS )
{
// see pl-incl.h
#ifndef DBLQ_CHARS
#define DBLQ_CHARS (0x0004) /* "ab" --> ['a', 'b'] */
#define DBLQ_ATOM (0x0008) /* "ab" --> 'ab' */
#define DBLQ_STRING (0x0010) /* "ab" --> "ab" */
#define DBLQ_MASK (DBLQ_CHARS|DBLQ_ATOM|DBLQ_STRING)
#endif
unsigned int flags = Yap_GetModuleEntry(mod)->flags;
if (flags & DBLQ_ATOM) {
return YAP_STRING_ATOM;

View File

@ -857,6 +857,9 @@
/* Define to 1 if you have the <sys/ucontext.h> header file. */
#undef HAVE_SYS_UCONTEXT_H
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
/* Define to 1 if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H

251
configure vendored
View File

@ -700,6 +700,7 @@ ARCHIVE_CPPFLAGS
ARCHIVE_LIBS
ARCHIVE_PLTARGETS
ARCHIVE_TARGETS
CLIB_FLAGS_LIBUUID
CLIB_LIBUUID
CLIB_CRYPTOBJ
CLIB_CRYPTLIBS
@ -724,6 +725,7 @@ JITLD
JITFLAGS
LLVM_CONFIG
MYDDAS_LIBS
MYDDAS_CPPFLAGS
PKG_MYDDAS
EXTRA_LIBS_FOR_SWIDLLS
CLIB_PTHREADS
@ -901,7 +903,10 @@ with_stack_space
with_trail_space
with_max_workers
with_max_threads
with_myddas
enable_myddas
with_mysql
with_odbc
with_sqlite3
enable_myddas_stats
enable_myddas_top_level
enable_jit
@ -912,7 +917,6 @@ with_rfc2045_version
enable_mimecharset
with_time
with_libarchive
with_odbc
with_cudd
enable_bddlib
with_cplint
@ -1577,6 +1581,7 @@ Optional Features:
--enable-april compile Yap to support April ILP system
--enable-dlcompat use dlcompat library for dynamic loading on Mac OS X
--enable-horus enable CLPBN HORUS library.
--enable-myddas[=DIR] with the MYDDAS library
--enable-myddas-stats enable the MYDDAS library statistics support
--enable-myddas-top-level enable the MYDDAS top-level support to MySQL
--enable-jit support just-in-time (JIT) compilation
@ -1599,7 +1604,9 @@ Optional Packages:
--with-trail-space=space default trail size in Kbytes
--with-max-workers=integer maximum number of or-parallel processes
--with-max-threads=integer maximum number of or-parallel processes
--with-myddas[=DIR] with the MYDDAS library
--with-mysql[=DIR] with the MYSQL library
--with-odbc[=DIR] with an ODBC library
--with-sqlite3[=DIR] with an SQLITE3 library
--without-time Exclude alarm library
--with-libarchive=DIR libarchive package
@ -4633,8 +4640,8 @@ if test "${with_gmp+set}" = set; then :
elif test "$withval" = no; then
yap_cv_gmp=no
else
yap_cv_gmp="$with_gmp"
GMPDIR="$with_gmp"
yap_cv_gmp="$withval"
GMPDIR="$withval"
LDFLAGS="$LDFLAGS -L${yap_cv_gmp}/lib"
LIBS="$LIBS -L${yap_cv_gmp}/lib"
CPPFLAGS="$CPPFLAGS -I${yap_cv_gmp}/include"
@ -8252,7 +8259,7 @@ fi
done
for ac_header in sys/ucontext.h sys/un.h sys/wait.h
for ac_header in sys/ucontext.h sys/uio.h sys/un.h sys/wait.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@ -10312,34 +10319,88 @@ fi
MYDDAS_VERSION=0.9.1
MYDDAS_VERSION=0.9.2
cat >>confdefs.h <<_ACEOF
#define MYDDAS_VERSION $MYDDAS_VERSION
_ACEOF
OLD_LIBS="$LIBS"
OLD_CPPFLAGS="$CPPFLAGS"
MYDDAS_CPPFLAGS=""
# Check whether --with-myddas was given.
if test "${with_myddas+set}" = set; then :
withval=$with_myddas; if test "$withval" = yes; then
# Check whether --enable-myddas was given.
if test "${enable_myddas+set}" = set; then :
enableval=$enable_myddas; if test "$withval" = yes; then
yap_cv_myddas=/usr
elif test "$withval" = no; then
yap_cv_myddas=no
else
yap_cv_myddas=$with_myddas
yap_cv_myddas=$withval
LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib "
CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include "
ODBC_LDFLAGS="-L${yap_cv_myddas}/lib "
ODBC_CFLAGS="-I${yap_cv_myddas}/include "
SQLITE3_LDFLAGS="-L${yap_cv_myddas}/lib "
SQLITE3_CFLAGS="-I${yap_cv_myddas}/include "
fi
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_myddas}/include "
fi
else
yap_cv_myddas=/usr
fi
# Check whether --with-mysql was given.
if test "${with_mysql+set}" = set; then :
withval=$with_mysql; if test "$withval" = yes; then
yap_cv_mysql=/usr
elif test "$withval" = no; then
yap_cv_mysql=no
else
yap_cv_mysql=$withval
LDFLAGS="$LDFLAGS -L${yap_cv_mysql}/lib "
CPPFLAGS="$CPPFLAGS -I${yap_cv_mysql}/include "
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_mysql}/include "
fi
else
yap_cv_mysql=/usr
fi
# Check whether --with-odbc was given.
if test "${with_odbc+set}" = set; then :
withval=$with_odbc; if test "$withval" = yes; then
yap_cv_odbc=/usr
elif test "$withval" = no; then
yap_cv_odbc=no
else
yap_cv_odbc=$withval
LDFLAGS="$LDFLAGS -L${yap_cv_odbc}/lib "
CPPFLAGS="$CPPFLAGS -I${yap_cv_odbc}/include "
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_odbc}/include "
fi
else
yap_cv_odbc=/usr
fi
# Check whether --with-sqlite3 was given.
if test "${with_sqlite3+set}" = set; then :
withval=$with_sqlite3; if test "$withval" = yes; then
yap_cv_sqlite3=/usr
elif test "$withval" = no; then
yap_cv_sqlite3=no
else
yap_cv_sqlite3=$withval
LDFLAGS="$LDFLAGS -L${yap_cv_sqlite3}/lib "
CPPFLAGS="$CPPFLAGS -I${yap_cv_sqlite3}/include "
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_sqlite3}/include "
fi
else
yap_cv_sqlite3=/usr
fi
# Check whether --enable-myddas-stats was given.
if test "${enable_myddas_stats+set}" = set; then :
enableval=$enable_myddas_stats; if test "$yap_cv_myddas" = no; then
@ -10367,8 +10428,7 @@ fi
if test "$yap_cv_myddas" != "no"
then
PKG_MYDDAS="packages/myddas"
OLD_LIBS="$LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mysql_init" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mysql_init" >&5
$as_echo_n "checking for library containing mysql_init... " >&6; }
if ${ac_cv_search_mysql_init+:} false; then :
$as_echo_n "(cached) " >&6
@ -10448,7 +10508,6 @@ done
case "$target_os" in
*darwin*)
LIBS="$LIBS -framework CoreFoundation"
MYDDAS_LIBS="$MYDDAS_LIBS -framework CoreFoundation"
;;
**)
;;
@ -10511,9 +10570,9 @@ else
yap_cv_odbc="no"
fi
if test "$yap_cv_odbc" = yes
if test "$yap_cv_odbc" != no
then
MYDDAS_LIBS="$MYDDAS_LIBS -lodbc"
LIBS="$LIBS -lodbc"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SQLAllocHandle" >&5
$as_echo_n "checking for library containing SQLAllocHandle... " >&6; }
@ -10573,9 +10632,9 @@ else
yap_cv_odbc="no"
fi
if test "$yap_cv_odbc" = yes
if test "$yap_cv_odbc" != no
then
MYDDAS_LIBS="$MYDDAS_LIBS -liodbc"
LIBS="$LIBS -liodbc"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SQLAllocHandle" >&5
$as_echo_n "checking for library containing SQLAllocHandle... " >&6; }
@ -10635,9 +10694,9 @@ else
yap_cv_odbc="no"
fi
if test "$yap_cv_odbc" = yes
if test "$yap_cv_odbc" != no
then
MYDDAS_LIBS="$MYDDAS_LIBS -lodbc32"
LIBS="$LIBS -lodbc32"
fi
fi
fi
@ -10661,27 +10720,18 @@ if test "x$ac_cv_header_sql_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SQL_H 1
_ACEOF
yap_cv_odbc="yes"
else
yap_cv_odbc="no"
fi
done
if test "$yap_cv_odbc" = yes
if test "$yap_cv_odbc" != no
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
fi
if test "$myddasstats" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_STATS"
fi
if test "$myddastoplevel" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_TOP_LEVEL"
fi
#from SWI PROSQLITE library.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5
$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; }
@ -10720,7 +10770,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5
$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; }
if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then :
MYDDAS_LIBS="-lsqlite3 $MYDDAS_LIBS"
LIBS="-lsqlite3 $LIBS"
havelib=yes
fi
@ -10740,12 +10790,24 @@ fi
done
if test "$yap_cv_odbc" = yes
if test "$yap_cv_sqlite3" != no
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_SQLITE3"
fi
if test "$myddasstats" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_STATS"
fi
if test "$myddastoplevel" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_TOP_LEVEL"
fi
MYDDAS_LIBS="$LIBS"
LIBS="$OLD_LIBS"
CPPFLAGS="$OLD_CPPFLAGS"
else
ENABLE_MYDDAS=""
fi
@ -10770,6 +10832,7 @@ fi
# Check whether --enable-jit was given.
@ -11739,6 +11802,7 @@ fi
CLIB_TARGETS="socket.$SO cgi.$SO memfile.$SO files.$SO mime.$SO crypt.$SO time.$SO"
case "$PLARCH" in
@ -11918,7 +11982,69 @@ fi
fi
dl to be installed in various places.
# brew in OSX
if test -d /usr/local/opt/ossp-uuid; then
CPPFLAGS="$CPPFLAGS -I /usr/local/opt/ossp-uuid/include"
UUID_LIB_PATH="-L /usr/local/opt/ossp-uuid/lib"
fi
# /opt
if test -d /opt/include/ossp; then
CPPFLAGS="$CPPFLAGS -I /opt/include"
UUID_LIB_PATH="-L /opt/lib"
fi
# /usr/local
if test -d /opt/include/ossp; then
CPPFLAGS="$CPPFLAGS -I /opt/include"
UUID_LIB_PATH="-L /opt/lib"
fi
if test x"$UUID_H" = "x"; then
ac_fn_c_check_header_compile "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "/*first*/
"
if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
UUID_H=ossp/uuid.h
has_uuid=true
fi
fi
if test x"$UUID_H" = "x" -a ! -d /usr/include/uuid; then
ac_fn_c_check_header_compile "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "/*first*/
"
if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
UUID_H=uuid/uuid.h
has_uuid=true
fi
fi
if test x"$UUID_H" = "x"; then
ac_fn_c_check_header_compile "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "/*first*/
"
if test "x$ac_cv_header_uuid_h" = xyes; then :
UUID_H=uuid.h
has_uuid=true
fi
fi
if test x"$UUID_H" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find uuid.h -- dropping uuid.pl" >&5
$as_echo "$as_me: WARNING: Cannot find uuid.h -- dropping uuid.pl" >&2;}
else
cat >>confdefs.h <<_ACEOF
#define UUID_H <$UUID_H>
_ACEOF
has_uuid=true
fi
if test x"$has_uuid" != "x"; then
ac_fn_c_check_func "$LINENO" "uuid_create" "ac_cv_func_uuid_create"
if test "x$ac_cv_func_uuid_create" = xyes; then :
has_uuid=true
@ -11962,7 +12088,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_create" >&5
$as_echo "$ac_cv_lib_uuid_uuid_create" >&6; }
if test "x$ac_cv_lib_uuid_uuid_create" = xyes; then :
CLIB_LIBUUID=-luuid
CLIB_LIBUUID="$UUID_LIB_PATH -luuid"
has_uuid=true
fi
@ -11976,45 +12102,6 @@ $as_echo "$as_me: WARNING: Cannot find libossp-uuid or libuuid -- dropping uuid
fi
if test x"$has_uuid" != "x"; then
if test x"$UUID_H" = "x"; then
ac_fn_c_check_header_compile "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "/*first*/
"
if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
UUID_H=ossp/uuid.h
fi
fi
if test x"$UUID_H" = "x" -a ! -d /usr/include/uuid; then
ac_fn_c_check_header_compile "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "/*first*/
"
if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
UUID_H=uuid/uuid.h
fi
fi
if test x"$UUID_H" = "x"; then
ac_fn_c_check_header_compile "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "/*first*/
"
if test "x$ac_cv_header_uuid_h" = xyes; then :
UUID_H=uuid.h
fi
fi
if test x"$UUID_H" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find uuid.h -- dropping uuid.pl" >&5
$as_echo "$as_me: WARNING: Cannot find uuid.h -- dropping uuid.pl" >&2;}
else
cat >>confdefs.h <<_ACEOF
#define UUID_H <$UUID_H>
_ACEOF
CLIB_TARGETS="$CLIB_TARGETS uuid.$SO"
fi
fi
@ -14255,7 +14342,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 14258 "configure" */
/* #line 14345 "configure" */
public class Test {
}
EOF
@ -14431,7 +14518,7 @@ EOF
if uudecode$EXEEXT Test.uue; then
ac_cv_prog_uudecode_base64=yes
else
echo "configure: 14434: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: 14521: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5
cat Test.uue >&5
ac_cv_prog_uudecode_base64=no
@ -14562,7 +14649,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 14565 "configure" */
/* #line 14652 "configure" */
public class Test {
}
EOF
@ -14597,7 +14684,7 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
/* [#]line 14600 "configure" */
/* [#]line 14687 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);

View File

@ -280,8 +280,8 @@ AC_ARG_WITH(gmp,
elif test "$withval" = no; then
yap_cv_gmp=no
else
yap_cv_gmp="$with_gmp"
GMPDIR="$with_gmp"
yap_cv_gmp="$withval"
GMPDIR="$withval"
LDFLAGS="$LDFLAGS -L${yap_cv_gmp}/lib"
LIBS="$LIBS -L${yap_cv_gmp}/lib"
CPPFLAGS="$CPPFLAGS -I${yap_cv_gmp}/include"
@ -1316,7 +1316,7 @@ AC_CHECK_HEADERS(sys/mman.h sys/ndir.h sys/param.h)
AC_CHECK_HEADERS(sys/resource.h sys/select.h)
AC_CHECK_HEADERS(sys/shm.h sys/socket.h sys/stat.h)
AC_CHECK_HEADERS(sys/time.h sys/times.h sys/types.h)
AC_CHECK_HEADERS(sys/ucontext.h sys/un.h sys/wait.h)
AC_CHECK_HEADERS(sys/ucontext.h sys/uio.h sys/un.h sys/wait.h)
AC_CHECK_HEADERS(time.h ucontext.h unistd.h utime.h)
AC_CHECK_HEADERS(wctype.h)
AC_CHECK_HEADERS(zlib.h zutil.h)

View File

@ -23,7 +23,7 @@ SHAREDIR=$(ROOTDIR)/share
#
#
CXX=@CXX@
CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I. -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../os -I "@GECODE_INCLUDES@"
CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I. -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../os -I @GECODE_INCLUDES@
#
#
# You shouldn't need to change what follows.

View File

@ -210,11 +210,11 @@ myddas_stat_end_query( MYDDAS_STATS_TIME start )
return diff;
}
/*
#ifdef MYDDAS_STATS
/* measure transfer time */
static void
myddas_stat_transfer_query( MYDDAS_STATS_TIME diff )
{
#ifdef MYDDAS_STATS_DISABLED
/* Measure time spent by the sqlite3 Server
transferring the result of the last query
back to the client */
@ -226,7 +226,7 @@ myddas_stat_transfer_query( MYDDAS_STATS_TIME diff )
MYDDAS_STATS_INITIALIZE_TIME_STRUCT(diff,time_copy);
myddas_stats_subtract_time(diff,end,start);
diff = myddas_stats_time_copy_to_final(diff);
diff = MYDDAS_STATS_TIME_copy_to_final(diff);
MYDDAS_FREE(end,struct myddas_stats_time_struct);
MYDDAS_FREE(start,struct myddas_stats_time_struct);
@ -252,7 +252,8 @@ myddas_stat_transfer_query( MYDDAS_STATS_TIME diff )
/* This is only works if we use sqlite3_store_result */
MyddasUInt numberRows = sqlite3_num_rows(res_set);
MyddasUInt rows;
myddas_stat_transfer_query( diff );
MYDDAS_STATS_CON_GET_TOTAL_ROWS(node,rows);
numberRows = numberRows + rows;
MYDDAS_STATS_CON_SET_TOTAL_ROWS(node,numberRows);
@ -283,8 +284,8 @@ myddas_stat_transfer_query( MYDDAS_STATS_TIME diff )
MYDDAS_STATS_CON_GET_TOTAL_BYTES_TRANSFERING_FROM_DBSERVER_COUNT(node,count);
MYDDAS_STATS_CON_SET_TOTAL_BYTES_TRANSFERING_FROM_DBSERVER_COUNT(node,++count);
}
#endif
}
#endif
/* db_query: SQLQuery x ResultSet x connection */
static Int
@ -634,14 +635,18 @@ c_sqlite3_row( USES_REGS1 ) {
list = arg_list_args;
arity = IntegerOfTerm(arg_arity);
sqlite3 *db = res_set->db;
if (res_set->stmt == NULL ) {
CACHE_REGS
Int indx = IntegerOfTerm(EXTRA_CBACK_CUT_ARG(Term,2));
Int rc = true;
// data needs to be copied to Prolog
// row by row
while (indx/arity < res_set->nrows)
#ifdef MYDDAS_STATS
MYDDAS_STATS_TIME diff;
MYDDAS_STATS_INITIALIZE_TIME_STRUCT(diff,time_copy);
#endif
while (indx/arity < res_set->nrows)
{
for (i = 0; i < arity; i++)
{
@ -654,6 +659,9 @@ c_sqlite3_row( USES_REGS1 ) {
if (rc)
return rc;
}
#ifdef MYDDAS_STATS
myddas_stat_transfer_query( diff );
#endif
cut_fail();
}
// busy-waiting
@ -721,7 +729,6 @@ c_sqlite3_row( USES_REGS1 ) {
#ifdef MYDDAS_STATS
end = myddas_stats_walltime();
MYDDAS_STATS_INITIALIZE_TIME_STRUCT(diff,time_copy);
myddas_stats_subtract_time(diff,end,start);
diff = myddas_stats_time_copy_to_final(diff);

View File

@ -180,8 +180,8 @@ extern BPLONG toam_signal_vec;
#define unify YAP_UnifyINT
extern inline INLINE_ONLY YAP_UnifyINT(YAP_Term t1, YAP_Term t2);
extern inline INLINE_ONLY YAP_UnifyINT(YAP_Term t1, YAP_Term t2) { return YAP_Unify(t1,t2); }
extern inline INLINE_ONLY int YAP_UnifyINT(YAP_Term t1, YAP_Term t2);
extern inline INLINE_ONLY int YAP_UnifyINT(YAP_Term t1, YAP_Term t2) { return YAP_Unify(t1,t2); }
INLINE_ONLY extern inline char *
bp_term_2_string(TERM t)