forked from sdr/gr-osmosdr
cleanup: make _samp_avail signed integer
This commit is contained in:
parent
6194958d71
commit
7ef9ebc7bb
|
@ -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) );
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ private:
|
|||
bool _running;
|
||||
|
||||
unsigned int _buf_offset;
|
||||
unsigned int _samp_avail;
|
||||
int _samp_avail;
|
||||
|
||||
bool _auto_gain;
|
||||
unsigned int _skipped;
|
||||
|
|
|
@ -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) ];
|
||||
|
||||
{
|
||||
|
|
|
@ -129,7 +129,7 @@ private:
|
|||
bool _running;
|
||||
|
||||
unsigned int _buf_offset;
|
||||
unsigned int _samp_avail;
|
||||
int _samp_avail;
|
||||
|
||||
bool _auto_gain;
|
||||
unsigned int _skipped;
|
||||
|
|
Loading…
Reference in New Issue