mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 14:04:47 -04:00
Fix signed/unsigned variables
This commit is contained in:
@@ -7,7 +7,7 @@ WaterfallPanel::WaterfallPanel() : GLPanel(), fft_size(0), waterfall_lines(0), w
|
||||
}
|
||||
}
|
||||
|
||||
void WaterfallPanel::setup(int fft_size_in, int num_waterfall_lines_in) {
|
||||
void WaterfallPanel::setup(unsigned int fft_size_in, int num_waterfall_lines_in) {
|
||||
waterfall_lines = num_waterfall_lines_in;
|
||||
fft_size = fft_size_in;
|
||||
lines_buffered.store(0);
|
||||
@@ -34,9 +34,9 @@ void WaterfallPanel::refreshTheme() {
|
||||
}
|
||||
|
||||
void WaterfallPanel::setPoints(std::vector<float> &points) {
|
||||
int halfPts = points.size()/2;
|
||||
size_t halfPts = points.size()/2;
|
||||
if (halfPts == fft_size) {
|
||||
for (int i = 0; i < fft_size; i++) {
|
||||
for (unsigned int i = 0; i < fft_size; i++) {
|
||||
this->points[i] = points[i*2+1];
|
||||
}
|
||||
} else {
|
||||
@@ -45,7 +45,7 @@ void WaterfallPanel::setPoints(std::vector<float> &points) {
|
||||
}
|
||||
|
||||
void WaterfallPanel::step() {
|
||||
int half_fft_size = fft_size / 2;
|
||||
unsigned int half_fft_size = fft_size / 2;
|
||||
|
||||
if (!bufferInitialized.load()) {
|
||||
delete waterfall_slice;
|
||||
@@ -67,7 +67,7 @@ void WaterfallPanel::step() {
|
||||
waterfall_slice[i] = (unsigned char) floor(wv * 255.0);
|
||||
}
|
||||
|
||||
int newBufSize = (half_fft_size*lines_buffered.load()+half_fft_size);
|
||||
unsigned int newBufSize = (half_fft_size*lines_buffered.load()+half_fft_size);
|
||||
if (lineBuffer[j].size() < newBufSize) {
|
||||
lineBuffer[j].resize(newBufSize);
|
||||
rLineBuffer[j].resize(newBufSize);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
class WaterfallPanel : public GLPanel {
|
||||
public:
|
||||
WaterfallPanel();
|
||||
void setup(int fft_size_in, int num_waterfall_lines_in);
|
||||
void setup(unsigned int fft_size_in, int num_waterfall_lines_in);
|
||||
void refreshTheme();
|
||||
void setPoints(std::vector<float> &points);
|
||||
void step();
|
||||
@@ -20,7 +20,7 @@ private:
|
||||
|
||||
GLuint waterfall[2];
|
||||
int waterfall_ofs[2];
|
||||
int fft_size;
|
||||
unsigned int fft_size;
|
||||
int waterfall_lines;
|
||||
unsigned char *waterfall_slice;
|
||||
std::vector<unsigned char> lineBuffer[2];
|
||||
|
||||
Reference in New Issue
Block a user