Change null pointer reference from zero to nullptr
ClosedPublic

Authored by Shroudmaster on Oct 11 2018, 10:20 PM.

Diff Detail

Repository
R337 KTurtle
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Shroudmaster created this revision.Oct 11 2018, 10:20 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptOct 11 2018, 10:20 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
Shroudmaster requested review of this revision.Oct 11 2018, 10:20 PM
rizzitello requested changes to this revision.Oct 12 2018, 1:35 AM
rizzitello added a subscriber: rizzitello.

Check your Indentation you seam to have moved all your modified lines in a bit.

src/editor.cpp
427

In this situation we can do this.

if (pointer) {
    pointer is something
} else {
   pointer is null
}

since any non 0 value is true if your pointer has be initialized will be "true"

This revision now requires changes to proceed.Oct 12 2018, 1:35 AM

Fixed the indentation and conditional

rizzitello requested changes to this revision.Oct 12 2018, 5:20 PM
rizzitello added inline comments.
src/mainwindow.cpp
139

Missed one

This revision now requires changes to proceed.Oct 12 2018, 5:20 PM

Third time is the charm!

rizzitello requested changes to this revision.Oct 12 2018, 6:52 PM
rizzitello added inline comments.
src/mainwindow.cpp
139

check your logic here.
Pretty sure we want

if(!colorPicker)

here

This revision now requires changes to proceed.Oct 12 2018, 6:52 PM

Sorry, innocent mistake

rizzitello accepted this revision.Oct 12 2018, 8:01 PM

Much Nicer !

This revision is now accepted and ready to land.Oct 12 2018, 8:01 PM
aacid added a subscriber: aacid.Oct 12 2018, 8:02 PM

Oh you're doing this manually?

You really want to be using a tool for this

https://www.kdab.com/clang-tidy-part-1-modernize-source-code-using-c11c14/

has some example of how to use clang-tidy to run the modernize-use-nullptr "checker"

Sorry, it seems I forgot a file before

tcanabrava accepted this revision.Oct 13 2018, 7:02 PM
This revision was automatically updated to reflect the committed changes.