cleanup: make _samp_avail signed integer

This commit is contained in:
Dimitri Stolnikov 2012-05-27 14:32:50 +02:00
parent 6194958d71
commit 7ef9ebc7bb
4 changed files with 6 additions and 6 deletions

View File

@ -229,7 +229,7 @@ int osmosdr_src_c::work( int noutput_items,
unsigned short *buf = _buf[_buf_head] + _buf_offset;
if (noutput_items <= int(_samp_avail)) {
if (noutput_items <= _samp_avail) {
for (int i = 0; i < noutput_items; i += 2)
*out++ = gr_complex( float(*(buf + i + 0)) * (1.0f/32767.5f),
float(*(buf + i + 1)) * (1.0f/32767.5f) );
@ -237,7 +237,7 @@ int osmosdr_src_c::work( int noutput_items,
_buf_offset += noutput_items * 2;
_samp_avail -= noutput_items;
} else {
for (int i = 0; i < int(_samp_avail); i += 2)
for (int i = 0; i < _samp_avail; i += 2)
*out++ = gr_complex( float(*(buf + i + 0)) * (1.0f/32767.5f),
float(*(buf + i + 1)) * (1.0f/32767.5f) );

View File

@ -126,7 +126,7 @@ private:
bool _running;
unsigned int _buf_offset;
unsigned int _samp_avail;
int _samp_avail;
bool _auto_gain;
unsigned int _skipped;

View File

@ -259,14 +259,14 @@ int rtl_source_c::work( int noutput_items,
unsigned short *buf = _buf[_buf_head] + _buf_offset;
if (noutput_items <= int(_samp_avail)) {
if (noutput_items <= _samp_avail) {
for (int i = 0; i < noutput_items; ++i)
*out++ = _lut[ *(buf + i) ];
_buf_offset += noutput_items;
_samp_avail -= noutput_items;
} else {
for (int i = 0; i < int(_samp_avail); ++i)
for (int i = 0; i < _samp_avail; ++i)
*out++ = _lut[ *(buf + i) ];
{

View File

@ -129,7 +129,7 @@ private:
bool _running;
unsigned int _buf_offset;
unsigned int _samp_avail;
int _samp_avail;
bool _auto_gain;
unsigned int _skipped;