]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Invert logic of ternary pointer checks
authorBrad King <brad.king@kitware.com>
Wed, 21 Oct 2015 15:59:45 +0000 (11:59 -0400)
committerBrad King <brad.king@kitware.com>
Mon, 26 Oct 2015 14:17:49 +0000 (10:17 -0400)
commit2fe3bcb8c9be3e9476665d8b167f40cd905aac70
tree83473f0dc40c2fca12735f17396384784d39bf27
parent72afc6f0e8f3cec187969354d63ad18574102718
Invert logic of ternary pointer checks

A PGI compiler warning is triggered by expressions like

  ptr == NULL ? NULL : ptr

that the PGI compiler handles incorrectly.  It chooses the pointer type
of the first option (void*) and warns about conversion of the second
without a cast.  Flip the expression logic to

  ptr != NULL ? ptr : NULL

to help the compiler choose the proper result type.
libarchive/archive_read.c
libarchive/archive_read_support_format_7zip.c
libarchive/archive_write.c