Skip to content

Commit

Permalink
Normalize unsigned long to uint64_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
deadpixi committed Sep 27, 2016
1 parent a78f13d commit eab3ebc
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions include/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down
24 changes: 12 additions & 12 deletions include/libg.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct Mouse
{
int buttons; /* bit array: LMR=124 */
Point xy;
unsigned long msec;
uint64_t msec;
char *a;
};

Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);


Expand All @@ -191,25 +191,25 @@ 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*);
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 */
Expand Down
2 changes: 1 addition & 1 deletion libXg/Gwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions libXg/bitblt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions libXg/border.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions libXg/gcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions libXg/gwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions libXg/libgint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()
Expand Down
22 changes: 11 additions & 11 deletions libXg/xtbinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -475,7 +475,7 @@ scrollfwdbut(void)
}

void
einit(unsigned long keys)
einit(uint64_t keys)
{
/*
* Make sure Smouse = ilog2(Emouse) and Skeyboard == ilog2(Ekeyboard)
Expand All @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -609,7 +609,7 @@ pushkbd(int c)
}

int
ecanread(unsigned long keys)
ecanread(uint64_t keys)
{
int i;

Expand Down Expand Up @@ -794,7 +794,7 @@ raisewindow(void)
XFlush(_dpy);
}

unsigned long
uint64_t
getbg(void)
{
static int i = 0;
Expand Down
2 changes: 1 addition & 1 deletion libframe/frdelete.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libframe/frinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
4 changes: 2 additions & 2 deletions samterm/flayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions samterm/flayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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*);
Expand Down
2 changes: 1 addition & 1 deletion samterm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion samterm/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ char *genmenu3(int);
char *genmenu2(int);
char *genmenu2c(int);

extern unsigned long _bgpixel;
extern uint64_t _bgpixel;

enum Menu2
{
Expand Down

0 comments on commit eab3ebc

Please sign in to comment.