Commit 7d4c87a0 authored by Boudewijn Rempt's avatar Boudewijn Rempt

krita: warnings--

svn path=/trunk/koffice/; revision=1061253
parent d2c0b8ab
......@@ -145,7 +145,9 @@ double KisPaintInformation::tangentialPressure() const
QDebug operator<<(QDebug dbg, const KisPaintInformation &info)
{
#ifndef NDEBUG
#ifdef NDEBUG
Q_UNUSED(info);
#else
dbg.nospace() << "Position: " << info.pos();
dbg.nospace() << ", Pressure: " << info.pressure();
dbg.nospace() << ", X Tilt: " << info.xTilt();
......
......@@ -59,7 +59,7 @@ void KisMaskGenerator::init()
void KisMaskGenerator::toXML(QDomDocument& doc, QDomElement& e) const
{
Q_UNUSED(doc);
e.setAttribute("autobrush_radius", d->m_radius);
e.setAttribute("autobrush_ratio", d->m_ratio);
e.setAttribute("autobrush_hfade", d->m_fh * 2); // 'cause in init we divide it again
......
......@@ -244,6 +244,7 @@ bool Schema::Private::parseEltType(QDomElement& elt, EntryInfo& entryInfo, QStri
const TypeInfo* Schema::Private::parseAttType(QDomElement& elt, bool ignoreStructure)
{
Q_UNUSED(ignoreStructure);
if (!elt.hasAttribute("type")) {
return 0;
}
......@@ -265,6 +266,7 @@ const TypeInfo* Schema::Private::parseAttType(QDomElement& elt, bool ignoreStruc
const TypeInfo* Schema::Private::parseEmbType(QDomElement& elt, bool ignoreStructure)
{
Q_UNUSED(ignoreStructure);
dbgImage << "Parse embbedded type for " << elt.tagName();
QDomNode n = elt.firstChild();
while (!n.isNull()) {
......
......@@ -99,6 +99,8 @@ TypeInfo::TypeInfo(TypeInfo::PropertyType _propertyType) : d(new Private)
case RationalType:
d->parser = new RationalParser;
break;
default:
;
}
}
......
......@@ -149,6 +149,7 @@ void KisTileDataStore::freeTileData(KisTileData *td)
void KisTileDataStore::ensureTileDataLoaded(const KisTileData *td)
{
Q_UNUSED(td);
/* Swapping isn't implemented yet */
Q_ASSERT(td->m_state == KisTileData::NORMAL);
}
......
......@@ -144,6 +144,8 @@ QString KoCtlColorSpace::normalisedChannelValueText(const quint8 *pixel, quint32
void KoCtlColorSpace::normalisedChannelsValue(const quint8 *pixel, QVector<float> &channels) const
{
Q_UNUSED(pixel);
Q_UNUSED(channels);
}
void KoCtlColorSpace::fromNormalisedChannelsValue(quint8 *pixel, const QVector<float> &values) const
......@@ -203,6 +205,7 @@ KoColorProfile * KoCtlColorSpace::profile()
KoColorTransformation *KoCtlColorSpace::createBrightnessContrastAdjustment(const quint16 *transferValues) const
{
Q_UNUSED(transferValues);
return 0;
}
......@@ -213,11 +216,15 @@ KoColorTransformation *KoCtlColorSpace::createDesaturateAdjustment() const
KoColorTransformation *KoCtlColorSpace::createPerChannelAdjustment(const quint16 * const* transferValues) const
{
Q_UNUSED(transferValues);
return 0;
}
KoColorTransformation *KoCtlColorSpace::createDarkenAdjustment(qint32 shade, bool compensate, qreal compensation) const
{
Q_UNUSED(shade);
Q_UNUSED(compensate);
Q_UNUSED(compensation);
return 0;
}
......@@ -228,6 +235,8 @@ KoColorTransformation *KoCtlColorSpace::createInvertTransformation() const
quint8 KoCtlColorSpace::difference(const quint8* src1, const quint8* src2) const
{
Q_UNUSED(src1);
Q_UNUSED(src2);
return 0;
}
......@@ -255,6 +264,7 @@ void KoCtlColorSpace::toQColor(const quint8 *src, QColor *c, const KoColorProfil
quint8 KoCtlColorSpace::intensity8(const quint8 * src) const
{
Q_UNUSED(src);
return 0;
}
......
......@@ -77,6 +77,11 @@ void KoCTLCompositeOp::composite(quint8 *dstRowStart, qint32 dstRowStride,
quint8 opacity,
const QBitArray & channelFlags) const
{
Q_UNUSED(channelFlags);
#ifdef __GNUC__
#warning "Use channel flags, especially for alpha locking!"
#endif
Q_ASSERT(m_withMaskProgram);
Q_ASSERT(m_withoutMaskProgram);
while (rows > 0) {
......
......@@ -43,6 +43,7 @@ public:
KoCTLCompositeOp(OpenCTL::Template* _template, const KoCtlColorSpace* cs, const GTLCore::PixelDescription& _pd);
virtual ~KoCTLCompositeOp();
public:
using KoCompositeOp::composite;
virtual void composite(quint8 *dstRowStart, qint32 dstRowStride,
const quint8 *srcRowStart, qint32 srcRowStride,
const quint8 *maskRowStart, qint32 maskRowStride,
......
......@@ -49,7 +49,7 @@ void KoCtlConvolutionOp::convolveColors(const quint8* const* colors, const qint3
if (m_colorSpace->alpha(*colors) == 0) {
totalWeightTransparent += weight;
} else {
for (uint i = 0; i < channelsNb; i++) {
for (int i = 0; i < channelsNb; i++) {
m_accumulators[i]->mix(colors[i], weight);
}
}
......@@ -60,7 +60,7 @@ void KoCtlConvolutionOp::convolveColors(const quint8* const* colors, const qint3
bool allChannels = channelFlags.isEmpty();
Q_ASSERT(allChannels || channelFlags.size() == channelsNb);
if (totalWeightTransparent == 0) {
for (uint i = 0; i < channelsNb; i++) {
for (int i = 0; i < channelsNb; i++) {
if ((allChannels and i != (uint)alphaPos)
or(not allChannels and channelFlags.testBit(i))) {
m_accumulators[i]->affect(dst, factor, offset);
......@@ -69,7 +69,7 @@ void KoCtlConvolutionOp::convolveColors(const quint8* const* colors, const qint3
} else if (totalWeightTransparent != totalWeight) {
if (totalWeight == factor) {
qint64 a = (totalWeight - totalWeightTransparent);
for (uint i = 0; i < channelsNb; i++) {
for (int i = 0; i < channelsNb; i++) {
if (allChannels || channelFlags.testBit(i)) {
if (i == (uint)alphaPos) {
m_accumulators[i]->affect(dst, totalWeight, offset);
......@@ -80,7 +80,7 @@ void KoCtlConvolutionOp::convolveColors(const quint8* const* colors, const qint3
}
} else {
qreal a = totalWeight / (factor * (totalWeight - totalWeightTransparent)); // use qreal as it easily saturate
for (uint i = 0; i < channelsNb; i++) {
for (int i = 0; i < channelsNb; i++) {
if (allChannels || channelFlags.testBit(i)) {
if (i == (uint)alphaPos) {
m_accumulators[i]->affect(dst, factor, offset);
......
......@@ -50,7 +50,7 @@ void KoCtlMixColorsOp::mixColors(const quint8 * const* colors, const qint16 *wei
}
alphaTimesWeight *= *weights;
for (int i = 0; i < m_colorSpace->channelCount(); i++) {
for (uint i = 0; i < m_colorSpace->channelCount(); i++) {
if (i != alphaPos) {
m_accumulators[i]->mix(color, alphaTimesWeight);
}
......@@ -63,7 +63,7 @@ void KoCtlMixColorsOp::mixColors(const quint8 * const* colors, const qint16 *wei
if (totalAlpha > 0) {
double inv = 1.0 / totalAlpha;
for (int i = 0; i < m_colorSpace->channelCount(); i++) {
for (uint i = 0; i < m_colorSpace->channelCount(); i++) {
if (i != alphaPos) {
m_accumulators[i]->affect(dst, inv);
}
......
......@@ -177,8 +177,6 @@ void KisFloatColorInput::update()
KoColor min = *m_color;
KoColor max = *m_color;
quint8* data = m_color->data() + m_channelInfo->pos();
quint8* dataMin = min.data() + m_channelInfo->pos();
quint8* dataMax = max.data() + m_channelInfo->pos();
switch (m_channelInfo->channelValueType()) {
#ifdef HAVE_OPENEXR
case KoChannelInfo::FLOAT16:
......
......@@ -171,11 +171,13 @@ void MixerCanvas::slotClear()
void MixerCanvas::slotResourceChanged(int key, const QVariant &value)
{
Q_UNUSED(key);
Q_UNUSED(value);
}
KoColor MixerCanvas::currentColorAt(QPoint pos)
{
Q_UNUSED(pos);
return KoColor();
}
......
......@@ -103,11 +103,13 @@ void MixerTool::paint(QPainter &painter, const KoViewConverter &converter)
void MixerTool::mousePressEvent(KoPointerEvent *event)
{
Q_UNUSED(event);
m_d->mixing = true;
}
void MixerTool::mouseMoveEvent(KoPointerEvent *event)
{
Q_UNUSED(event);
if (m_d->mixing) {
}
......
......@@ -56,7 +56,7 @@ public:
QList<_TFunction_> functions_;
Q_ASSERT(2 * m_functions.size() == values_.size());
for (uint i = 0; i < m_functions.size(); i++) {
for (int i = 0; i < m_functions.size(); i++) {
if (fabs(values_[ 2 * i + 1]) < threshold && fabs(values_[ 2 * i ]) < threshold) {
dbgPlugins << "Adding function " << i << " " << fabs(values_[ 2 * i ]) << " " << fabs(values_[ 2 * i + 1]);
functions_.push_back(m_functions[i]);
......
......@@ -19,6 +19,7 @@
#include "kis_image_alignment.h"
#include <QUndoCommand>
#include <Eigen/Core>
......
......@@ -92,6 +92,7 @@ void Progress::incProgress()
void Progress::setProgressStage(const QString& stage, uint progress)
{
Q_UNUSED(stage);
if (m_progressTotalSteps < 1)
return;
......
......@@ -116,7 +116,7 @@ void compute_fft(zomplex *array, int width, int height)
{
int countre = 0;
int countim = 0;
int dummy;
float *data = (float *) malloc((2 * width * height + 1) * sizeof(float));
for (int p = 0; p < ((width)*(height)); p++) {
data[(2*p)+1] = (*(array + p)).re;
......
......@@ -26,8 +26,6 @@ typedef double COLOR[3]; /* red, green, blue (or X,Y,Z) */
//--- end of defines.h
static int width, height;
static COLOR **rgb_image;
static COLOR **white_point;
static double **low_pass;
......@@ -222,6 +220,7 @@ void build_image_fft(double **image, zomplex *image_fft)
void convolve_filter(double **image, int width, int height, zomplex* image_fft, zomplex* filter_fft, zomplex *convolution_fft, double **convolved_image)
{
Q_UNUSED(image);
int i, x, y;
for (i = 0; i < width * height; i++) {
......@@ -528,6 +527,7 @@ void tonemap_image()
}
void deallocate_memory(int width, int height)
{
Q_UNUSED(width);
int y;
......@@ -565,6 +565,7 @@ void print_parameter_settings()
void tmo_icam(const pfs::Array2D *Y, pfs::Array2D *L,
float variance, float variance2, float D, float prescaling, float percentile, bool indep)
{
Q_UNUSED(indep);
int x, y;
::variance = variance;
......
......@@ -27,6 +27,7 @@ K_EXPORT_COMPONENT_FACTORY(kritadodgeburn, DodgeBurnPluginFactory("krita"))
DodgeBurnPlugin::DodgeBurnPlugin(QObject *parent, const QStringList &)
{
Q_UNUSED(parent);
KisFilterRegistry::instance()->add(new KisFilterDodgeBurn("dodge", "Dodge", i18n("Dodge")));
KisFilterRegistry::instance()->add(new KisFilterDodgeBurn("burn", "Burn", i18n("Burn")));
}
......
......@@ -79,8 +79,6 @@ KoColorTransformation* KisLevelFilter::createTransformation(const KoColorSpace*
Q_ASSERT(config);
KoColorTransformation * adjustment = 0;
int blackvalue = config->getInt("blackvalue");
int whitevalue = config->getInt("whitevalue", 255);
double gammavalue = config->getDouble("gammavalue", 1.0);
......
......@@ -80,6 +80,7 @@ warning_callback(const char *msg, void *client_data)
void
info_callback(const char *msg, void *client_data)
{
Q_UNUSED(client_data);
fprintf(stdout, "[INFO] %s", msg);
}
......
......@@ -57,6 +57,7 @@ KisPPMImport::~KisPPMImport()
KoFilter::ConversionStatus KisPPMImport::convert(const QByteArray& from, const QByteArray& to)
{
Q_UNUSED(from);
dbgFile << "Importing using PPMImport!";
if (to != "application/x-krita")
......
......@@ -74,6 +74,7 @@ KisXCFImport::~KisXCFImport()
KoFilter::ConversionStatus KisXCFImport::convert(const QByteArray& from, const QByteArray& to)
{
Q_UNUSED(from);
dbgFile << "Importing using XCFImport!";
if (to != "application/x-krita")
......@@ -208,7 +209,7 @@ KoFilter::ConversionStatus KisXCFImport::loadFromDevice(QIODevice* device, KisDo
dbgFile << i << " name = " << xcflayer.name << " opacity = " << xcflayer.opacity;
dbgFile << ppVar(xcflayer.dim.width) << ppVar(xcflayer.dim.height) << ppVar(xcflayer.dim.tilesx) << ppVar(xcflayer.dim.tilesy) << ppVar(xcflayer.dim.ntiles) << ppVar(xcflayer.dim.c.t) << ppVar(xcflayer.dim.c.l) << ppVar(xcflayer.dim.c.r) << ppVar(xcflayer.dim.c.b);
bool isRgbA;
bool isRgbA = false;
// Select the color space
const KoColorSpace* colorSpace = 0;
switch (xcflayer.type) {
......
......@@ -235,10 +235,10 @@ void CurveBrush::paintLine(KisPaintDeviceSP dab, KisPaintDeviceSP layer, const K
// Initialization
if (!m_image) return;
int w = m_image->width();
int h = m_image->height();
//int w = m_image->width();
//int h = m_image->height();
qreal maxDist = sqrt(w * w + h * h);
//qreal maxDist = sqrt(w * w + h * h);
qreal x1 = pi1.pos().x();
qreal y1 = pi1.pos().y();
......@@ -248,7 +248,7 @@ void CurveBrush::paintLine(KisPaintDeviceSP dab, KisPaintDeviceSP layer, const K
qreal dx = x2 - x1;
qreal dy = y2 - y1;
qreal angle = atan2(dy, dx);
//qreal angle = atan2(dy, dx);
qreal distance = sqrt(dx * dx + dy * dy);
KisRandomAccessor accessor = dab->createRandomAccessor((int) x1, (int) y1);
......@@ -269,9 +269,9 @@ void CurveBrush::paintLine(KisPaintDeviceSP dab, KisPaintDeviceSP layer, const K
qreal randX, randY;
randX = ((x1 + x2) / 2.0);
randY = ((y1 + y2) / 2.0);
qreal dNorm = distance / maxDist;
//qreal dNorm = distance / maxDist;
qreal clen;
qreal clen = 0.0;
/*
dbgPlugins << "mode:" << m_mode;
......@@ -317,7 +317,7 @@ void CurveBrush::paintLine(KisPaintDeviceSP dab, KisPaintDeviceSP layer, const K
normalizePoint(p2);
qreal paintX, paintY;
int moveX, moveY;
//int moveX, moveY;
for (int i = 0 ; i <= steps; i++) {
result = getQuadraticBezier(p0, p1, p2, (qreal) i / (qreal) steps);
......
......@@ -94,8 +94,8 @@ private:
int m_head;
int pointCount;
int m_incr;
int m_counter;
int m_incr;
int m_interval;
int m_mode;
......
......@@ -57,6 +57,7 @@ void KisCurvePaintOp::paintAt(const KisPaintInformation& info)
double KisCurvePaintOp::paintLine(const KisPaintInformation &pi1, const KisPaintInformation &pi2, double savedDist)
{
Q_UNUSED(savedDist);
if (!painter()) return 0;
m_dev = painter()->device();
if (!m_dev) return 0;
......
......@@ -211,6 +211,7 @@ void DynaBrush::drawLines(KisPainter &painter,
int count
)
{
Q_UNUSED(prev);
QPointF p1, p2;
qreal offsetX, offsetY;
......
......@@ -52,13 +52,15 @@ int KisGridShapeOption::shape() const {
// TODO
void KisGridShapeOption::writeOptionSetting(KisPropertiesConfiguration* setting) const
{
Q_UNUSED(setting);
// setting->setProperty( "Grid/diameter", diameter() );
}
// TODO
void KisGridShapeOption::readOptionSetting(const KisPropertiesConfiguration* setting)
{
Q_UNUSED(setting);
/* m_options->diameterSpinBox->setValue( setting->getInt("Grid/diameter") );
m_options->coverageSpin->setValue( setting->getDouble("Grid/coverage") );
m_options->jitterSizeBox->setChecked( setting->getBool("Grid/jitterSize") );*/
}
\ No newline at end of file
}
......@@ -90,11 +90,13 @@ bool KisGridOpOption::pressureDivision() const
void KisGridOpOption::writeOptionSetting(KisPropertiesConfiguration* setting) const
{
Q_UNUSED(setting);
// setting->setProperty( "Grid/jitterMovement", jitterMovement() );
}
void KisGridOpOption::readOptionSetting(const KisPropertiesConfiguration* setting)
{
Q_UNUSED(setting);
// m_options->diameterSpinBox->setValue( setting->getInt("Grid/diameter") );
}
......
......@@ -80,6 +80,9 @@ void KisBidirectionalMixingOption::apply(KisPaintDeviceSP dab, KisPaintDeviceSP
void KisBidirectionalMixingOption::applyFixed(KisFixedPaintDeviceSP dab, KisPaintDeviceSP device, KisPainter* painter, qint32 sx, qint32 sy, qint32 sw, qint32 sh, quint8 pressure, const QRect& dstRect)
{
Q_UNUSED(sx);
Q_UNUSED(sy);
if (!isChecked()) return;
KisFixedPaintDevice canvas(device->colorSpace());
......
......@@ -137,6 +137,7 @@ KisBrushChooser::~KisBrushChooser()
void KisBrushChooser::setBrush(KisBrushSP _brush)
{
Q_UNUSED(_brush);
/*
KisGbrBrush* brush = static_cast<KisGbrBrush*>(_brush.data());
......
......@@ -72,6 +72,7 @@ void KisBrushOption::setImage(KisImageWSP image)
void KisBrushOption::writeOptionSetting(KisPropertiesConfiguration* settings) const
{
Q_UNUSED(settings);
/*
KisBrushSP brush = m_brushSelectionWidget->brush();
QDomDocument d;
......@@ -83,6 +84,7 @@ void KisBrushOption::writeOptionSetting(KisPropertiesConfiguration* settings) co
void KisBrushOption::readOptionSetting(const KisPropertiesConfiguration* setting)
{
Q_UNUSED(setting);
/*
QString brushDefinition = setting->getString("brush_definition");
QDomDocument d;
......
......@@ -125,6 +125,7 @@ void KisBrushSelectionWidget::setPredefinedBrushes(bool on)
void KisBrushSelectionWidget::setCustomBrush(bool on)
{
Q_UNUSED(on);
// m_customBrushWidget->setVisible( on );
}
......@@ -135,6 +136,7 @@ void KisBrushSelectionWidget::setTextBrush(bool on)
void KisBrushSelectionWidget::setImage(KisImageWSP image)
{
Q_UNUSED(image);
// m_customBrushWidget->setImage(image);
}
......
......@@ -25,10 +25,12 @@
KisColorSource::~KisColorSource() { }
const KoColor black;
const KoColor& KisColorSource::uniformColor() const
{
qFatal("Not an uniform color.");
return KoColor();
return black;
}
......
......@@ -84,6 +84,7 @@ void KisDynamicSensor::toXML(QDomDocument&, QDomElement& e) const
void KisDynamicSensor::fromXML(const QDomElement& e)
{
Q_UNUSED(e);
Q_ASSERT(e.attribute("id", "") == id());
}
......@@ -170,6 +170,7 @@ void KisFilterOption::updateFilterConfigWidget()
void KisFilterOption::writeOptionSetting(KisPropertiesConfiguration* setting) const
{
Q_UNUSED(setting);
#ifdef __GNUC__
#warning "KisFilterOption::writeOptionSetting: write the filter option setting"
#endif
......@@ -177,6 +178,7 @@ void KisFilterOption::writeOptionSetting(KisPropertiesConfiguration* setting) co
void KisFilterOption::readOptionSetting(const KisPropertiesConfiguration* setting)
{
Q_UNUSED(setting);
#ifdef __GNUC__
#warning "KisFilterOption::readOptionSetting: restore the filter option setting"
#endif
......
......@@ -456,6 +456,7 @@ private:
// How many dabs will be drawn between the current and the next (x, y, pressure, +dt) position?
float count_dabs_to (float x, float y, float pressure, float dt)
{
Q_UNUSED(pressure);
float xx, yy;
float res1, res2, res3;
float dist;
......
......@@ -50,6 +50,7 @@ QVariant MyBrushResourcesListModel::data( const QModelIndex & index, int role) c
bool MyBrushResourcesListModel::setData(const QModelIndex& index, const QVariant& value, int role)
{
Q_UNUSED(value);
if (role == Qt::UserRole) {
emit dataChanged(index, index);
return true;
......@@ -60,6 +61,7 @@ bool MyBrushResourcesListModel::setData(const QModelIndex& index, const QVariant
int MyBrushResourcesListModel::rowCount(const QModelIndex& parent) const
{
Q_UNUSED(parent);
return m_factory->brushes().size();
}
......
......@@ -56,9 +56,9 @@ bool MyPaintSurface::draw_dab (float x, float y,
if (radius < 0.1) return false;
if (hardness == 0.0) return false; // infintly small point, rest transparent
float r_fringe = radius + 1;
float rr = radius*radius;
float one_over_radius2 = 1.0/rr;
//float r_fringe = radius + 1;
//float rr = radius*radius;
//float one_over_radius2 = 1.0/rr;
m_qcolor.setRgbF(color_r, color_g, color_b, opaque);
m_color.fromQColor(m_qcolor);
......@@ -72,5 +72,12 @@ void MyPaintSurface::get_color (float x, float y,
float radius,
float* color_r, float* color_g, float* color_b, float* color_a )
{
Q_UNUSED(x);
Q_UNUSED(y);
Q_UNUSED(radius);
Q_UNUSED(color_r);
Q_UNUSED(color_g);
Q_UNUSED(color_b);
Q_UNUSED(color_a);
// XXX: calculate the average color inside this anti-aliased circle...
}
......@@ -412,6 +412,7 @@ void SprayBrush::paintEllipse(KisPainter* painter, qreal x, qreal y, int a, int
void SprayBrush::paintRectangle(KisPainter* painter, qreal x, qreal y, int width, int height, qreal angle, int steps)
{
Q_UNUSED(steps);
QPainterPath path;
QTransform transform;
......
......@@ -36,6 +36,7 @@ BrushShape::~BrushShape()
void BrushShape::fromDistance(int radius, float scale)
{
Q_UNUSED(scale);
m_width = m_height = radius * 2 + 1;
qreal distance = 0.0;
qreal maxDist = sqrt(radius * radius);
......
......@@ -69,6 +69,7 @@ KisToolEllipse::~KisToolEllipse()