Commit 70ef4f0d authored by Csaba Kertész's avatar Csaba Kertész Committed by Jasem Mutlaq

Smaller fixes found by Clang compiler

parent 57b83158
......@@ -50,7 +50,7 @@ KSDssImage::KSDssImage( const QString &fileName )
m_Image = reader.read();
}
KSDssImage::Metadata::Metadata() : valid( false ), height( 0. ), width( 0. ),
band( '?' ), gen( -1 )
KSDssImage::Metadata::Metadata() : height( 0. ), width( 0. ),
band( '?' ), gen( -1 ), valid( false )
{
}
......@@ -3886,7 +3886,6 @@ class QCP_LIB_DECL QCPAbstractPlottable : public QCPLayerable
void setSelectionDecorator(QCPSelectionDecorator * decorator);
// introduced virtual methods:
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant * details=0) const = 0;
virtual QCPPlottableInterface1D * interface1D()
{
return 0;
......@@ -4068,7 +4067,7 @@ class QCP_LIB_DECL QCPItemPosition : public QCPItemAnchor
return mValueAxis.data();
}
QCPAxisRect * axisRect() const;
virtual QPointF pixelPosition() const;
virtual QPointF pixelPosition() const Q_DECL_OVERRIDE;
// setters:
void setType(PositionType type);
......@@ -4464,7 +4463,7 @@ class QCP_LIB_DECL QCustomPlot : public QWidget
virtual QSize sizeHint() const Q_DECL_OVERRIDE;
virtual void paintEvent(QPaintEvent * event) Q_DECL_OVERRIDE;
virtual void resizeEvent(QResizeEvent * event) Q_DECL_OVERRIDE;
bool event( QEvent * event );
virtual bool event( QEvent * event ) Q_DECL_OVERRIDE;
virtual void mouseDoubleClickEvent(QMouseEvent * event) Q_DECL_OVERRIDE;
virtual void mousePressEvent(QMouseEvent * event) Q_DECL_OVERRIDE;
virtual void mouseMoveEvent(QMouseEvent * event) Q_DECL_OVERRIDE;
......@@ -7166,16 +7165,16 @@ class QCP_LIB_DECL QCPErrorBars : public QCPAbstractPlottable, public QCPPlottab
void addData(double errorMinus, double errorPlus);
// virtual methods of 1d plottable interface:
virtual int dataCount() const;
virtual double dataMainKey(int index) const;
virtual double dataSortKey(int index) const;
virtual double dataMainValue(int index) const;
virtual QCPRange dataValueRange(int index) const;
virtual QPointF dataPixelPosition(int index) const;
virtual bool sortKeyIsMainKey() const;
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const;
virtual int findBegin(double sortKey, bool expandedRange=true) const;
virtual int findEnd(double sortKey, bool expandedRange=true) const;
virtual int dataCount() const Q_DECL_OVERRIDE;
virtual double dataMainKey(int index) const Q_DECL_OVERRIDE;
virtual double dataSortKey(int index) const Q_DECL_OVERRIDE;
virtual double dataMainValue(int index) const Q_DECL_OVERRIDE;
virtual QCPRange dataValueRange(int index) const Q_DECL_OVERRIDE;
virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE;
virtual bool sortKeyIsMainKey() const Q_DECL_OVERRIDE;
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
virtual int findBegin(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE;
virtual int findEnd(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE;
// reimplemented virtual methods:
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant * details=0) const Q_DECL_OVERRIDE;
......
......@@ -163,7 +163,6 @@ class SchedulerJob
bool timeSlotAllocated;
bool inSequenceFocus;
double Dawn, Dusk;
QString dateTimeDisplayFormat;
QString profile;
......
......@@ -916,6 +916,7 @@ dc1394_bayer_Simple(const uint8_t *restrict bayer, uint8_t *restrict rgb, int sx
dc1394error_t
dc1394_bayer_NearestNeighbor_uint16(const uint16_t *restrict bayer, uint16_t *restrict rgb, int sx, int sy, int tile, int bits)
{
(void)bits;
const int bayerStep = sx;
const int rgbStep = 3 * sx;
int width = sx;
......@@ -1000,6 +1001,7 @@ dc1394_bayer_NearestNeighbor_uint16(const uint16_t *restrict bayer, uint16_t *re
dc1394error_t
dc1394_bayer_Bilinear_uint16(const uint16_t *restrict bayer, uint16_t *restrict rgb, int sx, int sy, int tile, int bits)
{
(void)bits;
const int bayerStep = sx;
const int rgbStep = 3 * sx;
int width = sx;
......@@ -2208,7 +2210,8 @@ dc1394_bayer_AHD(const uint8_t *restrict bayer,
/* start - code from border_interpolate (int border) */
{
int border = 3;
unsigned row, col, y, x, f, c, sum[8];
int row, col, y, x;
unsigned f, c, sum[8];
for (row=0; row < height; row++)
for (col=0; col < width; col++) {
......@@ -2382,7 +2385,8 @@ dc1394_bayer_AHD_uint16(const uint16_t *restrict bayer,
/* start - code from border_interpolate(int border) */
{
int border = 3;
unsigned row, col, y, x, f, c, sum[8];
int row, col, y, x;
unsigned f, c, sum[8];
for (row=0; row < height; row++)
for (col=0; col < width; col++) {
......
......@@ -464,7 +464,7 @@ bool FITSHistogramCommand::reverseDelta()
uint8_t * raw_delta = new uint8_t[totalBytes];
if (raw_delta == NULL)
{
delete(output_image);
delete [] output_image;
qWarning() << "Error! not enough memory to create image delta" << endl;
return false;
}
......@@ -473,6 +473,7 @@ bool FITSHistogramCommand::reverseDelta()
if (r != Z_OK)
{
qDebug() << "FITSHistogram compression error in reverseDelta()" << endl;
delete [] output_image;
delete [] raw_delta;
return false;
}
......
......@@ -135,7 +135,6 @@ class FITSHistogramCommand : public QUndoCommand
FITSHistogram * histogram;
FITSScale type;
double min, max;
int gamma;
unsigned char * delta;
unsigned long compressedBytes;
......
......@@ -43,7 +43,6 @@
#include "Options.h"
const int MAX_FILENAME_LEN = 1024;
const QStringList RAWFormats = { "cr2", "crw", "nef", "raf", "dng", "arw" };
namespace ISD
......
......@@ -30,8 +30,6 @@
#include "skymap.h"
#include "Options.h"
const int MAX_FILENAME_LEN = 1024;
namespace ISD
{
......
......@@ -36,10 +36,6 @@
#include "kstarsdatetime.h"
#include "kspaths.h"
const int INDI_MAX_TRIES=3;
const int MAX_FILENAME_LEN = 1024;
ServerManager::ServerManager(QString inHost, uint inPort)
{
serverProcess = NULL;
......
......@@ -240,7 +240,7 @@ void KStarsData::updateTime( GeoLocation * geo, const bool automaticDSTchange )
KSNumbers num( ut().djd() );
if ( fabs( ut().djd() - LastNumUpdate.djd() ) > 1.0 )
if ( std::abs( ut().djd() - LastNumUpdate.djd() ) > 1.0 )
{
LastNumUpdate = ut().djd();
m_preUpdateNumID++;
......@@ -248,14 +248,14 @@ void KStarsData::updateTime( GeoLocation * geo, const bool automaticDSTchange )
skyComposite()->update( &num );
}
if ( fabs( ut().djd() - LastPlanetUpdate.djd() ) > 0.01 )
if ( std::abs( ut().djd() - LastPlanetUpdate.djd() ) > 0.01 )
{
LastPlanetUpdate = ut().djd();
skyComposite()->updateSolarSystemBodies( &num );
}
// Moon moves ~30 arcmin/hr, so update its position every minute.
if ( fabs( ut().djd() - LastMoonUpdate.djd() ) > 0.00069444 )
if ( std::abs( ut().djd() - LastMoonUpdate.djd() ) > 0.00069444 )
{
LastMoonUpdate = ut();
skyComposite()->updateMoons( &num );
......@@ -263,7 +263,7 @@ void KStarsData::updateTime( GeoLocation * geo, const bool automaticDSTchange )
//Update Alt/Az coordinates. Timescale varies with zoom level
//If Clock is in Manual Mode, always update. (?)
if ( fabs( ut().djd() - LastSkyUpdate.djd() ) > 0.1/Options::zoomFactor() || clock()->isManualMode() )
if ( std::abs( ut().djd() - LastSkyUpdate.djd() ) > 0.1/Options::zoomFactor() || clock()->isManualMode() )
{
LastSkyUpdate = ut();
m_preUpdateID++;
......
......@@ -40,7 +40,7 @@ OpsGuides::OpsGuides()
// checkboxes depending on the options.
slotToggleOpaqueGround( Options::showGround() );
slotToggleConstellOptions( Options::showCNames() );
slotToggleConstellationArt(Options::showConstellationArt);
slotToggleConstellationArt(Options::showConstellationArt() );
slotToggleMilkyWayOptions( Options::showMilkyWay() );
slotToggleAutoSelectGrid( Options::autoSelectGrid() );
......
......@@ -429,7 +429,7 @@ void SkyPoint::updateCoords( const KSNumbers * num, bool /*includePlanets*/, con
{
recompute = ( Options::alwaysRecomputeCoordinates() ||
forceRecompute ||
fabs( lastPrecessJD - num->getJD() ) >= 0.00069444); // Update once per solar minute
std::abs( lastPrecessJD - num->getJD() ) >= 0.00069444); // Update once per solar minute
lens = false;
}
if( recompute )
......
......@@ -477,7 +477,7 @@ void StarObject::JITupdate()
if ( Options::alwaysRecomputeCoordinates() ||
( Options::useRelativistic() && checkBendLight() ) ||
fabs(lastPrecessJD - data->updateNum()->getJD() ) >= 0.00069444) // Update is once per solar minute
std::abs(lastPrecessJD - data->updateNum()->getJD() ) >= 0.00069444) // Update is once per solar minute
{
// Short circuit right here, if recomputing coordinates is not required. NOTE: POTENTIALLY DANGEROUS
updateCoords( data->updateNum() );
......
......@@ -337,7 +337,7 @@ void SkyQPainter::drawSkyPolyline(LineList * list, SkipList * skipList, LineList
void SkyQPainter::drawSkyPolygon(LineList * list, bool forceClip)
{
bool isVisible, isVisibleLast;
bool isVisible = false, isVisibleLast;
SkyList * points = list->points();
QPolygonF polygon;
......
......@@ -562,7 +562,7 @@ void EyepieceField::render()
void EyepieceField::slotDownloadDss()
{
double fovWidth, fovHeight;
double fovWidth = 0, fovHeight = 0;
if( m_fovWidth == 0 && m_currentFOV == 0 )
{
fovWidth = fovHeight = 15.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment