Normalize unsigned long to uint64_t. - sam - An updated version of the sam text editor.
 (HTM) git clone git://vernunftzentrum.de/sam.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit eab3ebc63fb97b2ee4f5dd3ccd908b03baaef1a5
 (DIR) parent a78f13d357f48ef669f210ef4f7dfba07b3f78d6
 (HTM) Author: Rob King <jking@deadpixi.com>
       Date:   Tue, 27 Sep 2016 10:35:37 -0500
       
       Normalize unsigned long to uint64_t.
       
       Diffstat:
         include/frame.h                     |       4 ++--
         include/libg.h                      |      24 ++++++++++++------------
         libXg/Gwin.h                        |       2 +-
         libXg/bitblt.c                      |       4 ++--
         libXg/border.c                      |       4 ++--
         libXg/gcs.c                         |      14 +++++++-------
         libXg/gwin.c                        |       4 ++--
         libXg/libgint.h                     |      12 ++++++------
         libXg/xtbinit.c                     |      22 +++++++++++-----------
         libframe/frdelete.c                 |       2 +-
         libframe/frinit.c                   |       2 +-
         samterm/flayer.c                    |       4 ++--
         samterm/flayer.h                    |       4 ++--
         samterm/main.c                      |       2 +-
         samterm/menu.c                      |       2 +-
       
       15 files changed, 53 insertions(+), 53 deletions(-)
       ---
 (DIR) diff --git a/include/frame.h b/include/frame.h
       @@ -21,7 +21,7 @@ struct Frbox
         */
        struct Frame
        {
       -    unsigned long bg;       /* background color */
       +    uint64_t bg;       /* background color */
            XftFont     *font;      /* of chars in the frame */
            Bitmap      *b;         /* on which frame appears */
            Rectangle   r;          /* in which text appears */
       @@ -46,7 +46,7 @@ void    frinsert(Frame*, Rune*, Rune*, ulong);
        void    frselect(Frame*, Mouse*);
        void    frselectp(Frame*, Fcode);
        void    frselectf(Frame*, Point, Point, Fcode);
       -void    frinit(Frame*, Rectangle, XftFont*, Bitmap*, unsigned long);
       +void    frinit(Frame*, Rectangle, XftFont*, Bitmap*, uint64_t);
        void    frsetrects(Frame*, Rectangle, Bitmap*);
        void    frclear(Frame*);
        void    frgetmouse(void);
 (DIR) diff --git a/include/libg.h b/include/libg.h
       @@ -62,7 +62,7 @@ struct  Mouse
        {
            int     buttons; /* bit array: LMR=124 */
            Point       xy;
       -    unsigned long   msec;
       +    uint64_t   msec;
            char *a;
        };
        
       @@ -92,9 +92,9 @@ struct  Event
        
        struct RGB
        {
       -    unsigned long   red;
       -    unsigned long   green;
       -    unsigned long   blue;
       +    uint64_t   red;
       +    uint64_t   green;
       +    uint64_t   blue;
        };
        
        enum{
       @@ -174,7 +174,7 @@ extern int   rectclip(Rectangle*, Rectangle);
        extern void  xtbinit(Errfunc, char*, int*, char**, char**);
        extern void  bclose(void);
        extern void  berror(char*);
       -extern void  bitblt2(Bitmap*, Point, Bitmap*, Rectangle, Fcode, unsigned long, unsigned long);
       +extern void  bitblt2(Bitmap*, Point, Bitmap*, Rectangle, Fcode, uint64_t, uint64_t);
        extern void  bitblt(Bitmap*, Point, Bitmap*, Rectangle, Fcode);
        
        
       @@ -191,7 +191,7 @@ extern int   ptinrect(Point, Rectangle);
        extern int   rectXrect(Rectangle, Rectangle);
        extern int   eqpt(Point, Point);
        extern int   eqrect(Rectangle, Rectangle);
       -extern void  border(Bitmap*, Rectangle, int, Fcode, unsigned long);
       +extern void  border(Bitmap*, Rectangle, int, Fcode, uint64_t);
        extern void  cursorswitch(unsigned int);
        extern void  cursorset(Point);
        extern Rectangle bscreenrect(Rectangle*);
       @@ -199,17 +199,17 @@ extern void  bflush(void);
        
        extern int   clipr(Bitmap*, Rectangle);
        extern int   scrpix(int*,int*);
       -extern unsigned long getbg(void);
       +extern uint64_t getbg(void);
        
       -extern void  einit(unsigned long);
       -extern unsigned long estart(unsigned long, int, int);
       +extern void  einit(uint64_t);
       +extern uint64_t estart(uint64_t, int, int);
        
       -extern unsigned long event(Event*);
       -extern unsigned long eread(unsigned long, Event*);
       +extern uint64_t event(Event*);
       +extern uint64_t eread(uint64_t, Event*);
        extern Mouse     emouse(void);
        extern Keystroke     ekbd(void);
        extern void  pushkbd(int c);
       -extern int   ecanread(unsigned long);
       +extern int   ecanread(uint64_t);
        extern int   ecanmouse(void);
        extern int   ecankbd(void);
        extern void  ereshaped(Rectangle);  /* supplied by user */
 (DIR) diff --git a/libXg/Gwin.h b/libXg/Gwin.h
       @@ -30,7 +30,7 @@ typedef struct {
                    int x;
                    int y;
                } xy;
       -        unsigned long msec;
       +        uint64_t msec;
            } Gwinmouse;
        
        typedef void (*Reshapefunc)(int, int, int, int);
 (DIR) diff --git a/libXg/bitblt.c b/libXg/bitblt.c
       @@ -11,11 +11,11 @@ bitblt(Bitmap *d, Point p, Bitmap *s, Rectangle r, Fcode f)
        }
        
        void
       -bitblt2(Bitmap *d, Point p, Bitmap *s, Rectangle r, Fcode f, unsigned long fg, unsigned long bg)
       +bitblt2(Bitmap *d, Point p, Bitmap *s, Rectangle r, Fcode f, uint64_t fg, uint64_t bg)
        {
            int sx, sy, dx, dy, bfunc;
            GC g;
       -    unsigned long plane;
       +    uint64_t plane;
            Bitmap *btmp;
        
            if (fg == 0)
 (DIR) diff --git a/libXg/border.c b/libXg/border.c
       @@ -3,10 +3,10 @@
        #include <libc.h>
        #include <libg.h>
        
       -extern unsigned long _borderpixel;
       +extern uint64_t _borderpixel;
        
        void
       -border(Bitmap *l, Rectangle r, int i, Fcode c, unsigned long bg)
       +border(Bitmap *l, Rectangle r, int i, Fcode c, uint64_t bg)
        {
            if(i > 0){
                bitblt2(l, r.min,
 (DIR) diff --git a/libXg/gcs.c b/libXg/gcs.c
       @@ -158,7 +158,7 @@ static int degengc[16] = {
         * (This implementation should be improved if setting a clip rectangle is not rare).
         */
        GC
       -_getgc(Bitmap *b, unsigned long gcvm, XGCValues *pgcv)
       +_getgc(Bitmap *b, uint64_t gcvm, XGCValues *pgcv)
        {
            static GC gc0, gcn;
            static int clipset = 0;
       @@ -199,16 +199,16 @@ _getgc(Bitmap *b, unsigned long gcvm, XGCValues *pgcv)
         * white (or background) and ~0 means black (or foreground).
         */
        GC
       -_getfillgc(Fcode f, Bitmap *b, unsigned long val)
       +_getfillgc(Fcode f, Bitmap *b, uint64_t val)
        {
            return _getfillgc2(f, b, val, _fgpixel, _bgpixel);
        }
        
        GC
       -_getfillgc2(Fcode f, Bitmap *b, unsigned long val, unsigned long fg, unsigned long bg)
       +_getfillgc2(Fcode f, Bitmap *b, uint64_t val, uint64_t fg, uint64_t bg)
        {
            int xf, m;
       -    unsigned long v, spix, vmax;
       +    uint64_t v, spix, vmax;
            XGCValues gcv;
        
            f &= F;
       @@ -305,12 +305,12 @@ _getcopygc(Fcode f, Bitmap *db, Bitmap *sb, int *bltfunc)
        }
        
        GC
       -_getcopygc2(Fcode f, Bitmap *db, Bitmap *sb, int *bltfunc, unsigned long fg, unsigned long bg)
       +_getcopygc2(Fcode f, Bitmap *db, Bitmap *sb, int *bltfunc, uint64_t fg, uint64_t bg)
        {
       -    unsigned long spix, df, sf;
       +    uint64_t spix, df, sf;
            int xf, c;
            XGCValues gcv;
       -    unsigned long gcvm;
       +    uint64_t gcvm;
        
            spix = xf = 0;
            f &= F;
 (DIR) diff --git a/libXg/gwin.c b/libXg/gwin.c
       @@ -527,7 +527,7 @@ Mouseaction(Widget w, XEvent *e, String *p, Cardinal *np)
        
        static void
        SelCallback(Widget w, XtPointer cldata, Atom *sel, Atom *seltype,
       -    XtPointer val, unsigned long *len, int *fmt)
       +    XtPointer val, uint64_t *len, int *fmt)
        {
            String s;
            int n;
       @@ -549,7 +549,7 @@ SelCallback(Widget w, XtPointer cldata, Atom *sel, Atom *seltype,
        
        static Boolean
        SendSel(Widget w, Atom *sel, Atom *target, Atom *rtype, XtPointer *ans,
       -        unsigned long *anslen, int *ansfmt)
       +        uint64_t *anslen, int *ansfmt)
        {
            GwinWidget gw = (GwinWidget)w;
            char *s;
 (DIR) diff --git a/libXg/libgint.h b/libXg/libgint.h
       @@ -41,11 +41,11 @@ void freebindings(void);
        void initcursors(void);
        
        /* Return a GCs for solid filling/strings/etc., segments/points, and tiling */
       -extern GC   _getfillgc(Fcode, Bitmap*, unsigned long);
       +extern GC   _getfillgc(Fcode, Bitmap*, uint64_t);
        extern GC   _getcopygc(Fcode, Bitmap*, Bitmap*, int*);
       -extern GC   _getfillgc2(Fcode, Bitmap*, unsigned long, unsigned long, unsigned long);
       -extern GC   _getcopygc2(Fcode, Bitmap*, Bitmap*, int*, unsigned long, unsigned long);
       -extern GC   _getgc(Bitmap*, unsigned long, XGCValues *);
       +extern GC   _getfillgc2(Fcode, Bitmap*, uint64_t, uint64_t, uint64_t);
       +extern GC   _getcopygc2(Fcode, Bitmap*, Bitmap*, int*, uint64_t, uint64_t);
       +extern GC   _getgc(Bitmap*, uint64_t, XGCValues *);
        
        /* convert between different bitmap depths */
        extern void _ldconvert(char *, int, char *, int, int, int);
       @@ -57,12 +57,12 @@ extern Bitmap   *_balloc(Rectangle, int);
        extern Display  *_dpy;
        
        /* screen depth foreground and background for this application */
       -extern unsigned long    _fgpixel, _bgpixel;
       +extern uint64_t    _fgpixel, _bgpixel;
        extern XColor       _fgcolor, _bgcolor;
        
        /* indexed by log depth (0 <= ld <= 5), to give depth and planemask */
        extern int      _ld2d[];
       -extern unsigned long    _ld2dmask[];
       +extern uint64_t    _ld2dmask[];
        
        /* libg.h defines:
         *   extern Bitmap screen;   -- Bitmap for application Window after xbinit()
 (DIR) diff --git a/libXg/xtbinit.c b/libXg/xtbinit.c
       @@ -63,12 +63,12 @@ extern char *machine;
        Display     *_dpy;
        Widget      _toplevel;
        Window _topwindow;
       -unsigned long _bgpixels[MAX_BACKGROUNDS];
       +uint64_t _bgpixels[MAX_BACKGROUNDS];
        int _nbgs;
       -unsigned long   _fgpixel, _bgpixel, _borderpixel;
       +uint64_t   _fgpixel, _bgpixel, _borderpixel;
        XColor      _fgcolor, _bgcolor, _bordercolor;
        int     _ld2d[6] = { 1, 2, 4, 8, 16, 24 };
       -unsigned long   _ld2dmask[6] = { 0x1, 0x3, 0xF, 0xFF, 0xFFFF, 0x00FFFFFF };
       +uint64_t   _ld2dmask[6] = { 0x1, 0x3, 0xF, 0xFF, 0xFFFF, 0x00FFFFFF };
        Colormap    _libg_cmap;
        int     _cmap_installed;
        
       @@ -475,7 +475,7 @@ scrollfwdbut(void)
        }
        
        void
       -einit(unsigned long keys)
       +einit(uint64_t keys)
        {
            /*
             * Make sure Smouse = ilog2(Emouse) and Skeyboard == ilog2(Ekeyboard)
       @@ -499,8 +499,8 @@ einit(unsigned long keys)
            einitcalled = 1;
        }
        
       -unsigned long
       -estart(unsigned long key, int fd, int n)
       +uint64_t
       +estart(uint64_t key, int fd, int n)
        {
            int i;
        
       @@ -522,14 +522,14 @@ estart(unsigned long key, int fd, int n)
            return 0;
        }
        
       -unsigned long
       +uint64_t
        event(Event *e)
        {
            return eread(~0L, e);
        }
        
       -unsigned long
       -eread(unsigned long keys, Event *e)
       +uint64_t
       +eread(uint64_t keys, Event *e)
        {
            Ebuf *eb;
            int i;
       @@ -609,7 +609,7 @@ pushkbd(int c)
        }
        
        int
       -ecanread(unsigned long keys)
       +ecanread(uint64_t keys)
        {
            int i;
        
       @@ -794,7 +794,7 @@ raisewindow(void)
            XFlush(_dpy);
        }
        
       -unsigned long
       +uint64_t
        getbg(void)
        {
            static int i = 0;
 (DIR) diff --git a/libframe/frdelete.c b/libframe/frdelete.c
       @@ -16,7 +16,7 @@ frdelete(Frame *f, ulong p0, ulong p1)
                return 0;
            if(p1 > f->nchars)
                p1 = f->nchars;
       -    n0 = _frfindbox(f, 0, (unsigned long)0, p0);
       +    n0 = _frfindbox(f, 0, (uint64_t)0, p0);
            n1 = _frfindbox(f, n0, p0, p1);
            pt0 = _frptofcharnb(f, p0, n0);
            pt1 = frptofchar(f, p1);
 (DIR) diff --git a/libframe/frinit.c b/libframe/frinit.c
       @@ -8,7 +8,7 @@ int tabwidth = 8;
        extern int expandtabs;
        
        void
       -frinit(Frame *f, Rectangle r, XftFont *ft, Bitmap *b, unsigned long bg)
       +frinit(Frame *f, Rectangle r, XftFont *ft, Bitmap *b, uint64_t bg)
        {
            int tabs = atoi(getenv("TABS") ? getenv("TABS") : "");
            if (tabs < 0){
 (DIR) diff --git a/samterm/flayer.c b/samterm/flayer.c
       @@ -16,7 +16,7 @@ static Rectangle lDrect;
        extern Bitmap   screen;
        extern Mouse    mouse;
        
       -extern unsigned long _bgpixel;
       +extern uint64_t _bgpixel;
        
        Vis     visibility(Flayer *);
        void        newvisibilities(int);
       @@ -57,7 +57,7 @@ flrect(Flayer *l, Rectangle r)
        }
        
        void
       -flinit(Flayer *l, Rectangle r, XftFont *ft, unsigned long bg)
       +flinit(Flayer *l, Rectangle r, XftFont *ft, uint64_t bg)
        {
            lldelete(l);
            llinsert(l);
 (DIR) diff --git a/samterm/flayer.h b/samterm/flayer.h
       @@ -17,7 +17,7 @@ typedef struct Flayer Flayer;
         */
        struct Flayer
        {
       -    unsigned long bg;
       +    uint64_t bg;
            Frame       f;
            long        origin; /* offset of first char in flayer */
            long        p0, p1;
       @@ -34,7 +34,7 @@ void    flborder(Flayer*, int);
        void    flclose(Flayer*);
        void    fldelete(Flayer*, long, long);
        void    flfp0p1(Flayer*, ulong*, ulong*);
       -void    flinit(Flayer*, Rectangle, XftFont*, unsigned long bg);
       +void    flinit(Flayer*, Rectangle, XftFont*, uint64_t bg);
        void    flinsert(Flayer*, Rune*, Rune*, long);
        void    flnew(Flayer*, Rune *(*fn)(Flayer*, long, ulong*), int, void*);
        int flprepare(Flayer*);
 (DIR) diff --git a/samterm/main.c b/samterm/main.c
       @@ -8,7 +8,7 @@
        #include "flayer.h"
        #include "samterm.h"
        
       -extern unsigned long _bgpixel;
       +extern uint64_t _bgpixel;
        extern void hmoveto(int, long, Flayer *);
        
        Text    cmd;
 (DIR) diff --git a/samterm/menu.c b/samterm/menu.c
       @@ -16,7 +16,7 @@ char    *genmenu3(int);
        char    *genmenu2(int);
        char    *genmenu2c(int);
        
       -extern unsigned long _bgpixel;
       +extern uint64_t _bgpixel;
        
        enum Menu2
        {