D10168: Use nullptr for passing a null pointer to crc32

2018-03-06 Thread Albert Astals Cid
This revision was automatically updated to reflect the committed changes.
Closed by commit R243:61d39cae560a: Use nullptr for passing a null pointer to 
crc32 (authored by aacid).

REPOSITORY
  R243 KArchive

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D10168?vs=26154&id=28852

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

AFFECTED FILES
  src/kgzipfilter.cpp
  src/kzip.cpp

To: aacid, mpyne
Cc: mpyne, #frameworks, michaelh


D10168: Use nullptr for passing a null pointer to crc32

2018-03-05 Thread Michael Pyne
mpyne accepted this revision.
mpyne added a comment.
This revision is now accepted and ready to land.


  Actually `-Wzero-as-null-pointer-constant` is probably a good idea, and this 
is a correct fix.  A decade ago when everything was going from 32 to 64-bits, 
we ran into a JuK crash bug because we used `GST_NULL` (or similar) as the null 
constant for a gstreamer variadic C function, which in C++ mode was `0`.  Well, 
C++ didn't know that the `0` was supposed to be a pointer instead of an `int`, 
so the function in question crashed because C++ put a 32-bit `int` on the stack 
instead of a 64-bit null pointer.
  
  Using `nullptr` consistently solves this issue, even though it wouldn't be a 
problem here since C++ can see that the `0` is supposed to convert to a pointer.
  
  The real fix should probably go in zlib, but I wouldn't hold my breath due to 
the compatibility requirements that I would imagine they maintain.

REPOSITORY
  R243 KArchive

BRANCH
  master

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

To: aacid, mpyne
Cc: mpyne, #frameworks, michaelh


D10168: Use nullptr for passing a null pointer to crc32

2018-03-04 Thread Albert Astals Cid
aacid added a comment.


  ping?

REPOSITORY
  R243 KArchive

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

To: aacid
Cc: #frameworks, michaelh


D10168: Use nullptr for passing a null pointer to crc32

2018-01-28 Thread Albert Astals Cid
aacid created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
aacid requested review of this revision.

REVISION SUMMARY
  I'm a bit unconvinced, wihtout it we get a warning if we enable 
-Wzero-as-null-pointer-constant
  but using Z_NULL seems to be more "what the library wants"
  
  If we don't want this, this would be a reason against enabling 
-Wzero-as-null-pointer-constant
  for all the frameworks as i've suggested in the other review

REPOSITORY
  R243 KArchive

BRANCH
  master

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

AFFECTED FILES
  src/kgzipfilter.cpp
  src/kzip.cpp

To: aacid
Cc: #frameworks, michaelh