NSGraphicsContext: Suppress incompatible pointer type warning (#250)

```
NSGraphicsContext.m:349:50: warning: incompatible pointer types sending 'Class' to parameter of type 'id<NSCopying>' [-Wincompatible-pointer-types]
      methods = [[classMethodTable objectForKey: [self class]] pointerValue];
                                                 ^~~~~~~~~~~~
/usr/local/include/Foundation/NSDictionary.h:115:26: note: passing argument to parameter 'aKey' here
  (GS_GENERIC_TYPE(KeyT))aKey;                          // Primitive
                         ^
NSGraphicsContext.m:354:37: warning: incompatible pointer types sending 'Class' to parameter of type 'id<NSCopying>' [-Wincompatible-pointer-types]
                            forKey: [self class]];
                                    ^~~~~~~~~~~~
```
This commit is contained in:
Frederik Carlier 2024-04-01 22:54:57 +02:00 committed by GitHub
parent c50123f870
commit c6082e31db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -346,12 +346,12 @@ NSGraphicsContext *GSCurrentContext(void)
* be protected from other threads.
*/
[contextLock lock];
methods = [[classMethodTable objectForKey: [self class]] pointerValue];
methods = [[classMethodTable objectForKey: (id<NSCopying>)[self class]] pointerValue];
if (methods == 0)
{
methods = [[self class] _initializeMethodTable];
[classMethodTable setObject: [NSValue valueWithPointer: methods]
forKey: [self class]];
forKey: (id<NSCopying>)[self class]];
}
[contextLock unlock];
}