[macports-ports] branch master updated: qt4-mac: Fix pointer comparison with 0.

Ryan Schmidt ryandesign at macports.org
Sat May 27 09:08:24 UTC 2017


> On May 24, 2017, at 09:28, Michael Dickens <michaelld at macports.org> wrote:
> 
> Michael Dickens (michaelld) pushed a commit to branch master
> in repository macports-ports.
> 
> 
> https://github.com/macports/macports-ports/commit/a12f8d370932d171fef29d833717b07b1b1e742a
> 
> The following commit(s) were added to refs/heads/master by this push:
> 
>      new a12f8d3  qt4-mac: Fix pointer comparison with 0.
> 
> a12f8d3 is described below
> 
> 
> commit a12f8d370932d171fef29d833717b07b1b1e742a
> 
> Author: Michael Dickens <michaelld at macports.org>
> AuthorDate: Wed May 24 10:28:58 2017 -0400
> 
> 
>     qt4-mac: Fix pointer comparison with 0.
> 
>     
> 
>     Addresses ticket https://trac.macports.org/ticket/54183 .
> 
> ---
>  aqua/qt4-mac/Portfile                              |  5 +++++
>  .../files/patch-fix_pointer_comparison_to_0.diff   | 22 ++++++++++++++++++++++
>  2 files changed, 27 insertions(+)
> 
> 
> diff --git a/aqua/qt4-mac/Portfile b/aqua/qt4-mac/Portfile
> 
> index afd319d..da02bc8 100644
> 
> --- a/aqua/qt4-mac/Portfile
> 
> +++ b/aqua/qt4-mac/Portfile
> 
> @@ -287,6 +287,11 @@ platform darwin {
> 
>  
>  patchfiles-append patch-better-invalid-fonttable-handling.diff
>  
> 
> +# (29) Fix pointer comparison with 0
> 
> +# These error out on clang 4.0, whereas they didn't in 3.9.
> 
> +
> 
> +patchfiles-append patch-fix_pointer_comparison_to_0.diff
> 
> +
> 
>  # error out if trying to build on a new OSX version (> 10.12).
>  
>  platform darwin {
> 
> diff --git a/aqua/qt4-mac/files/patch-fix_pointer_comparison_to_0.diff b/aqua/qt4-mac/files/patch-fix_pointer_comparison_to_0.diff
> 
> new file mode 100644
> 
> index 0000000..4ed86aa
> 
> --- /dev/null
> 
> +++ b/aqua/qt4-mac/files/patch-fix_pointer_comparison_to_0.diff
> 
> @@ -0,0 +1,22 @@
> 
> +--- src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp.orig
> 
> ++++ src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp
> 
> +@@ -74,7 +74,7 @@
> 
> +     RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document));
> 
> +     if (optionalWidth)
> 
> +         image->setWidth(*optionalWidth);
> 
> +-    if (optionalHeight > 0)
> 
> ++    if (optionalHeight)
> 
> +         image->setHeight(*optionalHeight);
> 
> +     return image.release();
> 
> + }

I agree that this change looks equivalent, but:


> +--- tools/linguist/linguist/messagemodel.cpp.orig
> 
> ++++ tools/linguist/linguist/messagemodel.cpp
> 
> +@@ -183,7 +183,7 @@
> 
> +         if (ContextItem *c = one->findContext(oc->context())) {
> 
> +             for (int j = 0; j < oc->messageCount(); ++j) {
> 
> +                 MessageItem *m = oc->messageItem(j);
> 
> +-                if (c->findMessage(m->text(), m->comment()) >= 0)
> 
> ++                if (c->findMessage(m->text(), m->comment()))
> 
> +                     ++inBoth;
> 
> +             }
> 
> +         }
> 

This change does not. Checking for >= 0 is not the same as checking for Boolean true. So this changes the behavior of the compiled code, doesn't it? So the port's revision should increase?




More information about the macports-dev mailing list