Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/arch/mac68k/mac68k



On Mon, Oct 27, 2003 at 11:11:23PM +0000, Frederick Bruckman wrote:
> Module Name:  src
> Committed By: fredb
> Date:         Mon Oct 27 23:11:23 UTC 2003
> 
> Modified Files:
>       src/sys/arch/mac68k/mac68k: macrom.c
> 
> Log Message:
> Fix a befuddling error from gcc.

@@ -178,7 +178,7 @@
        __asm __volatile ("movl %%a0,%0" : "=g" (ptr));

        (caddr_t *)prev = &mrg_DTList;
-       while (*prev != NULL)
+       while (*prev != 0)
                prev = *(caddr_t *)prev;
        *(caddr_t *)ptr = NULL;
        *(caddr_t *)prev = ptr;

It's not that befuddling :) NULL is now a pointer, but dereferencing a
caddr_t gives you a char. So gcc warns when you compare a char to a
void*. But to be consistent, shouldn't the line in question be this?

        while (*(caddr_t *)prev != NULL)
-- 
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: khym%azeotrope.org@localhost |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 27 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++



Home | Main Index | Thread Index | Old Index