mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-30 23:03:05 +00:00 
			
		
		
		
	Fixes a bug that prevented processing of files > 4 GB. Thanks to Stephan X. Esterhuizen for sending the patch.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@415 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
		| @@ -39,7 +39,7 @@ | ||||
| using google::LogMessage; | ||||
|  | ||||
| gnss_sdr_valve::gnss_sdr_valve (size_t sizeof_stream_item, | ||||
|         int nitems, | ||||
|         unsigned long long nitems, | ||||
|         gr::msg_queue::sptr queue) : gr::sync_block("valve", | ||||
|                 gr::io_signature::make(1, 1, sizeof_stream_item), | ||||
|                 gr::io_signature::make(1, 1, sizeof_stream_item) ), | ||||
| @@ -49,7 +49,7 @@ gnss_sdr_valve::gnss_sdr_valve (size_t sizeof_stream_item, | ||||
|  | ||||
|  | ||||
| boost::shared_ptr<gr::block> gnss_sdr_make_valve (size_t sizeof_stream_item, | ||||
|         int nitems, | ||||
|         unsigned long long nitems, | ||||
|         gr::msg_queue::sptr queue) | ||||
| { | ||||
|     return boost::shared_ptr<gnss_sdr_valve> (new gnss_sdr_valve (sizeof_stream_item, nitems, queue)); | ||||
| @@ -69,9 +69,8 @@ int gnss_sdr_valve::work (int noutput_items, | ||||
|             delete cmf; | ||||
|             return -1;	// Done! | ||||
|         } | ||||
|     unsigned n = std::min(d_nitems - d_ncopied_items, noutput_items); | ||||
|     if (n == 0) | ||||
|         return 0; | ||||
|     unsigned long long n = std::min(d_nitems - d_ncopied_items, noutput_items); | ||||
|     if (n == 0) return 0; | ||||
|     memcpy (output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0)); | ||||
|     d_ncopied_items += n; | ||||
|     return n; | ||||
|   | ||||
| @@ -40,7 +40,7 @@ | ||||
|  | ||||
|  | ||||
| boost::shared_ptr<gr::block> gnss_sdr_make_valve (size_t sizeof_stream_item, | ||||
|         int nitems, | ||||
|         unsigned long long nitems, | ||||
|         gr::msg_queue::sptr queue); | ||||
| /*! | ||||
|  * \brief Implementation of a GNU Radio block that sends a STOP message to the | ||||
| @@ -49,13 +49,13 @@ boost::shared_ptr<gr::block> gnss_sdr_make_valve (size_t sizeof_stream_item, | ||||
| class gnss_sdr_valve : public gr::sync_block | ||||
| { | ||||
|     friend boost::shared_ptr<gr::block> gnss_sdr_make_valve(size_t sizeof_stream_item, | ||||
|                                                             int nitems, | ||||
|                                                             gr::msg_queue::sptr queue); | ||||
|             unsigned long long nitems, | ||||
|             gr::msg_queue::sptr queue); | ||||
|     gnss_sdr_valve (size_t sizeof_stream_item, | ||||
|                     int nitems, | ||||
|                     gr::msg_queue::sptr queue); | ||||
|     int	d_nitems; | ||||
|     int	d_ncopied_items; | ||||
|             unsigned long long nitems, | ||||
|             gr::msg_queue::sptr queue); | ||||
|     unsigned long long	d_nitems; | ||||
|     unsigned long long	d_ncopied_items; | ||||
|     gr::msg_queue::sptr d_queue; | ||||
|  | ||||
| public: | ||||
|   | ||||
| @@ -74,7 +74,7 @@ private: | ||||
|     unsigned int out_stream_; | ||||
|     std::string item_type_; | ||||
|     size_t item_size_; | ||||
|     long samples_; | ||||
|     unsigned long long samples_; | ||||
|     bool dump_; | ||||
|     std::string dump_filename_; | ||||
|     double sample_freq_in_; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez