URI: 
       tchanges from plan 9 - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 3bff492520ffc551fe1951ea6f0d806f837f05d5
   DIR parent 3167fce5ce254c0cd71891b929c324ced2fd5325
  HTML Author: rsc <devnull@localhost>
       Date:   Sun, 21 May 2006 16:20:29 +0000
       
       changes from plan 9
       
       Diffstat:
         M src/libdraw/md-alloc.c              |      24 ++++++++++--------------
         M src/libdraw/md-defont.c             |       2 +-
       
       2 files changed, 11 insertions(+), 15 deletions(-)
       ---
   DIR diff --git a/src/libdraw/md-alloc.c b/src/libdraw/md-alloc.c
       t@@ -19,7 +19,7 @@ memimagemove(void *from, void *to)
                md->base = to;
        
                /* if allocmemimage changes this must change too */
       -        md->bdata = (uchar*)((ulong*)md->base+2);
       +        md->bdata = (uchar*)md->base+sizeof(Memdata*)+sizeof(ulong);
        }
        
        Memimage*
       t@@ -71,7 +71,7 @@ _allocmemimage(Rectangle r, u32int chan)
        {
                int d;
                u32int l, nw;
       -        ulong *ul;
       +        uchar *p;
                Memdata *md;
                Memimage *i;
        
       t@@ -87,25 +87,21 @@ _allocmemimage(Rectangle r, u32int chan)
                        return nil;
        
                md->ref = 1;
       -        /*
       -         * The first two ulongs are the md and the callerpc.
       -         * Then nw words of data.
       -         * The final word lets the drawing routines be a little
       -         * sloppy about reading past the end of the block.
       -         */
       -        md->base = poolalloc(imagmem, 2*sizeof(ulong)+(nw+1)*sizeof(u32int));
       +        md->base = poolalloc(imagmem, sizeof(Memdata*)+(1+nw)*sizeof(ulong));
                if(md->base == nil){
                        free(md);
                        return nil;
                }
        
       -        ul = (ulong*)md->base;
       -        ul[0] = (ulong)md;
       -        ul[1] = getcallerpc(&r);
       +        p = (uchar*)md->base;
       +        *(Memdata**)p = md;
       +        p += sizeof(Memdata*);
        
       -        /* if this changes, memimagemove must change too */
       -        md->bdata = (uchar*)(ul+2);
       +        *(ulong*)p = getcallerpc(&r);
       +        p += sizeof(ulong);
        
       +        /* if this changes, memimagemove must change too */
       +        md->bdata = p;
                md->allocd = 1;
        
                i = allocmemimaged(r, chan, md, nil);
   DIR diff --git a/src/libdraw/md-defont.c b/src/libdraw/md-defont.c
       t@@ -21,7 +21,7 @@ getmemdefont(void)
                 * declared as char*, not u32int*.
                 */
                p = (char*)defontdata;
       -        n = (ulong)p & 3;
       +        n = (uintptr)p & 3;
                if(n != 0){
                        memmove(p+(4-n), p, sizeofdefont-n);
                        p += 4-n;