Description: Fix some legitimate GCC warnings.
 cast to pointer from integer of different size
 passing argument N of ‘foo’ from incompatible pointer type
 the address of 'foo' will always evaluate as 'true'
Bug-Debian: https://bugs.debian.org/749762
Forwarded: https://savannah.nongnu.org/bugs/?54123
Author: Yavor Doganov <yavor@gnu.org>
Last-Update: 2023-02-27
---

--- pantomime.orig/Framework/Pantomime/CWIMAPCacheManager.m
+++ pantomime/Framework/Pantomime/CWIMAPCacheManager.m
@@ -364,7 +364,7 @@
   write_data(_fd, theRecord->to);
   write_data(_fd, theRecord->cc);
   
-  NSMapInsert(_table, (void *)theRecord->imap_uid, theMessage);
+  NSMapInsert(_table, (void *)(intptr_t)theRecord->imap_uid, theMessage);
   _count++;
 }
 
--- pantomime.orig/Framework/Pantomime/CWService.m
+++ pantomime/Framework/Pantomime/CWService.m
@@ -558,7 +558,7 @@
 	  // If we are done writing, let's remove the watcher on our fd.
 	  for (i = 0; i < [_runLoopModes count]; i++)
 	    {
-	      [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd]
+	      [[NSRunLoop currentRunLoop] removeEvent: (void *)(intptr_t)[_connection fd]
 					  type: ET_WDESC
 					  forMode: [_runLoopModes objectAtIndex: i]
 					  all: YES];
@@ -622,7 +622,7 @@
 #ifndef __MINGW32__
       for (i = 0; i < [_runLoopModes count]; i++)
 	{
-	  [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd]
+	  [[NSRunLoop currentRunLoop] addEvent: (void *)(intptr_t)[_connection fd]
 				      type: ET_WDESC
 				      watcher: self
 				      forMode: [_runLoopModes objectAtIndex: i]];
@@ -812,7 +812,7 @@
 
   for (i = 0; i < [_runLoopModes count]; i++)
     {
-      [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd]
+      [[NSRunLoop currentRunLoop] addEvent: (void *)(intptr_t)[_connection fd]
 #ifdef __MINGW32__
 				  type: ET_HANDLE
 #else
@@ -821,7 +821,7 @@
 				  watcher: self
 				  forMode: [_runLoopModes objectAtIndex: i]];
       
-      [[NSRunLoop currentRunLoop] addEvent: (void *)[_connection fd]
+      [[NSRunLoop currentRunLoop] addEvent: (void *)(intptr_t)[_connection fd]
 #ifdef __MINGW32__
 				  type: ET_TRIGGER
 #else
@@ -878,17 +878,17 @@
                                   forMode: [_runLoopModes objectAtIndex: i]
                                   all: YES];
 #else
-      [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd]
+      [[NSRunLoop currentRunLoop] removeEvent: (void *)(intptr_t)[_connection fd]
 				  type: ET_RDESC
 				  forMode: [_runLoopModes objectAtIndex: i]
 				  all: YES];
       
-      [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd]
+      [[NSRunLoop currentRunLoop] removeEvent: (void *)(intptr_t)[_connection fd]
 				  type: ET_WDESC
 				  forMode: [_runLoopModes objectAtIndex: i]
 				  all: YES];
       
-      [[NSRunLoop currentRunLoop] removeEvent: (void *)[_connection fd]
+      [[NSRunLoop currentRunLoop] removeEvent: (void *)(intptr_t)[_connection fd]
 				  type: ET_EDESC
 				  forMode: [_runLoopModes objectAtIndex: i]
 				  all: YES];
--- pantomime.orig/Framework/Pantomime/CWConstants.h
+++ pantomime/Framework/Pantomime/CWConstants.h
@@ -141,14 +141,14 @@
 }
 
 #define AUTHENTICATION_COMPLETED(del, s) \
-POST_NOTIFICATION(PantomimeAuthenticationCompleted, self, [NSDictionary dictionaryWithObject: ((id)s?(id)s:(id)@"")  forKey:  @"Mechanism"]); \
-PERFORM_SELECTOR_2(del, @selector(authenticationCompleted:), PantomimeAuthenticationCompleted, ((id)s?(id)s:(id)@""), @"Mechanism");
+POST_NOTIFICATION(PantomimeAuthenticationCompleted, self, [NSDictionary dictionaryWithObject: ((id)s != nil ?(id)s:(id)@"")  forKey:  @"Mechanism"]); \
+PERFORM_SELECTOR_2(del, @selector(authenticationCompleted:), PantomimeAuthenticationCompleted, ((id)s != nil ?(id)s:(id)@""), @"Mechanism");
 
 
 #define AUTHENTICATION_FAILED(del, s) \
 NSLog(@"AUTHENTICATION_FAILED: |%@|", s); \
-POST_NOTIFICATION(PantomimeAuthenticationFailed, self, [NSDictionary dictionaryWithObject: ((id)s?(id)s:(id)@"")  forKey:  @"Mechanism"]); \
-PERFORM_SELECTOR_2(del, @selector(authenticationFailed:), PantomimeAuthenticationFailed, ((id)s?(id)s:(id)@""), @"Mechanism");
+POST_NOTIFICATION(PantomimeAuthenticationFailed, self, [NSDictionary dictionaryWithObject: ((id)s != nil ?(id)s:(id)@"")  forKey:  @"Mechanism"]); \
+PERFORM_SELECTOR_2(del, @selector(authenticationFailed:), PantomimeAuthenticationFailed, ((id)s != nil ?(id)s:(id)@""), @"Mechanism");
 
 #define POST_NOTIFICATION(name, obj, info) \
 [[NSNotificationCenter defaultCenter] postNotificationName: name \
--- pantomime.orig/Framework/Pantomime/CWPOP3CacheManager.m
+++ pantomime/Framework/Pantomime/CWPOP3CacheManager.m
@@ -103,7 +103,7 @@
 	  return self;
 	}      
 
-      if(read_uint32(_fd, &_count) <= 0)
+      if(read_uint32(_fd, (uint32_t *)&_count) <= 0)
         {
           NSLog(@"CWPOP3CacheManager initWithPath: error reading count");
         }
