D20008: Fix uninitialized value in SimpleJobPrivate

2019-03-23 Thread Michael Pyne
mpyne created this revision.
mpyne added reviewers: dfaure, Frameworks, apol.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
mpyne requested review of this revision.

REVISION SUMMARY
  As reported in bug 404474 , GCC 
gives a warning about using an uninitialized value in KIO.
  
  The relevant portion of code is:
  
FileOperationType opType;
switch (command) {
case CMD_DEL:
opType = Delete;
break;
case CMD_RENAME:
opType = Rename;
break;
case CMD_SYMLINK:
opType = Symlink;
break;
}
job->d_func()->m_operationType = opType;
 
  
  `command` in this case is an `int` and there's no other checks here to let 
the compiler know that `command` could only be one of those three values. 
There's a comment here but even I don't know whether the comment discusses what 
*should* be true or what *is* actually checked elsewhere.
  
  Since even I was confused I don't blame the compiler. So I add a default 
branch that just returns the job unmodified. There may be a better error 
condition here.

TEST PLAN
  Builds, installs, KIO-using software works fine still.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D20008

AFFECTED FILES
  src/core/job_p.h

To: mpyne, dfaure, #frameworks, apol
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D20008: Fix uninitialized value in SimpleJobPrivate

2019-03-23 Thread David Faure
dfaure accepted this revision.
dfaure added a comment.
This revision is now accepted and ready to land.


  The patch is OK, but the commit message is scarier than the truth. There is 
no actual use of an uninitialized value in practice. Please add "compiler 
warning" to the commit log.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D20008

To: mpyne, dfaure, #frameworks, apol
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D20008: Fix uninitialized value in SimpleJobPrivate

2019-03-24 Thread Michael Pyne
This revision was automatically updated to reflect the committed changes.
Closed by commit R241:920d2c4ca7d5: kjobs: Fix compiler warning for uninit 
value in SimpleJobPrivate. (authored by mpyne).

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D20008?vs=54642&id=54693

REVISION DETAIL
  https://phabricator.kde.org/D20008

AFFECTED FILES
  src/core/job_p.h

To: mpyne, dfaure, #frameworks, apol
Cc: kde-frameworks-devel, michaelh, ngraham, bruns