Merge branch 'warnings'
authorTom Rondeau <trondeau@vt.edu>
Wed, 24 Nov 2010 22:24:58 +0000 (17:24 -0500)
committerTom Rondeau <trondeau@vt.edu>
Wed, 24 Nov 2010 22:24:58 +0000 (17:24 -0500)
config/usrp_libusb.m4
gnuradio-core/src/lib/filter/gr_single_pole_iir.h
gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h [deleted file]

index a434d379ddfb3382e1d554a7a2eb2a5797210658..cc3410f4190fc970f7568ef9fc12c823fb4f0d15 100644 (file)
@@ -24,28 +24,43 @@ dnl Boston, MA 02110-1301, USA.
 
 
 AC_DEFUN([USRP_LIBUSB], [
-  dnl Use PKGCONFIG to check for packages first, then check to
-  dnl make sure the USB_* variables work (whether from PKGCONFIG
-  dnl or overridden by the user)
-
-  dnl do not use LDFLAGS, since PKGCONFIG will provide everything
+  dnl do not use LDFLAGS, except on Windows
   saved_LDFLAGS=${LDFLAGS}
-  LDFLAGS=
-  LIBUSB_PKG_CONFIG_NAME=
+  case "$host_os" in
+    cygwin* | mingw*)
+    ;;
+    *)
+      LDFLAGS=
+    ;;
+  esac
 
-  dnl loop over various possible 'libusb' PKGCONFIG names, and choose
-  dnl the first one that meets both the user's selection (via
-  dnl configure flags) as well as what is installed
+  dnl this variable is set in usrp/usrp.pc.in as a requirement
+  dnl for libusrp; it is OK to be empty.
+  LIBUSB_PKG_CONFIG_NAME=
 
-  dnl create the list of libusb PKGCONFIG modules to test
+  dnl for Windows (cygin, mingw), do not use PKGCONFIG since LIBUSB
+  dnl does not install a .pc file.  For all other OSs, use
+  dnl PKGCONFIG to check for various package names first.
   libusb_list=''
-  if test x$1 = xyes; then
-    dnl libusb-1.0 was requested; just test for it
-    libusb_list="libusb-1.0"
-  else
-    dnl test for legacy libusb only
-    libusb_list="libusb libusb-legacy"
-  fi
+  case "$host_os" in
+    cygwin* | mingw*)
+      libusb_list='libusb'
+    ;;
+    *)
+      dnl create the list of libusb PKGCONFIG modules to test
+      if test x$1 = xyes; then
+        dnl libusb-1.0 was requested; just test for it
+        libusb_list="libusb-1.0"
+      else
+        dnl test for legacy libusb only
+        libusb_list="libusb libusb-legacy"
+      fi
+    ;;
+  esac
+
+  dnl loop over various possible 'libusb' names, and
+  dnl choose the first one that meets both the user's selection
+  dnl (via configure flags) as well as what is installed
   for libusb_name in ${libusb_list}; do
     dnl clear internal variables
     libusbok=no
@@ -54,31 +69,45 @@ AC_DEFUN([USRP_LIBUSB], [
     usb_lib_func=''
     usb_lib_name=''
 
-    dnl start checks
-    AC_MSG_NOTICE([Checking for LIBUSB version '${libusb_name}'])
-    if test ${libusb_name} = "libusb-1.0"; then
-      dnl see if the pkgconfig module is available
-      PKG_CHECK_MODULES(USB, ${libusb_name}, [
-        libusbok=yes
-        have_libusb1=yes
-        usb_header='libusb-1.0/libusb.h'
-        usb_lib_func='libusb_bulk_transfer'
-      ], [libusbok=no])
-    else
-      dnl see if the pkgconfig module is available
-      PKG_CHECK_MODULES(USB, ${libusb_name}, [
-        libusbok=yes
+    case "$host_os" in
+      cygwin* | mingw*)
+        USB_INCLUDEDIR=
+        USB_INCLUDES=
+        USB_LIBS=-lusb
         usb_header='usb.h'
         usb_lib_func='usb_bulk_write'
-      ], [libusbok=no])
-    fi
+        libusbok=yes
+      ;;
+      *)
+        dnl start checks
+        AC_MSG_NOTICE([Checking for LIBUSB version '${libusb_name}'])
+        if test ${libusb_name} = "libusb-1.0"; then
+          dnl see if the pkgconfig module is available
+          PKG_CHECK_MODULES(USB, ${libusb_name}, [
+            libusbok=yes
+            have_libusb1=yes
+            usb_header='libusb-1.0/libusb.h'
+            usb_lib_func='libusb_bulk_transfer'
+          ], [libusbok=no])
+        else
+          dnl see if the pkgconfig module is available
+          PKG_CHECK_MODULES(USB, ${libusb_name}, [
+            libusbok=yes
+            usb_header='usb.h'
+            usb_lib_func='usb_bulk_write'
+          ], [libusbok=no])
+        fi
+      ;;
+    esac
     if test $libusbok = yes; then
-      dnl PKGCONFIG found a version of LIBUSB.
+      dnl PKGCONFIG found a version of LIBUSB, or the info was
+      dnl provided by the user, or the OS is Windows.
+
       dnl Check it to make sure it meets enough criteria:
       dnl Verify that $usb_header is a valid header. If so, then
       dnl verify that $usb_lib_func can be found in the library
       dnl $usb_lib_name.  if so, verify that the symbol 'usb_debug' is
-      dnl found in the library.
+      dnl found in the library if not using Windows.
 
       dnl Check for the header.  Similar to AC_CHECK_HEADERS,
       dnl but doesn't append to known \#defines.
@@ -135,28 +164,43 @@ AC_DEFUN([USRP_LIBUSB], [
         if test $libusbok = yes; then
           if test ${libusb_name} != "libusb-1.0"; then
             dnl PKGCONFIG found a legacy version of libusb; make sure the
-            dnl variable _usb_debug is available in the found library
-            AC_LANG_PUSH(C)
-            save_CPPFLAGS="$CPPFLAGS"
-            CPPFLAGS="$USB_INCLUDES"
-            save_LIBS="$LIBS"
-            LIBS="$USB_LIBS"
-            AC_MSG_CHECKING([$libusb_name for symbol usb_debug in library $usb_lib_name])
-            AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-              extern int usb_debug;]],
-              [[usb_debug = 0;]])],
-              [libusbok=yes],[libusbok=no])
-            AC_MSG_RESULT([$libusbok])
-            LIBS="$save_LIBS"
-            CPPFLAGS="$save_CPPFLAGS"
-            AC_LANG_POP(C)
+            dnl variable _usb_debug is available in the found library.
+           dnl Do not test on Windows, since that symbol is not defined.
+            case "$host_os" in
+              cygwin* | mingw*)
+              ;;
+            *)
+              AC_LANG_PUSH(C)
+              save_CPPFLAGS="$CPPFLAGS"
+              if test x$USB_INCLUDEDIR != x; then
+                CPPFLAGS="$USB_INCLUDES"
+              fi
+              save_LIBS="$LIBS"
+              LIBS="$USB_LIBS"
+              AC_MSG_CHECKING([$libusb_name for symbol usb_debug in library $usb_lib_name])
+              AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+                extern int usb_debug;]],
+                [[usb_debug = 0;]])],
+                [libusbok=yes],[libusbok=no])
+              AC_MSG_RESULT([$libusbok])
+              LIBS="$save_LIBS"
+              CPPFLAGS="$save_CPPFLAGS"
+              AC_LANG_POP(C)
+              ;;
+            esac
           fi
         fi
       fi
     fi
     dnl if everything checks out OK, finish up
     if test $libusbok = yes; then
-      LIBUSB_PKG_CONFIG_NAME="${libusb_name}"
+      case "$host_os" in
+        cygwin* | mingw*)
+        ;;
+        *)
+          LIBUSB_PKG_CONFIG_NAME="${libusb_name}"
+        ;;
+      esac
       break
     else
       dnl something wasn't found in this LIBUSB version.
@@ -173,7 +217,9 @@ AC_DEFUN([USRP_LIBUSB], [
     dnl final error checking, mostly to create #define's
     AC_LANG_PUSH(C)
     save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$USB_INCLUDES"
+    if test x$USB_INCLUDEDIR != x; then
+      CPPFLAGS="$USB_INCLUDES"
+    fi
     dnl Check for the header.
     AC_CHECK_HEADERS([$usb_header], [], [libusbok=no])
     CPPFLAGS="$save_CPPFLAGS"
@@ -185,18 +231,20 @@ AC_DEFUN([USRP_LIBUSB], [
       dnl check for the library (again)
       AC_LANG_PUSH(C)
       save_CPPFLAGS="$CPPFLAGS"
-      CPPFLAGS="$USB_INCLUDES"
+      if test x$USB_INCLUDEDIR != x; then
+        CPPFLAGS="$USB_INCLUDES"
+      fi
       save_LIBS="$LIBS"
       LIBS="$USB_LIBS"
       AC_CHECK_LIB([$usb_lib_name], [$usb_lib_func], [], [
         libusbok=no
         AC_MSG_RESULT([USRP requires library '$usb_lib_name' with function '$usb_lib_func', which was either not found or was not usable. See http://www.libusb.org])])
-      case "$host_os" in
-        cygwin* | mingw*)
-          USB_LIBS="$LIBS"
-          ;;
-        *) ;;
-      esac
+#      case "$host_os" in
+#        cygwin* | mingw*)
+#          USB_LIBS="$LIBS"
+#          ;;
+#        *) ;;
+#      esac
       LIBS="$save_LIBS"
       CPPFLAGS="$save_CPPFLAGS"
       AC_LANG_POP(C)
index bd59e53ace25b846d75559f3115bbb2bc837a9d4..da919b35c678a93bf4279f7669e3f4b657be4779 100644 (file)
@@ -71,12 +71,12 @@ public:
     d_prev_output = 0;
   }
 
-  tap_type prev_output () { return d_prev_output; }
+  o_type prev_output () { return d_prev_output; }
     
 protected:
   tap_type     d_alpha;
   tap_type     d_one_minus_alpha;
-  tap_type     d_prev_output;
+  o_type       d_prev_output;
 };
 
 
@@ -87,7 +87,7 @@ template<class o_type, class i_type, class tap_type>
 o_type
 gr_single_pole_iir<o_type, i_type, tap_type>::filter (const i_type input)
 {
-  tap_type     output;
+  o_type       output;
 
   output = d_alpha * input + d_one_minus_alpha * d_prev_output;
   d_prev_output = output;
diff --git a/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h b/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h
deleted file mode 100644 (file)
index bd7fa33..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- * 
- * This file is part of GNU Radio
- * 
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- * 
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-/*
- * WARNING: This file is automatically generated by generate_gri_fir_XXX.py
- * Any changes made to this file will be overwritten.
- */
-
-
-#ifndef INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H
-#define INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H
-
-#include <vector>
-#include <gr_types.h>
-#include <gr_reverse.h>
-#include <string.h>
-#include <cstdio>
-
-/*!
- * \brief FIR with internal buffer for gr_complex input, 
-          gr_complex output and float taps
- * \ingroup filter
- * 
- */
-
-class gri_fir_filter_with_buffer_ccf {
-
-protected:
-  std::vector<float>   d_taps;         // reversed taps
-  gr_complex                     *d_buffer;
-  unsigned int                  d_idx;
-
-public:
-
-  // CONSTRUCTORS
-
-  /*!
-   * \brief construct new FIR with given taps.
-   *
-   * Note that taps must be in forward order, e.g., coefficient 0 is
-   * stored in new_taps[0], coefficient 1 is stored in
-   * new_taps[1], etc.
-   */
-  gri_fir_filter_with_buffer_ccf (const std::vector<float> &taps);
-
-  ~gri_fir_filter_with_buffer_ccf ();
-
-  // MANIPULATORS
-
-  /*!
-   * \brief compute a single output value.
-   *
-   * \p input is a single input value of the filter type
-   *
-   * \returns the filtered input value.
-   */
-  gr_complex filter (gr_complex input);
-
-  
-  /*!
-   * \brief compute a single output value; designed for decimating filters.
-   *
-   * \p input is a single input value of the filter type. The value of dec is the
-   *    decimating value of the filter, so input[] must have dec valid values.
-   *    The filter pushes dec number of items onto the circ. buffer before computing
-   *    a single output.
-   *
-   * \returns the filtered input value.
-   */
-  gr_complex filter (const gr_complex input[], unsigned long dec);
-
-  /*!
-   * \brief compute an array of N output values.
-   *
-   * \p input must have (n - 1 + ntaps()) valid entries.
-   * input[0] .. input[n - 1 + ntaps() - 1] are referenced to compute the output values.
-   */
-  void filterN (gr_complex output[], const gr_complex input[],
-               unsigned long n);
-
-  /*!
-   * \brief compute an array of N output values, decimating the input
-   *
-   * \p input must have (decimate * (n - 1) + ntaps()) valid entries.
-   * input[0] .. input[decimate * (n - 1) + ntaps() - 1] are referenced to 
-   * compute the output values.
-   */
-  void filterNdec (gr_complex output[], const gr_complex input[],
-                  unsigned long n, unsigned long decimate);
-
-  /*!
-   * \brief install \p new_taps as the current taps.
-   */
-  void set_taps (const std::vector<float> &taps);
-
-  // ACCESSORS
-
-  /*!
-   * \return number of taps in filter.
-   */
-  unsigned ntaps () const { return d_taps.size (); }
-
-  /*!
-   * \return current taps
-   */
-  const std::vector<float> get_taps () const
-  {
-    return gr_reverse(d_taps);
-  }
-};
-
-#endif /* INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H */