From 0a6472fe170438016c23c71d9129e627f26cd398 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 22 Mar 2002 19:45:46 +0000 Subject: Fixed compiler options and warnings. Proper parameter types. Cleanup. --- configure | 208 +++++++++++++++++++++++++++--------------------------- configure.in | 2 + include/hci_lib.h | 8 +-- src/Makefile.am | 2 +- src/Makefile.in | 3 +- src/hci.c | 24 ++++--- 6 files changed, 127 insertions(+), 120 deletions(-) diff --git a/configure b/configure index 1306bc69..d15a5324 100755 --- a/configure +++ b/configure @@ -950,10 +950,12 @@ fi +CFLAGS="-Wall -g -O2" + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:957: checking for $ac_word" >&5 +echo "configure:959: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -983,7 +985,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:987: checking for $ac_word" >&5 +echo "configure:989: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1034,7 +1036,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1038: checking for $ac_word" >&5 +echo "configure:1040: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1066,7 +1068,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1070: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1072: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1077,12 +1079,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1081 "configure" +#line 1083 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1108,12 +1110,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1112: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1114: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1117: checking whether we are using GNU C" >&5 +echo "configure:1119: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1122,7 +1124,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1141,7 +1143,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1145: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1147: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1175,7 +1177,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1179: checking for $ac_word" >&5 +echo "configure:1181: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1214,7 +1216,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1218: checking for a BSD compatible install" >&5 +echo "configure:1220: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1267,12 +1269,12 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1271: checking for Cygwin environment" >&5 +echo "configure:1273: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1300,19 +1302,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1304: checking for mingw32 environment" >&5 +echo "configure:1306: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1329,7 +1331,7 @@ echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1333: checking how to run the C preprocessor" >&5 +echo "configure:1335: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1344,13 +1346,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1361,13 +1363,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1378,13 +1380,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1484,7 +1486,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1488: checking host system type" >&5 +echo "configure:1490: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1505,7 +1507,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1509: checking build system type" >&5 +echo "configure:1511: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1534,7 +1536,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1538: checking for ld used by GCC" >&5 +echo "configure:1540: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1564,10 +1566,10 @@ echo "configure:1538: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1568: checking for GNU ld" >&5 +echo "configure:1570: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1571: checking for non-GNU ld" >&5 +echo "configure:1573: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1602,7 +1604,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1606: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1608: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1619,7 +1621,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1623: checking for $LD option to reload object files" >&5 +echo "configure:1625: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1631,7 +1633,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1635: checking for BSD-compatible nm" >&5 +echo "configure:1637: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1669,7 +1671,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1673: checking whether ln -s works" >&5 +echo "configure:1675: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1690,7 +1692,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1694: checking how to recognise dependant libraries" >&5 +echo "configure:1696: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1863,13 +1865,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1867: checking for object suffix" >&5 +echo "configure:1869: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1889,7 +1891,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1893: checking for executable suffix" >&5 +echo "configure:1895: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1899,7 +1901,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1930,7 +1932,7 @@ fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6 -echo "configure:1934: checking command to parse $NM output" >&5 +echo "configure:1936: checking command to parse $NM output" >&5 if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2006,10 +2008,10 @@ void nm_test_func(){} int main(){nm_test_var='a';nm_test_func();return(0);} EOF - if { (eval echo configure:2010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. nlist=conftest.nm - if { (eval echo configure:2013: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then + if { (eval echo configure:2015: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -2060,7 +2062,7 @@ EOF save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo configure:2064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo configure:2066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" @@ -2106,17 +2108,17 @@ for ac_hdr in dlfcn.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2110: checking for $ac_hdr" >&5 +echo "configure:2112: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2151,7 +2153,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2155: checking for ${ac_tool_prefix}file" >&5 +echo "configure:2157: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2213,7 +2215,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2217: checking for file" >&5 +echo "configure:2219: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2284,7 +2286,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2288: checking for $ac_word" >&5 +echo "configure:2290: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2316,7 +2318,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2320: checking for $ac_word" >&5 +echo "configure:2322: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2351,7 +2353,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2355: checking for $ac_word" >&5 +echo "configure:2357: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2383,7 +2385,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2387: checking for $ac_word" >&5 +echo "configure:2389: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2432,8 +2434,8 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2436 "configure"' > conftest.$ac_ext - if { (eval echo configure:2437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2438 "configure"' > conftest.$ac_ext + if { (eval echo configure:2439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2454,7 +2456,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2458: checking whether the C compiler needs -belf" >&5 +echo "configure:2460: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2467,14 +2469,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2587,7 +2589,7 @@ set dummy $CC compiler="$2" echo $ac_n "checking for objdir""... $ac_c" 1>&6 -echo "configure:2591: checking for objdir" >&5 +echo "configure:2593: checking for objdir" >&5 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -2614,7 +2616,7 @@ test -z "$pic_mode" && pic_mode=default # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:2618: checking for $compiler option to produce PIC" >&5 +echo "configure:2620: checking for $compiler option to produce PIC" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2766,21 +2768,21 @@ else # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6 -echo "configure:2770: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 +echo "configure:2772: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* case $host_os in hpux9* | hpux10* | hpux11*) @@ -2832,7 +2834,7 @@ if test -n "$lt_cv_prog_cc_shlib"; then fi echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6 -echo "configure:2836: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 +echo "configure:2838: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2840,14 +2842,14 @@ else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_prog_cc_static_works=yes else @@ -2874,7 +2876,7 @@ can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 -echo "configure:2878: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo "configure:2880: checking if $compiler supports -c -o file.$ac_objext" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2893,7 +2895,7 @@ chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no -if { (eval echo configure:2897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then +if { (eval echo configure:2899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then @@ -2922,7 +2924,7 @@ echo "$ac_t""$compiler_c_o" 1>&6 if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6 -echo "configure:2926: checking if $compiler supports -c -o file.lo" >&5 +echo "configure:2928: checking if $compiler supports -c -o file.lo" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2931,14 +2933,14 @@ else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -2968,7 +2970,7 @@ hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 -echo "configure:2972: checking if we can lock with hard links" >&5 +echo "configure:2974: checking if we can lock with hard links" >&5 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no @@ -2987,20 +2989,20 @@ fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6 -echo "configure:2991: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo "configure:2993: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -3027,7 +3029,7 @@ fi # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6 -echo "configure:3031: checking whether the linker ($LD) supports shared libraries" >&5 +echo "configure:3033: checking whether the linker ($LD) supports shared libraries" >&5 allow_undefined_flag= no_undefined_flag= @@ -3643,7 +3645,7 @@ test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 -echo "configure:3647: checking how to hardcode library paths into programs" >&5 +echo "configure:3649: checking how to hardcode library paths into programs" >&5 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then @@ -3671,7 +3673,7 @@ echo "$ac_t""$hardcode_action" 1>&6 striplib= old_striplib= echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 -echo "configure:3675: checking whether stripping libraries is possible" >&5 +echo "configure:3677: checking whether stripping libraries is possible" >&5 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" @@ -3685,7 +3687,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 -echo "configure:3689: checking dynamic linker characteristics" >&5 +echo "configure:3691: checking dynamic linker characteristics" >&5 library_names_spec= libname_spec='lib$name' soname_spec= @@ -4071,7 +4073,7 @@ test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 -echo "configure:4075: checking if libtool supports shared libraries" >&5 +echo "configure:4077: checking if libtool supports shared libraries" >&5 echo "$ac_t""$can_build_shared" 1>&6 if test "$hardcode_action" = relink; then @@ -4110,7 +4112,7 @@ else *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4114: checking for dlopen in -ldl" >&5 +echo "configure:4116: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4118,7 +4120,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4148,12 +4150,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4152: checking for dlopen" >&5 +echo "configure:4154: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4194,12 +4196,12 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "configure:4198: checking for shl_load" >&5 +echo "configure:4200: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -4240,7 +4242,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "configure:4244: checking for dlopen in -lsvld" >&5 +echo "configure:4246: checking for dlopen in -lsvld" >&5 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4248,7 +4250,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsvld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4278,7 +4280,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:4282: checking for shl_load in -ldld" >&5 +echo "configure:4284: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4286,7 +4288,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4350,7 +4352,7 @@ fi LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4354: checking whether a program can dlopen itself" >&5 +echo "configure:4356: checking whether a program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4360,7 +4362,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in @@ -4444,7 +4446,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4448: checking whether a statically linked program can dlopen itself" >&5 +echo "configure:4450: checking whether a statically linked program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4454,7 +4456,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + if { (eval echo configure:4521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in @@ -4564,14 +4566,14 @@ if test "$enable_shared" = yes && test "$GCC" = yes; then # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 -echo "configure:4568: checking whether -lc should be explicitly linked in" >&5 +echo "configure:4570: checking whether -lc should be explicitly linked in" >&5 if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext - if { (eval echo configure:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:4577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext @@ -4584,7 +4586,7 @@ else libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= - if { (eval echo configure:4588: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } + if { (eval echo configure:4590: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } then lt_cv_archive_cmds_need_lc=no else diff --git a/configure.in b/configure.in index 442f19ff..ae9aa5a7 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,8 @@ AC_PREFIX_DEFAULT(/usr) AC_SUBST(LD) AC_SUBST(AR) +CFLAGS="-Wall -g -O2" + AC_PROG_CC AC_PROG_RANLIB AC_PROG_INSTALL diff --git a/include/hci_lib.h b/include/hci_lib.h index c590150d..ed3306ab 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -56,16 +56,16 @@ int hci_close_dev(int dd); int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param); int hci_send_req(int dd, struct hci_request *req, int timeout); -int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to); -int hci_disconnect(int dd, int hndl, int res, int to); +int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); +int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to); -int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to); +int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); +int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); char *hci_dtypetostr(int type); diff --git a/src/Makefile.am b/src/Makefile.am index cc7b582b..b1c657e0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,4 +7,4 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c libbluetooth_la_LDFLAGS = -version-info 1:0:0 -CFLAGS += -I../include +AM_CFLAGS = -I../include diff --git a/src/Makefile.in b/src/Makefile.in index 6da2db02..530d0757 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -85,7 +85,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c libbluetooth_la_LDFLAGS = -version-info 1:0:0 -CFLAGS = -I../include +AM_CFLAGS = -I../include mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) @@ -97,6 +97,7 @@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libbluetooth_la_LIBADD = libbluetooth_la_OBJECTS = bluetooth.lo hci.lo +CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) diff --git a/src/hci.c b/src/hci.c index cd65a296..3e1dd52e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -511,7 +511,7 @@ done: return 0; } -int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to) +int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to) { evt_conn_complete rp; create_conn_cp cp; @@ -519,8 +519,9 @@ int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to) memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, ba); - cp.pkt_type = ptype; - cp.role_switch = rswitch; + cp.pkt_type = ptype; + cp.clock_offset = clkoffset; + cp.role_switch = rswitch; rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_CREATE_CONN; @@ -538,18 +539,19 @@ int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to) return -1; } - return rp.handle; + *handle = rp.handle; + return 0; } -int hci_disconnect(int dd, int hndl, int res, int to) +int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) { evt_disconn_complete rp; disconnect_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - cp.handle = hndl; - cp.reason = res; + cp.handle = handle; + cp.reason = reason; rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_DISCONNECT; @@ -622,14 +624,14 @@ int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) return 0; } -int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to) +int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) { evt_read_remote_features_complete rp; read_remote_features_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - cp.handle = hndl; + cp.handle = handle; rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_READ_REMOTE_FEATURES; @@ -651,14 +653,14 @@ int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to) return 0; } -int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to) +int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to) { evt_read_remote_version_complete rp; read_remote_version_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - cp.handle = hndl; + cp.handle = handle; rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_READ_REMOTE_VERSION; -- cgit