Re: [AD] GCC 4 warnings for MacOS X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hiya,

Actually, your patch just moved the warnings from line 172 to line 142.
 The type of the variable can't be changed without a typecast as one
function requires it to be signed and another unsigned.

Here's five patches.  I've gone through the mac os x warnings and
removed all but one: the one in src/macosx/system.m. I don't understand
it, exactly:

src/macosx/system.m: In function 'osx_event_handler':
src/macosx/system.m:143: warning: 'frame$size$height' may be used
uninitialized in this function

I think that the objc class NSRect should somehow be initialized, but
to be honest I'm not the best at Objective C (just started learning it
last week), so I'm not sure if that hunch is right.  Anyone else know? 
I'll keep trying to figure it out in any case.

Aside from that the OS X code now compiles without warnings on my
machine.

There's another issue, though -- at the system level the dynamic
libraries getting included when the examples are compiled are throwing
up warnings about doubly-defined symbols getting used from one spot and
not another.  Again I'm at the net cafe now and I wish I'd had the
foresight to bring those warnings with me; I'll post them as soon as I
can.  Essentially, though, they don't seem to have any adverse effect
on code operation.

Sorry this took so long.  Please let me know if these diffs are
alright?  I used that link you sent me, Evert.  Cheers for that! ^-^

On a side note, now that 10.4 has brought the Quartz 2D routines fully
up to speed, has there been any talk of changing the QuickDraw mac
video driver for a fully-accelerated Quartz 2D one?

Second side note: the mac version still doesn't recognize the
ALLEGRO_USE_CONSOLE flag -- it still pops up an icon in the dock for
console apps run from the command line.  I'm going to see if I can play
with the NSApplication calls to get it to stop doing that, but I don't
know if it's possible the way Allegro's mac driver is currently
written.

- Charles


--- Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:

> On Wednesday 11 May 2005 09:40, Evert Glebbeek wrote:
> > Seems there are still some more GCC 4-related warnings in the MacOS
> X
> > specific portion of the code, as reported here:
> > http://www.allegro.cc/forums/view_thread.php?_id=488821#target
> > Perhaps someone with a Mac can have a look at these?
> 
> I don't have a Mac, but I gave it my best shot. This should fix at
> least 
> some of them.
> 
> Evert


--- tools/macosx/fixbundle.c	Tue Apr  6 07:36:33 2004 UTC
+++ tools/macosx/fixbundle.c	Mon May 16 04:32:06 2005 UTC
@@ -517,7 +517,7 @@
 	    DisposeHandle(raw_data);
 	    /* Set 8bit mask */
             raw_data = NewHandle(icon_data[i].size * icon_data[i].size);
-	    data = *raw_data;
+	    data = (unsigned char *)raw_data;
 	    for (y = 0; y < icon_data[i].size; y++) {
 	       for (x = 0; x < icon_data[i].size; x++) {
 	          *data++ = geta32(((unsigned int *)(icon_data[i].scaled->line[y]))[x]);
@@ -534,7 +534,7 @@
 	    if (icon_data[i].mask1) {
 	       size = ((icon_data[i].size * icon_data[i].size) + 7) / 8;
 	       raw_data = NewHandle(size * 2);
-	       data = *raw_data;
+	       data = (unsigned char *)raw_data;
 	       mask_byte = 0;
 	       mask_bit = 7;
 	       for (y = 0; y < icon_data[i].size; y++) {
@@ -569,7 +569,7 @@
       }
       pack_fclose(f);
       
-      cf_url_ref = CFURLCreateWithBytes(kCFAllocatorDefault, bundle_icns, strlen(bundle_icns), 0, NULL);
+      cf_url_ref = CFURLCreateWithBytes(kCFAllocatorDefault, (unsigned char*)bundle_icns, strlen(bundle_icns), 0, NULL);
       if (!cf_url_ref) {
          fprintf(stderr, "Cannot create %s\n", bundle_icns);
 	 result = -1;
--- src/macosx/hidman.m	Mon Nov  3 18:42:17 2003 UTC
+++ src/macosx/hidman.m	Mon May 16 04:32:39 2005 UTC
@@ -121,9 +121,9 @@
 HID_DEVICE *osx_hid_scan(int type, int *num_devices)
 {
    HID_DEVICE *device, *this_device;
-   mach_port_t master_port = NULL;
-   io_iterator_t hid_object_iterator = NULL;
-   io_object_t hid_device = NULL;
+   mach_port_t master_port = 0;
+   io_iterator_t hid_object_iterator = 0;
+   io_object_t hid_device = 0;
    io_registry_entry_t parent1, parent2;
    CFMutableDictionaryRef class_dictionary = NULL;
    int usage, usage_page;
@@ -275,4 +275,3 @@
    }
    free(devices);
 }
-
--- src/macosx/main.m	Sun Jul 11 12:15:30 2004 UTC
+++ src/macosx/main.m	Mon May 16 04:32:54 2005 UTC
@@ -223,7 +223,7 @@
       keyEquivalent: @""];
    [[NSApp mainMenu] addItem: temp_item];
    [[NSApp mainMenu] setSubmenu: menu forItem: temp_item];
-   [NSApp setAppleMenu: menu];
+   //   [NSApp setAppleMenu: menu];
    NSString *quit = @"Quit ";
    menu_item = [[NSMenuItem allocWithZone: [NSMenu menuZone]]
       initWithTitle: [quit stringByAppendingString: [[NSProcessInfo processInfo] processName]]
--- src/macosx/quartz.m	Sat May 14 12:14:00 2005 UTC
+++ src/macosx/quartz.m	Mon May 16 04:34:13 2005 UTC
@@ -129,7 +129,7 @@
    BITMAP *bmp;
    GWorldPtr gworld;
    Rect rect;
-   unsigned char *addr;
+   char *addr;
    int pitch;
    int i, size;
    
@@ -169,7 +169,7 @@
    bmp->y_ofs = 0;
    bmp->seg = _video_ds();
 
-   bmp->line[0] = addr;
+   bmp->line[0] = (unsigned char *)addr;
 
    for (i = 1; i < height; i++)
       bmp->line[i] = bmp->line[i - 1] + pitch;
--- src/macosx/qtmidi.m	Tue Oct 21 18:54:41 2003 UTC
+++ src/macosx/qtmidi.m	Mon May 16 04:33:10 2005 UTC
@@ -159,7 +159,7 @@
          if (voice[i].channel) {
             NAPlayNote(note_allocator, voice[i].channel, voice[i].note, 0);
             NADisposeNoteChannel(note_allocator, voice[i].channel);
-	    voice[i].channel = NULL;
+	    voice[i].channel = 0;
 	 }
       }
       CloseComponent(note_allocator);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/