fix a bunch of compiler warnings

This commit is contained in:
Christian Daniel 2013-02-12 15:43:18 +01:00
parent cb251d8c37
commit d8b6f05bf9
4 changed files with 17 additions and 17 deletions

View File

@ -85,7 +85,7 @@ void GLScope::newTrace(const std::vector<Complex>& trace, int sampleRate)
case ModeDerived12: {
m_trace.resize(trace.size() - 3);
std::vector<Complex>::iterator dst = m_trace.begin();
for(int i = 3; i < trace.size() ; i++) {
for(uint i = 3; i < trace.size() ; i++) {
*dst++ = Complex(
abs(trace[i] - trace[i - 1]),
abs(trace[i] - trace[i - 1]) - abs(trace[i - 2] - trace[i - 3]));
@ -153,7 +153,7 @@ void GLScope::paintGL()
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLineWidth(1.0f);
glColor4f(1, 1, 1, 0.05);
glColor4f(1, 1, 1, 0.05f);
for(int i = 1; i < 10; i++) {
glBegin(GL_LINE_LOOP);
glVertex2f(0, i * 0.1);
@ -181,7 +181,7 @@ void GLScope::paintGL()
glVertex2f(0, m_triggerLevelHigh);
glVertex2f(1, m_triggerLevelHigh);
glEnd();
glColor4f(0, 0.8, 0.0, 0.3f);
glColor4f(0, 0.8f, 0.0, 0.3f);
glBegin(GL_LINE_LOOP);
glVertex2f(0, m_triggerLevelLow);
glVertex2f(1, m_triggerLevelLow);
@ -247,7 +247,7 @@ void GLScope::paintGL()
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLineWidth(1.0f);
glColor4f(1, 1, 1, 0.05);
glColor4f(1, 1, 1, 0.05f);
for(int i = 1; i < 10; i++) {
glBegin(GL_LINE_LOOP);
glVertex2f(0, i * 0.1);
@ -275,7 +275,7 @@ void GLScope::paintGL()
glVertex2f(0, m_triggerLevelHigh);
glVertex2f(1, m_triggerLevelHigh);
glEnd();
glColor4f(0, 0.8, 0.0, 0.3f);
glColor4f(0, 0.8f, 0.0, 0.3f);
glBegin(GL_LINE_LOOP);
glVertex2f(0, m_triggerLevelLow);
glVertex2f(1, m_triggerLevelLow);

View File

@ -358,7 +358,7 @@ void GLSpectrum::paintGL()
if(m_displayChannel) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1, 0, 0, 0.15);
glColor4f(1, 0, 0, 0.15f);
glPushMatrix();
glTranslatef(m_glChannelRect.x(), m_glChannelRect.y(), 0);
glScalef(m_glChannelRect.width(), m_glChannelRect.height(), 1);
@ -433,7 +433,7 @@ void GLSpectrum::paintGL()
if(m_displayChannel) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1, 0, 0, 0.15);
glColor4f(1, 0, 0, 0.15f);
glPushMatrix();
glTranslatef(m_glChannelRect.x(), m_glChannelRect.y(), 0);
glScalef(m_glChannelRect.width(), m_glChannelRect.height(), 1);
@ -444,7 +444,7 @@ void GLSpectrum::paintGL()
glVertex2f(0, 1);
glEnd();
glDisable(GL_BLEND);
glColor3f(0.8, 0.8, 0.6);
glColor3f(0.8f, 0.8f, 0.6f);
glBegin(GL_LINE_LOOP);
glVertex2f(0.5, 0);
glVertex2f(0.5, 1);
@ -561,7 +561,7 @@ void GLSpectrum::paintGL()
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLineWidth(1.0f);
glColor4f(1, 1, 1, 0.05);
glColor4f(1, 1, 1, 0.05f);
glPushMatrix();
glTranslatef(m_glWaterfallRect.x(), m_glWaterfallRect.y(), 0);
@ -606,7 +606,7 @@ void GLSpectrum::paintGL()
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glLineWidth(1.0f);
glColor4f(1, 1, 1, 0.05);
glColor4f(1, 1, 1, 0.05f);
glPushMatrix();
glTranslatef(m_glHistogramRect.x(), m_glHistogramRect.y(), 0);
@ -1010,9 +1010,9 @@ void GLSpectrum::mouseMoveEvent(QMouseEvent* event)
newShare = (float)(event->y() - m_frequencyScaleRect.height()) / (float)height();
else newShare = 1.0 - (float)(event->y() + m_frequencyScaleRect.height()) / (float)height();
if(newShare < 0.1)
newShare = 0.1;
newShare = 0.1f;
else if(newShare > 0.8)
newShare = 0.8;
newShare = 0.8f;
m_waterfallShare = newShare;
m_changesPending = true;
update();

View File

@ -51,7 +51,7 @@ void RTLSDRGui::displaySettings()
if(m_gains.size() > 0) {
int dist = abs(m_settings.gain - m_gains[0]);
int pos = 0;
for(int i = 1; i < m_gains.size(); i++) {
for(uint i = 1; i < m_gains.size(); i++) {
if(abs(m_settings.gain - m_gains[i]) < dist) {
dist = abs(m_settings.gain - m_gains[i]);
pos = i;

View File

@ -71,8 +71,8 @@ size_t SampleFifo::write(const quint8* data, size_t count)
{
QMutexLocker mutexLocker(&m_mutex);
size_t total;
int remaining;
int len;
size_t remaining;
size_t len;
const Sample* begin = (const Sample*)data;
count /= 4;
@ -115,8 +115,8 @@ size_t SampleFifo::write(SampleVector::const_iterator begin, SampleVector::const
QMutexLocker mutexLocker(&m_mutex);
size_t count = end - begin;
size_t total;
int remaining;
int len;
size_t remaining;
size_t len;
total = MIN(count, m_size - m_fill);
if(total < count) {