Commit aa0b85e9 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Code style: replace NULL with 0

Except in 3rd-party code. We use 0 everywhere, not NULL, not Q_NULL_PTR.
parent 90686e9b
......@@ -236,7 +236,7 @@ QVector<Tile> generateTiles(int size,
const size_t pixelAlignment = qMax(size_t(vecSize * sizeof(float)), size_t(256));
const size_t maskAlignment = qMax(size_t(vecSize), size_t(256));
for (int i = 0; i < size; i++) {
void *ptr = NULL;
void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, pixelAlignment, numPixels * pixelSize + srcAlignmentShift);
if (error) {
qFatal("posix_memalign failed: %d", error);
......@@ -820,7 +820,7 @@ void KisCompositionBenchmark::benchmarkUintFloat()
{
#ifdef HAVE_VC
const int dataSize = 4096;
void *ptr = NULL;
void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, uint8VecAlignment, dataSize);
if (error) {
qFatal("posix_memalign failed: %d", error);
......@@ -850,7 +850,7 @@ void KisCompositionBenchmark::benchmarkUintIntFloat()
{
#ifdef HAVE_VC
const int dataSize = 4096;
void *ptr = NULL;
void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, uint8VecAlignment, dataSize);
if (error) {
qFatal("posix_memalign failed: %d", error);
......@@ -880,7 +880,7 @@ void KisCompositionBenchmark::benchmarkFloatUint()
{
#ifdef HAVE_VC
const int dataSize = 4096;
void *ptr = NULL;
void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, uint32VecAlignment, dataSize * sizeof(quint32));
if (error) {
qFatal("posix_memalign failed: %d", error);
......@@ -910,7 +910,7 @@ void KisCompositionBenchmark::benchmarkFloatIntUint()
{
#ifdef HAVE_VC
const int dataSize = 4096;
void *ptr = NULL;
void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, uint32VecAlignment, dataSize * sizeof(quint32));
if (error) {
qFatal("posix_memalign failed: %d", error);
......
......@@ -31,7 +31,7 @@ DeclarativeDragDropEvent::DeclarativeDragDropEvent(QDropEvent* e, DeclarativeDro
m_y(e->pos().y()),
m_buttons(e->mouseButtons()),
m_modifiers(e->keyboardModifiers()),
m_data(Q_NULLPTR),
m_data(0),
m_event(e)
{
}
......@@ -42,7 +42,7 @@ DeclarativeDragDropEvent::DeclarativeDragDropEvent(QDragLeaveEvent* e, Declarati
m_y(0),
m_buttons(Qt::NoButton),
m_modifiers(Qt::NoModifier),
m_data(Q_NULLPTR),
m_data(0),
m_event(0)
{
Q_UNUSED(e);
......
......@@ -529,7 +529,7 @@ QPointF *FitCubic(const QList<QPointF> &points, int first, int last, FitVector t
tHatCenter = ComputeCenterTangent(points, splitPoint);
int w1, w2;
QPointF *cu1 = NULL, *cu2 = NULL;
QPointF *cu1 = 0, *cu2 = 0;
cu1 = FitCubic(points, first, splitPoint, tHat1, tHatCenter, error, w1);
tHatCenter.negate();
......
......@@ -110,7 +110,7 @@ SvgGradientHelper* SvgParser::findGradient(const QString &id, const QString &hre
return 0;
}
// return successfully parsed gradient or NULL
// return successfully parsed gradient or 0
QString n;
if (href.isEmpty())
n = id;
......@@ -180,7 +180,7 @@ SvgFilterHelper* SvgParser::findFilter(const QString &id, const QString &href)
return 0;
}
// return successfully parsed filter or NULL
// return successfully parsed filter or 0
QString n;
if (href.isEmpty())
n = id;
......@@ -217,7 +217,7 @@ SvgClipPathHelper* SvgParser::findClipPath(const QString &id, const QString &hre
return 0;
}
// return successfully parsed clip path or NULL
// return successfully parsed clip path or 0
const QString n = href.isEmpty() ? id : href;
if (m_clipPaths.contains(n))
return &m_clipPaths[ n ];
......
......@@ -73,7 +73,7 @@ struct Q_DECL_HIDDEN KisPaintOpSettings::Private {
KisPaintOpSettings::KisPaintOpSettings()
: d(new Private)
{
d->preset = NULL;
d->preset = 0;
}
KisPaintOpSettings::~KisPaintOpSettings()
......
......@@ -343,7 +343,7 @@ int KisImageConfig::totalRAM()
# endif
size_t len = sizeof(physmem);
error = sysctl(mib, 2, &physmem, &len, NULL, 0);
error = sysctl(mib, 2, &physmem, &len, 0, 0);
if(!error) {
totalMemory = physmem >> 20;
}
......@@ -367,7 +367,7 @@ int KisImageConfig::totalRAM()
size_t len = sizeof(size);
errno = 0;
if (sysctl(mib, namelen, &size, &len, NULL, 0) >= 0) {
if (sysctl(mib, namelen, &size, &len, 0, 0) >= 0) {
totalMemory = size >> 20;
error = 0;
}
......
......@@ -225,7 +225,7 @@ namespace Private {
{
const gsl_multimin_fminimizer_type *T =
gsl_multimin_fminimizer_nmsimplex2;
gsl_multimin_fminimizer *s = NULL;
gsl_multimin_fminimizer *s = 0;
gsl_vector *ss, *x;
gsl_multimin_function minex_func;
......
......@@ -200,7 +200,7 @@ KisWarpTransformWorker::KisWarpTransformWorker(WarpType warpType, KisPaintDevice
m_warpMathFunction = &rigidTransformMath;
break;
default:
m_warpMathFunction = NULL;
m_warpMathFunction = 0;
break;
}
}
......
......@@ -96,7 +96,7 @@ KisRandomGeneratorDemo::KisRandomGeneratorDemo(QWidget* parent) : QWidget(parent
_noUpdate = true;
setupUi(this);
srand(time(NULL));
srand(time(0));
seed1->setValue(rand() & 0xFFFF);
seed2->setValue(rand() & 0xFFFF);
seed3->setValue(rand() & 0xFFFF);
......
......@@ -267,7 +267,7 @@ void KUndo2Command::undo()
QString KUndo2Command::actionText() const
{
if(d->actionText!=NULL)
if(d->actionText!=0)
return d->actionText;
else
return QString();
......@@ -1038,7 +1038,7 @@ QString KUndo2QStack::undoText() const
{
if (!m_macro_stack.isEmpty())
return QString();
if (m_index > 0 && m_command_list.at(m_index-1)!=NULL)
if (m_index > 0 && m_command_list.at(m_index-1)!=0)
return m_command_list.at(m_index - 1)->actionText();
return QString();
......
......@@ -210,7 +210,7 @@ BOOL isWow64()
fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress(
GetModuleHandle(TEXT("kernel32")),"IsWow64Process");
if(NULL != fnIsWow64Process)
if(0 != fnIsWow64Process)
{
if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64))
{
......
......@@ -129,7 +129,7 @@ public:
void setProgresUpdater(KoProgressUpdater *updater);
/**
* Return the KoProgressUpdater or NULL if there is none.
* Return the KoProgressUpdater or 0 if there is none.
**/
KoProgressUpdater *progressUpdater() const;
......
......@@ -187,7 +187,7 @@ void KisTemplateCreateDia::slotSelectionChanged()
if ( ! item )
return;
if ( item->parent() != NULL )
if ( item->parent() != 0 )
{
d->m_name->setText( item->text( 0 ) );
}
......@@ -242,7 +242,7 @@ void KisTemplateCreateDia::slotOk() {
return;
}
// is it a group or a template? anyway - get the group :)
if(item->parent() != NULL)
if(item->parent() != 0)
item=item->parent();
if(!item) { // *very* safe :P
d->m_tree.writeTemplateTree();
......@@ -443,7 +443,7 @@ void KisTemplateCreateDia::slotRemove() {
QString what;
QString removed;
if (item->parent() == NULL) {
if (item->parent() == 0) {
what = i18n("Do you really want to remove that group?");
removed = i18nc("@title:window", "Remove Group");
} else {
......@@ -459,7 +459,7 @@ void KisTemplateCreateDia::slotRemove() {
return;
}
if(item->parent() == NULL) {
if(item->parent() == 0) {
KisTemplateGroup *group=d->m_tree.find(item->text(0));
if(group)
group->setHidden(true);
......
......@@ -83,7 +83,7 @@ bool KisTemplateGroup::add(KisTemplate *t, bool force, bool touch)
KisTemplate *KisTemplateGroup::find(const QString &name) const
{
QList<KisTemplate*>::const_iterator it = m_templates.begin();
KisTemplate* ret = NULL;
KisTemplate* ret = 0;
while (it != m_templates.end()) {
if ((*it)->name() == name) {
......
......@@ -111,19 +111,19 @@ void KisTemplateTree::add(KisTemplateGroup *g)
{
KisTemplateGroup *group = find(g->name());
if (group == NULL)
if (group == 0)
m_groups.append(g);
else {
group->addDir(g->dirs().first()); // "...there can be only one..." (Queen)
delete g;
g = NULL;
g = 0;
}
}
KisTemplateGroup *KisTemplateTree::find(const QString &name) const
{
QList<KisTemplateGroup*>::const_iterator it = m_groups.begin();
KisTemplateGroup* ret = NULL;
KisTemplateGroup* ret = 0;
while (it != m_groups.end()) {
if ((*it)->name() == name) {
......
......@@ -368,7 +368,7 @@ void QXcbConnection::xi2Select(xcb_window_t window)
XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id)
{
XInput2TouchDeviceData *dev = Q_NULLPTR;
XInput2TouchDeviceData *dev = 0;
QHash<int, XInput2TouchDeviceData*>::const_iterator devIt = m_touchDevices.constFind(id);
if (devIt != m_touchDevices.cend()) {
dev = devIt.value();
......
......@@ -342,7 +342,7 @@ public:
delete[] row_pointer;
}
virtual png_bytep readLine() {
png_read_row(png_ptr, row_pointer, NULL);
png_read_row(png_ptr, row_pointer, 0);
return row_pointer;
}
private:
......@@ -437,14 +437,14 @@ KisImageBuilder_Result KisPNGConverter::buildImage(QIODevice* iod)
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr) {
png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
png_destroy_read_struct(&png_ptr, (png_infopp)0, (png_infopp)0);
iod->close();
return (KisImageBuilder_RESULT_FAILURE);
}
png_infop end_info = png_create_info_struct(png_ptr);
if (!end_info) {
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)0);
iod->close();
return (KisImageBuilder_RESULT_FAILURE);
}
......@@ -485,7 +485,7 @@ KisImageBuilder_Result KisPNGConverter::buildImage(QIODevice* iod)
// Read information about the png
png_uint_32 width, height;
int color_nb_bits, color_type, interlace_type;
png_get_IHDR(png_ptr, info_ptr, &width, &height, &color_nb_bits, &color_type, &interlace_type, NULL, NULL);
png_get_IHDR(png_ptr, info_ptr, &width, &height, &color_nb_bits, &color_type, &interlace_type, 0, 0);
dbgFile << "width = " << width << " height = " << height << " color_nb_bits = " << color_nb_bits << " color_type = " << color_type << " interlace_type = " << interlace_type << endl;
// swap byteorder on little endian machines.
#ifndef WORDS_BIGENDIAN
......@@ -672,7 +672,7 @@ KisImageBuilder_Result KisPNGConverter::buildImage(QIODevice* iod)
if (color_type == PNG_COLOR_TYPE_PALETTE) {
png_bytep alpha_ptr;
int num_alpha;
png_get_tRNS(png_ptr, info_ptr, &alpha_ptr, &num_alpha, NULL);
png_get_tRNS(png_ptr, info_ptr, &alpha_ptr, &num_alpha, 0);
for (int i = 0; i < num_alpha; ++i) {
palette_alpha[i] = alpha_ptr[i];
}
......@@ -885,7 +885,7 @@ KisImageBuilder_Result KisPNGConverter::buildFile(QIODevice* iodevice, const QRe
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr) {
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
png_destroy_write_struct(&png_ptr, (png_infopp)0);
return (KisImageBuilder_RESULT_FAILURE);
}
......@@ -1108,7 +1108,7 @@ KisImageBuilder_Result KisPNGConverter::buildFile(QIODevice* iodevice, const QRe
#endif
// Write the PNG
// png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
// png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, 0);
// Fill the data structure
png_byte** row_pointers = new png_byte*[imageRect.height()];
......@@ -1209,7 +1209,7 @@ void KisPNGConverter::cancel()
void KisPNGConverter::progress(png_structp png_ptr, png_uint_32 row_number, int pass)
{
if (png_ptr == NULL || row_number > PNG_MAX_UINT || pass > 7) return;
if (png_ptr == 0 || row_number > PNG_MAX_UINT || pass > 7) return;
// setProgress(row_number);
}
......
......@@ -124,7 +124,7 @@ bool QtLocalPeer::sendMessage(const QByteArray &message, int timeout, bool block
Sleep(DWORD(ms));
#else
struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
nanosleep(&ts, NULL);
nanosleep(&ts, 0);
#endif
}
if (!connOk)
......
......@@ -66,11 +66,11 @@ KisCurveWidget::KisCurveWidget(QWidget *parent, Qt::WFlags f)
d->m_readOnlyMode = false;
d->m_guideVisible = false;
d->m_pixmapDirty = true;
d->m_pixmapCache = NULL;
d->m_pixmapCache = 0;
d->setState(ST_NORMAL);
d->m_intIn = NULL;
d->m_intOut = NULL;
d->m_intIn = 0;
d->m_intOut = 0;
setMouseTracking(true);
setAutoFillBackground(false);
......@@ -117,7 +117,7 @@ void KisCurveWidget::dropInOutControls()
disconnect(d->m_intIn, SIGNAL(valueChanged(int)), this, SLOT(inOutChanged(int)));
disconnect(d->m_intOut, SIGNAL(valueChanged(int)), this, SLOT(inOutChanged(int)));
d->m_intIn = d->m_intOut = NULL;
d->m_intIn = d->m_intOut = 0;
}
......
......@@ -50,7 +50,7 @@ void KisSizeGroupPrivate::addWidget(QWidget *widget)
QLayout *layout = parent->layout();
if (layout) {
// Search for the widget index and the QLayoutItem inside of the layout
QLayoutItem *layoutItem = NULL;
QLayoutItem *layoutItem = 0;
int layoutWidgetIndex = 0;
for(int i = 0; i < layout->count(); ++i) {
layoutItem = layout->itemAt(layoutWidgetIndex);
......@@ -126,7 +126,7 @@ void KisSizeGroupPrivate::removeWidget(QWidget *widget)
QLayout *layout = parent->layout();
if (layout) {
// Search the GroupItem of the widget inside of the GroupItem list
GroupItem *widgetGroupItem = NULL;
GroupItem *widgetGroupItem = 0;
Q_FOREACH(GroupItem * groupItem, m_groupItems) {
if (groupItem->widget() == widget) {
widgetGroupItem = groupItem;
......
......@@ -34,10 +34,10 @@ KoLineEditAction::KoLineEditAction(QObject* parent)
: QWidgetAction(parent)
, m_closeParentOnTrigger(false)
{
QWidget* pWidget = new QWidget (NULL);
QWidget* pWidget = new QWidget (0);
QHBoxLayout* pLayout = new QHBoxLayout();
m_label = new QLabel(NULL);
m_editBox = new QLineEdit(NULL);
m_label = new QLabel(0);
m_editBox = new QLineEdit(0);
pLayout->addWidget(m_label);
pLayout->addWidget(m_editBox);
pWidget->setLayout(pLayout);
......
......@@ -56,7 +56,7 @@ ShortcutEditWidget::ShortcutEditWidget(QWidget *viewport, const QKeySequence &de
: QWidget(viewport),
m_defaultKeySequence(defaultSeq),
m_isUpdating(false),
m_action(Q_NULLPTR)
m_action(0)
{
QGridLayout *layout = new QGridLayout(this);
......
......@@ -132,7 +132,7 @@ void KisShortcutsEditor::addCollection(KActionCollection *collection, const QStr
hierarchy[KisShortcutsEditorPrivate::Root] = d->ui.list->invisibleRootItem();
hierarchy[KisShortcutsEditorPrivate::Program] =
d->findOrMakeItem(hierarchy[KisShortcutsEditorPrivate::Root], collectionTitle);
hierarchy[KisShortcutsEditorPrivate::Action] = NULL;
hierarchy[KisShortcutsEditorPrivate::Action] = 0;
// Remember which actions we have seen. We will be adding categorized
// actions first, so this will help us keep track of which actions haven't
......
......@@ -101,7 +101,7 @@ public:
/**
* Default constructor
*/
explicit KActionCategory(const QString &text, KActionCollection *parent = NULL);
explicit KActionCategory(const QString &text, KActionCollection *parent = 0);
/**
* Destructor
......@@ -120,25 +120,25 @@ public:
QAction *addAction(const QString &name, QAction *action);
QAction *addAction(
KStandardAction::StandardAction actionType,
const QObject *receiver = NULL,
const char *member = NULL);
const QObject *receiver = 0,
const char *member = 0);
QAction *addAction(
KStandardAction::StandardAction actionType,
const QString &name,
const QObject *receiver = NULL,
const char *member = NULL);
const QObject *receiver = 0,
const char *member = 0);
QAction *addAction(
const QString &name,
const QObject *receiver = NULL,
const char *member = NULL);
const QObject *receiver = 0,
const char *member = 0);
template<class ActionType>
ActionType *add(
const QString &name,
const QObject *receiver = NULL,
const char *member = NULL)
const QObject *receiver = 0,
const char *member = 0)
{
ActionType *action = collection()->add<ActionType>(name, receiver, member);
addAction(action);
......
......@@ -75,7 +75,7 @@ public:
QString m_componentName;
QString m_componentDisplayName;
//! Remove a action from our internal bookkeeping. Returns NULL if the
//! Remove a action from our internal bookkeeping. Returns 0 if the
//! action doesn't belong to us.
QAction *unlistAction(QAction *);
......@@ -351,7 +351,7 @@ void KActionCollection::removeAction(QAction *action)
QAction *KActionCollection::takeAction(QAction *action)
{
if (!d->unlistAction(action)) {
return NULL;
return 0;
}
// Remove the action from all widgets
......@@ -717,7 +717,7 @@ QAction *KActionCollectionPrivate::unlistAction(QAction *action)
// Action not found.
if (index == -1) {
return NULL;
return 0;
}
// An action collection can't have the same action twice.
......
......@@ -45,7 +45,7 @@ public:
QShortcutEvent *se = static_cast<QShortcutEvent *>(event);
if (se->isAmbiguous()) {
KMessageBox::information(
Q_NULLPTR, // No widget to be seen around here
0, // No widget to be seen around here
i18n("The key sequence '%1' is ambiguous. Use 'Configure Shortcuts'\n"
"from the 'Settings' menu to solve the ambiguity.\n"
"No action will be triggered.",
......
......@@ -223,7 +223,7 @@ void KCheckAccelerators::createDialog(QWidget *actWin, bool automatic)
QVBoxLayout *layout = new QVBoxLayout(drklash);
drklash_view = new QTextBrowser(drklash);
layout->addWidget(drklash_view);
QCheckBox *disableAutoCheck = NULL;
QCheckBox *disableAutoCheck = 0;
if (automatic) {
disableAutoCheck = new QCheckBox(i18nc("@option:check", "Disable automatic checking"), drklash);
connect(disableAutoCheck, SIGNAL(toggled(bool)), SLOT(slotDisableCheck(bool)));
......
......@@ -422,7 +422,7 @@ public:
const QString &cName, KActionCollection *collection)
: m_collection(collection),
m_widget(widget),
m_factory(NULL),
m_factory(0),
m_loadedOnce(false)
{
m_componentName = cName;
......
......@@ -184,7 +184,7 @@ public:
/**
* Returns the QAction * associated with the given parameter
* Will return NULL pointers if menu() has not been called
* Will return 0 pointers if menu() has not been called
*
* @param id The id of the action of which you want to get QAction *
*/
......
......@@ -157,9 +157,9 @@ public:
KKeySequenceWidgetPrivate::KKeySequenceWidgetPrivate(KKeySequenceWidget *q)
: q(q)
, layout(NULL)
, keyButton(NULL)
, clearButton(NULL)
, layout(0)
, keyButton(0)
, clearButton(0)
, allowModifierless(false)
, nKey(0)
, modifierKeys(0)
......
......@@ -113,7 +113,7 @@ public:
/**
* This will return the name of the XML file as set by setXMLFile().
* If setXML() is used directly, then this will return NULL.
* If setXML() is used directly, then this will return 0.
*
* The filename that this returns is obvious for components as each
* component has exactly one XML file. In non-components, however,
......
......@@ -365,7 +365,7 @@ void KXMLGUIFactoryPrivate::saveDefaultActionProperties(const QList<QAction *> &
// kxmlguiclient. We only want to execute the following code only once in
// the lifetime of an action.
Q_FOREACH (QAction *action, actions) {
// Skip NULL actions or those we have seen already.
// Skip 0 actions or those we have seen already.
if (!action || action->property("_k_DefaultShortcut").isValid()) {
continue;
}
......
......@@ -357,7 +357,7 @@ void KXmlGuiWindow::createStandardStatusBarAction()
d->showStatusBarAction->setChecked(sb->isHidden());
} else {
// If the language has changed, we'll need to grab the new text and whatsThis
QAction *tmpStatusBar = KStandardAction::showStatusbar(NULL, NULL, NULL);
QAction *tmpStatusBar = KStandardAction::showStatusbar(0, 0, 0);
d->showStatusBarAction->setText(tmpStatusBar->text());
d->showStatusBarAction->setWhatsThis(tmpStatusBar->whatsThis());
delete tmpStatusBar;
......
......@@ -132,7 +132,7 @@ public:
* setupGUI() instead of this one since it does more things for free
* like setting up the toolbar/shortcut edit actions, etc.
*
* If @p xmlfile is NULL,
* If @p xmlfile is 0,
* then it will try to construct a local XML filename like
* appnameui.rc where 'appname' is your app's name. If that file
* does not exist, then the XML UI code will only use the global
......
......@@ -339,13 +339,13 @@ public:
KoLcmsColorTransformation *adj = new KoLcmsColorTransformation(this);
adj->profiles[0] = cmsCreateLinearizationDeviceLink(this->colorSpaceSignature(), transferFunctions);
adj->profiles[1] = cmsCreateLinearizationDeviceLink(cmsSigGrayData, alphaTransferFunctions);
adj->profiles[2] = NULL;
adj->profiles[2] = 0;
adj->csProfile = d->profile->lcmsProfile();
adj->cmstransform = cmsCreateTransform(adj->profiles[0], this->colorSpaceType(), NULL, this->colorSpaceType(),
adj->cmstransform = cmsCreateTransform(adj->profiles[0], this->colorSpaceType(), 0, this->colorSpaceType(),
KoColorConversionTransformation::adjustmentRenderingIntent(),
KoColorConversionTransformation::adjustmentConversionFlags());
adj->cmsAlphaTransform = cmsCreateTransform(adj->profiles[1], TYPE_GRAY_DBL, NULL, TYPE_GRAY_DBL,
adj->cmsAlphaTransform = cmsCreateTransform(adj->profiles[1], TYPE_GRAY_DBL, 0, TYPE_GRAY_DBL,
KoColorConversionTransformation::adjustmentRenderingIntent(),
KoColorConversionTransformation::adjustmentConversionFlags());
......
......@@ -119,7 +119,7 @@ LcmsEnginePlugin::LcmsEnginePlugin(QObject *parent, const QVariantList &)
// ------------------- LAB ---------------------------------
KoColorProfile *labProfile = LcmsColorProfileContainer::createFromLcmsProfile(cmsCreateLab2Profile(NULL));
KoColorProfile *labProfile = LcmsColorProfileContainer::createFromLcmsProfile(cmsCreateLab2Profile(0));
registry->addProfile(labProfile);
registry->add(new LabU8ColorSpaceFactory());
......
......@@ -341,17 +341,17 @@ void KisRainDropsFilter::FreeBoolArray(bool** lpbArray, uint Columns) const
*/
bool** KisRainDropsFilter::CreateBoolArray(uint Columns, uint Rows) const
{
bool** lpbArray = NULL;
bool** lpbArray = 0;
lpbArray = (bool**) malloc(Columns * sizeof(bool*));
if (lpbArray == NULL)
return (NULL);
if (lpbArray == 0)
return (0);
for (uint i = 0; i < Columns; ++i) {
lpbArray[i] = (bool*) malloc(Rows * sizeof(bool));
if (lpbArray[i] == NULL) {
if (lpbArray[i] == 0) {
FreeBoolArray(lpbArray, Columns);
return (NULL);
return (0);
}
}
......
......@@ -98,7 +98,7 @@ void LabeledWidget::enterEvent(QEvent *event)
void LabeledWidget::setWarningText(int pos, const QString &warning)
{
if ((m_warningLabel[pos] == NULL)) {
if ((m_warningLabel[pos] == 0)) {
return;
}
m_warningLabel[pos]->setText(warning);
......
......@@ -854,7 +854,7 @@ void TextTool::mousePressEvent(KoPointerEvent *event)
if (event->button() == Qt::LeftButton && qApp->autoSipEnabled()) {
QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(qApp->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
// the two following bools just make it all a lot easier to read in the following if()
// basically, we require a widget for this to work (passing NULL to QApplication::sendEvent
// basically, we require a widget for this to work (passing 0 to QApplication::sendEvent
// crashes) and there are three tests any one of which can be true to trigger the event
const bool hasWidget = canvas()->canvasWidget();
const bool hasItem = canvas()->canvasItem();
......
......@@ -50,7 +50,7 @@ class ChangeConfigureDialog: public QDialog
} ChangeType;
public:
ChangeConfigureDialog(const QColor &insertionColor, const QColor &deletionColor, const QColor &formatChangeColor, const QString &authorName, KoChangeTracker::ChangeSaveFormat changeSaveFormat, QWidget *parent = NULL);
ChangeConfigureDialog(const QColor &insertionColor, const QColor &deletionColor, const QColor &formatChangeColor, const QString &authorName, KoChangeTracker::ChangeSaveFormat changeSaveFormat, QWidget *parent = 0);
~ChangeConfigureDialog();
const QColor &getInsertionBgColor();
......
......@@ -93,7 +93,7 @@ public:
/**
* Returns pointer to the deepest KoSection that covers @p pos
* or NULL if there is no such section
* or 0 if there is no such section
*/
KoSection *sectionAtPosition(int pos);
......
......@@ -602,16 +602,16 @@ void KoChangeTracker::insertDeleteFragment(QTextCursor &cursor)
int docOutlineLevel = cursor.block().blockFormat().property(KoParagraphStyle::OutlineLevel).toInt();
if (docOutlineLevel) {
//Even though we got a list, it is actually a list for storing headings. So don't consider it
currentList = NULL;
currentList = 0;