Commit 9acfd272 authored by Halla Rempt's avatar Halla Rempt

Fix warnings on Clang/OSX

parent 7e58c5a1
......@@ -22,6 +22,8 @@
#include <config-vc.h>
#ifdef HAVE_VC
#pragma GCC diagnostic ignored "-Wundef"
#pragma GCC diagnostic ignored "-Wlocal-type-template-args"
#include <Vc/Vc>
#include <Vc/IO>
#endif
......
......@@ -48,7 +48,7 @@ public:
m_toDoubleFuncPtr[m_alphaCachePos](data, m_alphaRealPos) : 1.0;
for (quint32 k = 0; k < m_convolveChannelsNo; ++k) {
if (k != m_alphaCachePos) {
if (k != (quint32)m_alphaCachePos) {
const quint32 channelPos = m_convChannelList[k]->pos();
cache[index][k] = m_toDoubleFuncPtr[k](data, channelPos) * alphaValue;
} else {
......@@ -290,12 +290,12 @@ public:
qreal alphaValueInv = 1.0 / alphaValue;
for (quint32 k = 0; k < m_convolveChannelsNo; ++k) {
if (k == m_alphaCachePos) continue;
if (k == (quint32)m_alphaCachePos) continue;
convolveOneChannelFromCache<true>(dstPtr, k, alphaValueInv);
}
} else {
for (quint32 k = 0; k < m_convolveChannelsNo; ++k) {
if (k == m_alphaCachePos) continue;
if (k == (quint32)m_alphaCachePos) continue;
const qreal zeroValue = 0.0;
const quint32 channelPos = m_convChannelList[k]->pos();
......
......@@ -102,7 +102,7 @@ private:
qreal getNextPointPositionAnisotropic(const QPointF &start,
const QPointF &end);
private:
class Private;
struct Private;
Private * const m_d;
};
......
......@@ -35,6 +35,8 @@
#pragma warning(disable: 4290) // disable "C++ exception specification ignored" warning
#endif
#pragma GCC diagnostic ignored "-Wcast-align"
typedef double(*PtrToDouble)(const quint8*, int);
typedef void (*PtrFromDouble)(quint8*, int, double);
......
......@@ -38,7 +38,6 @@ public:
LinearStorage(quint8 *buffer, int width, int height, int pixelSize)
: m_buffer(buffer),
m_width(width),
m_height(height),
m_pixelSize(pixelSize)
{
m_marks.reset(new quint8[width * height]);
......@@ -57,7 +56,6 @@ private:
QScopedArrayPointer<quint8> m_marks;
quint8 *m_buffer;
int m_width;
int m_height;
int m_pixelSize;
};
......@@ -66,11 +64,8 @@ class PaintDeviceStorage
public:
typedef const KisPaintDevice* StorageType;
public:
PaintDeviceStorage(const KisPaintDevice *device, int width, int height, int pixelSize)
: m_device(device),
m_width(width),
m_height(height),
m_pixelSize(pixelSize)
PaintDeviceStorage(const KisPaintDevice *device, int /*width*/, int /*height*/, int /*pixelSize*/)
: m_device(device)
{
m_deviceIt = m_device->createRandomConstAccessorNG(0, 0);
......@@ -94,9 +89,6 @@ private:
const KisPaintDevice *m_device;
KisRandomConstAccessorSP m_deviceIt;
KisRandomAccessorSP m_marksIt;
int m_width;
int m_height;
int m_pixelSize;
};
......
......@@ -45,7 +45,7 @@ public:
* @param defaultOpacity opacity of pixels that shouldn't be included in the outline
**/
KisOutlineGenerator(const KoColorSpace* cs, quint8 defaultOpacity);
/**
* Generates the outline.
* @param buffer buffer with the data for the outline
......@@ -98,9 +98,6 @@ private:
quint8 m_defaultOpacity;
bool m_simple;
qint32 m_xOffset;
qint32 m_yOffset;
KisRandomConstAccessorSP m_accessor;
};
......
......@@ -55,7 +55,6 @@ public:
}
private:
KisPaintDeviceSP m_device;
int m_position, m_end;
QPointF m_currentPoint;
KisRandomConstAccessorSP m_randomAccessor;
};
......
......@@ -105,7 +105,7 @@ void KisUpdateScheduler::connectSignals()
SLOT(spareThreadAppeared()), Qt::DirectConnection);
}
void KisUpdateScheduler::setProgressProxy(KoProgressProxy *progressProxy)
void KisUpdateScheduler::setProgressProxy(KoProgressProxy */*progressProxy*/)
{
delete m_d->progressUpdater;
// FIXME: Disable progress reporting for now since it seems to cause
......
......@@ -25,6 +25,7 @@
#define HASH_SIZE (1<< HASH_LOG)
#define HASH_MASK (HASH_SIZE-1)
#pragma GCC diagnostic ignored "-Wcast-align"
#define UPDATE_HASH(v,p) { v = *((quint16*)p); v ^= *((quint16*)(p+1))^(v>>(16-HASH_LOG)); }
#define MAX_COPY 32
......
......@@ -30,10 +30,6 @@ public:
RulerAssistantToolPlugin(QObject *parent, const QVariantList &);
virtual ~RulerAssistantToolPlugin();
private:
KisView * m_view;
};
#endif
......@@ -102,7 +102,7 @@ void KisColorSelectorContainer::setCanvas(KisCanvas2* canvas)
}
KActionCollection* actionCollection = canvas->view()->actionCollection();
if (!m_colorSelAction != 0) {
if (!m_colorSelAction) {
m_colorSelAction = new KAction("Show color selector", this);
m_colorSelAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_I));
connect(m_colorSelAction, SIGNAL(triggered()), m_colorSelector, SLOT(showPopup()), Qt::UniqueConnection);
......@@ -141,7 +141,7 @@ void KisColorSelectorContainer::updateSettings()
else
newShadeSelector = 0;
if(m_shadeSelector!=newShadeSelector && m_shadeSelector!=0) {
m_shadeSelector->hide();
......
......@@ -92,7 +92,7 @@ void KisUndoModel::setStack(KUndo2QStack *stack)
}
m_stack = stack;
if (m_stack != 0) {
connect(m_stack, SIGNAL(cleanChanged(bool)), this, SLOT(stackChanged()));
connect(m_stack, SIGNAL(indexChanged(int)), this, SLOT(stackChanged()));
......@@ -197,7 +197,7 @@ QVariant KisUndoModel::data(const QModelIndex &index, int role) const
return m_empty_label;
return m_stack->text(index.row() - 1);
} else if (role == Qt::DecorationRole) {
if(!index.row() == 0) {
if (!index.row()) {
const KUndo2Command* currentCommand = m_stack->command(index.row() - 1);
return imageMap[currentCommand];
}
......
......@@ -32,8 +32,6 @@ class SmallColorSelectorPlugin : public QObject
public:
SmallColorSelectorPlugin(QObject *parent, const QVariantList &);
virtual ~SmallColorSelectorPlugin();
private:
KisView2* m_view;
};
#endif
......@@ -32,8 +32,6 @@ class SpecificColorSelectorPlugin : public QObject
public:
SpecificColorSelectorPlugin(QObject *parent, const QVariantList &);
virtual ~SpecificColorSelectorPlugin();
private:
KisView2* m_view;
};
#endif
This diff is collapsed.
......@@ -382,10 +382,7 @@ void BoolParameter::parseValues(const QString& typeDefinition)
QString BoolParameter::toString()
{
QString result;
result.append(m_name+";");
result.append(m_value+";");
return result;
return QString("%1;%2;").arg(m_name).arg(m_value);
}
QString BoolParameter::value() const
......@@ -571,11 +568,7 @@ QString TextParameter::value() const
QString TextParameter::toString()
{
QString result;
result.append(m_name+";");
result.append(m_value + ";");
result.append(m_multiline + ";");
return result;
return QString("%1;%2;%3;").arg(m_name).arg(m_value).arg(m_multiline);
}
void TextParameter::reset()
......
......@@ -44,6 +44,9 @@
# knowledge of the CeCILL license and that you accept its terms.
#
*/
#pragma GCC diagnostic ignored "-Wundef"
#include <locale>
#ifndef gmic_version
#define gmic_version 1590
......@@ -252,7 +255,7 @@ struct gmic {
template<typename T>
gmic_image<char> substitute_item(const char *const source,
gmic_list<T>& images, gmic_list<char>& images_names,
unsigned int variables_sizes[256]);
unsigned int variables_sizes[256]);
gmic& print(const char *format, ...);
gmic& error(const char *format, ...);
......@@ -260,7 +263,7 @@ struct gmic {
template<typename T>
gmic& print(const gmic_list<T>& list, const gmic_image<unsigned int> *const scope_selection,
const char *format, ...);
const char *format, ...);
template<typename T>
gmic& warn(const gmic_list<T>& list, const gmic_image<unsigned int> *const scope_selection,
......@@ -268,7 +271,7 @@ struct gmic {
template<typename T>
gmic& error(const gmic_list<T>& list, const gmic_image<unsigned int> *const scope_selection,
const char *const command, const char *format, ...);
const char *const command, const char *format, ...);
template<typename T>
gmic& debug(const gmic_list<T>& list, const char *format, ...);
......@@ -306,7 +309,7 @@ struct gmic {
template<typename T>
gmic& parse(const gmic_list<char>& commands_line,
gmic_list<T> &images, gmic_list<char> &images_names) {
gmic_list<T> &images, gmic_list<char> &images_names) {
unsigned int variables_sizes[256] = { 0 };
unsigned int position = 0;
setlocale(LC_NUMERIC,"C");
......
......@@ -61,7 +61,6 @@ void KisGmicUpdater::start()
connect(getReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(reportProgress(qint64,qint64)));
connect(getReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(slotError(QNetworkReply::NetworkError)));
connect(getReply, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>)));
}
......@@ -129,11 +128,4 @@ void KisGmicUpdater::slotError(QNetworkReply::NetworkError error)
dbgPlugins << "NetworkError" << error;
}
void KisGmicUpdater::slotSslErrors(QList< QSslError > error)
{
dbgPlugins << "SSL Errors";
foreach (const QSslError &er, error)
{
dbgPlugins << er.errorString();
}
}
......@@ -41,7 +41,6 @@ private slots:
void finishedDownload(QNetworkReply *);
void reportProgress(qint64 arrived,qint64 total);
void slotError(QNetworkReply::NetworkError error);
void slotSslErrors(QList<QSslError> error);
private:
QNetworkAccessManager m_manager;
......
......@@ -30,7 +30,6 @@
DlgImagesplit::DlgImagesplit(KisView2* view,QString suffix,QStringList listMimeFilter)
: KDialog(view)
, m_view(view)
{
m_page = new WdgImagesplit(this);
......
......@@ -52,7 +52,6 @@ private slots:
void lineEditEnable();
void setMimeType(int index);
private:
KisView2* m_view;
WdgImagesplit* m_page;
};
......
......@@ -45,10 +45,10 @@ KoColorTransformation* KisHSVAdjustmentFilter::createTransformation(const KoColo
QHash<QString, QVariant> params;
if (config) {
if (config->getBool("colorize")) {
params["h"] = config->getInt("h", 0.5) / 360.0;
params["h"] = config->getDouble("h", 0.5) / 360.0;
}
else {
params["h"] = config->getInt("h", 0) / 180.0;
params["h"] = config->getDouble("h", 0) / 180.0;
}
params["s"] = config->getInt("s", 0) * 0.01;
......
......@@ -14,15 +14,24 @@
<string>BrightnessCon</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="3" column="1" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
......@@ -40,13 +49,10 @@
</spacer>
</item>
<item row="1" column="1" colspan="2">
<layout class="QGridLayout">
<layout class="QGridLayout" name="grid2">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
......@@ -80,7 +86,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -174,9 +189,6 @@
</item>
<item row="0" column="1" colspan="2">
<layout class="QHBoxLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel1">
<property name="sizePolicy">
......
......@@ -185,7 +185,7 @@ void IndexColorPalette::mergeMostReduantColors()
for(int i = 0; i < numColors(); ++i)
if(colorHood[i].similarity > colorHood[mostSimilarColor].similarity)
mostSimilarColor = i;
int darkerIndex = colorHood[mostSimilarColor].neighbours.first;
int brighterIndex = colorHood[mostSimilarColor].neighbours.second;
if(darkerIndex != -1 &&
......@@ -193,7 +193,6 @@ void IndexColorPalette::mergeMostReduantColors()
{
LabColor clrA = colors[darkerIndex];
LabColor clrB = colors[mostSimilarColor];
LabColor clrC = colors[brighterIndex];
// Remove two, add one = 1 color less
colors.remove(darkerIndex);
colors.remove(mostSimilarColor);
......
......@@ -75,7 +75,7 @@ extern "C" {
#define MAX_DATA_BYTES_IN_MARKER (MAX_BYTES_IN_MARKER - ICC_OVERHEAD_LEN)
const char photoshopMarker[] = "Photoshop 3.0\0";
const char photoshopBimId_[] = "8BIM";
//const char photoshopBimId_[] = "8BIM";
const uint16_t photoshopIptc = 0x0404;
const char xmpMarker[] = "http://ns.adobe.com/xap/1.0/\0";
const QByteArray photoshopIptc_((char*)&photoshopIptc, 2);
......
......@@ -28,7 +28,6 @@
#include "kis_curve_line_option.h"
const int STEPS = 200;
#if defined(_WIN32) || defined(_WIN64)
#define srand48 srand
......
......@@ -34,7 +34,6 @@
#include <ctime>
#include <KoColorSpaceRegistry.h>
const qreal radToDeg = 57.29578;
const qreal degToRad = M_PI / 180.0;
......
......@@ -46,7 +46,6 @@ public:
private:
bool m_useMovementPaint;
KisPaintDeviceSP m_dab;
KisPaintDeviceSP m_dev;
......
......@@ -37,7 +37,5 @@ public:
bool isAirbrushing() const;
int rate() const;
private:
KisDeformPaintOpSettingsWidget* m_options;
};
#endif
......@@ -42,7 +42,6 @@
KisDynaPaintOp::KisDynaPaintOp(const KisDynaPaintOpSettings *settings, KisPainter * painter, KisImageWSP image)
: KisPaintOp(painter)
, m_settings(settings)
{
if (image) {
m_dynaBrush.setCanvasSize(image->width(), image->height());
......
......@@ -46,7 +46,6 @@ public:
}
private:
const KisDynaPaintOpSettings* m_settings;
KisDynaProperties m_properties;
KisPaintDeviceSP m_dab;
DynaBrush m_dynaBrush;
......
......@@ -49,7 +49,6 @@
KisFilterOp::KisFilterOp(const KisFilterOpSettings *settings, KisPainter *painter, KisImageWSP image)
: KisBrushBasedPaintOp(settings, painter)
, settings(settings)
, m_filterConfiguration(0)
{
Q_UNUSED(image);
......
......@@ -44,7 +44,6 @@ public:
private:
const KisFilterOpSettings * settings;
KisPaintDeviceSP m_tmpDevice;
KisPressureSizeOption m_sizeOption;
KisPressureRotationOption m_rotationOption;
......
......@@ -38,9 +38,6 @@ public:
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) const;
bool paintIncremental();
private:
KisGridPaintOpSettingsWidget* m_options;
};
#endif
......@@ -46,8 +46,6 @@ inline double drand48()
#include <cmath>
#include <ctime>
const float radToDeg = 57.29578f;
HairyBrush::HairyBrush()
{
srand48(time(0));
......
......@@ -130,9 +130,6 @@ private:
int m_counter;
double m_lastAngle;
double m_lastSlope;
double m_angle;
double m_oldPressure;
KoColor m_color;
......
......@@ -40,10 +40,7 @@
KisHairyPaintOp::KisHairyPaintOp(const KisBrushBasedPaintOpSettings *settings, KisPainter * painter, KisImageWSP image)
: KisPaintOp(painter)
, m_settings(settings)
, newStrokeFlag(true)
{
{
Q_UNUSED(image)
Q_ASSERT(settings);
......
......@@ -46,9 +46,7 @@ public:
private:
KisHairyProperties m_properties;
const KisBrushBasedPaintOpSettings* m_settings;
bool newStrokeFlag;
KisPaintDeviceSP m_dab;
KisPaintDeviceSP m_dev;
HairyBrush m_brush;
......
......@@ -127,7 +127,8 @@ void KisPlainColorSource::selectColor(double mix)
//--------------- KisGradientColorSource -------------//
//-------------------------------------------------//
KisGradientColorSource::KisGradientColorSource(const KoAbstractGradient* gradient, const KoColorSpace* workingCS) : m_gradient(gradient), m_colorSpace(workingCS)
KisGradientColorSource::KisGradientColorSource(const KoAbstractGradient* gradient, const KoColorSpace* workingCS)
: m_gradient(gradient)
{