[Libreoffice-commits] core.git: apple_remote/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 21 15:30:47 UTC 2020


 apple_remote/source/HIDRemoteControlDevice.m |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0540b098b7dab73c32947ed4b52cf3068eaa5125
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Feb 21 14:52:33 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Feb 21 16:30:11 2020 +0100

    Blind fix of -Werror,-Wpointer-to-int-cast in apple_remote
    
    (That warning is probably new in recent Clang 10 trunk, hence the issue only got
    reported now.)
    
    To me, this looks like a bug introduced with
    
    > commit aaf218d025326ef54dcbc724b33666d7ddcff187
    > Author: ericb2 <ericb2 at apache.org>
    > AuthorDate: Sun Oct 30 22:57:34 2011 +0000
    > Commit:     Thorsten Behrens <tbehrens at suse.com>
    > CommitDate: Mon Dec 5 13:00:11 2011 +0100
    >
    >     Propragating the modif in the implementation (HIDRemoteControlDevice.m)
    >
    >      * found under MIT-style at svn rev 1195272 (http://svn.apache.org/viewvc?view=revision&revision=1195272)
    >
    > diff --git a/apple_remote/HIDRemoteControlDevice.m b/apple_remote/HIDRemoteControlDevice.m
    > index 94215900717b..2cd7506e60d3 100644
    > --- a/apple_remote/HIDRemoteControlDevice.m
    > +++ b/apple_remote/HIDRemoteControlDevice.m
    > @@ -281,7 +281,17 @@ - (void) handleEventWithCookieString: (NSString*) cookieString sumOfValues: (SIn
    >
    >         NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString];
    >         if (buttonId != nil) {
    > -               [self sendRemoteButtonEvent: [buttonId intValue] pressedDown: (sumOfValues>0)];
    > +       switch ( (int)buttonId )
    > +       {
    > +       case kMetallicRemote2009ButtonPlay:
    > +       case kMetallicRemote2009ButtonMiddlePlay:
    > +           buttonId = [NSNumber numberWithInt:kRemoteButtonPlay];
    > +           break;
    > +       default:
    > +           break;
    > +       }
    > +       [self sendRemoteButtonEvent: [buttonId intValue] pressedDown: (sumOfValues>0)];
    > +
    >         } else {
    >                 // let's see if a number of events are stored in the cookie string. this does
    >                 // happen when the main thread is too busy to handle all incoming events in time.
    
    (which indeed appears to be a faithful copy of all the non-whitespace changes
    made at the cited <http://svn.apache.org/viewvc?view=revision&revision=1195272>
    "Propragating the modif in the implementation (HIDRemoteControlDevice.m)").
    
    I assume that my fix here is what was originally intended, but I don't know how
    to actually test this code (if it is still testable at all).
    
    Change-Id: If8faa8e068c7d7dffb4677efdaa5896cf6fd4c0e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89209
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/apple_remote/source/HIDRemoteControlDevice.m b/apple_remote/source/HIDRemoteControlDevice.m
index 58f936d180cb..9a875d1910c4 100644
--- a/apple_remote/source/HIDRemoteControlDevice.m
+++ b/apple_remote/source/HIDRemoteControlDevice.m
@@ -286,7 +286,7 @@ cleanup:
 
     NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString];
     if (buttonId != nil) {
-       switch ( (int)buttonId )
+       switch ( [buttonId intValue] )
        {
        case kMetallicRemote2009ButtonPlay:
        case kMetallicRemote2009ButtonMiddlePlay:


More information about the Libreoffice-commits mailing list