Merge branch 'dfsg-orig'
[debian/gnuradio] / gnuradio-core / src / lib / general / gr_head.cc
index 94a00cc68df2bfc38f57d9278506201252521934..b52735c06eb39705ea08e78a68e6005474a5f035 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -27,7 +27,7 @@
 #include <gr_io_signature.h>
 #include <string.h>
 
-gr_head::gr_head (size_t sizeof_stream_item, int nitems)
+gr_head::gr_head (size_t sizeof_stream_item, unsigned long long nitems)
   : gr_sync_block ("head",
                   gr_make_io_signature (1, 1, sizeof_stream_item),
                   gr_make_io_signature (1, 1, sizeof_stream_item)),
@@ -35,10 +35,10 @@ gr_head::gr_head (size_t sizeof_stream_item, int nitems)
 {
 }
 
-gr_block_sptr
-gr_make_head (size_t sizeof_stream_item, int nitems)
+gr_head_sptr
+gr_make_head (size_t sizeof_stream_item, unsigned long long nitems)
 {
-  return gr_block_sptr (new gr_head (sizeof_stream_item, nitems));
+  return gnuradio::get_initial_sptr(new gr_head (sizeof_stream_item, nitems));
 }
 
 int
@@ -49,7 +49,7 @@ gr_head::work (int noutput_items,
   if (d_ncopied_items >= d_nitems)
     return -1;                         // Done!
 
-  unsigned n = std::min (d_nitems - d_ncopied_items, noutput_items);
+  unsigned n = std::min (d_nitems - d_ncopied_items, (unsigned long long) noutput_items);
   
   if (n == 0)
     return 0;