From: Matthew Mondor Date: Sun, 10 Apr 2022 00:46:28 +0000 (+0000) Subject: - Use uint8_t for font bit storage and manipulation instead of X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=07b058366fee80a9c4271d33263ccc624457211c;p=xscreensaver-5.35.git - Use uint8_t for font bit storage and manipulation instead of unsigned long, since no significant performance improvement. --- diff --git a/hacks/analogterm.c b/hacks/analogterm.c index 47f6550..de14d2d 100644 --- a/hacks/analogterm.c +++ b/hacks/analogterm.c @@ -343,7 +343,7 @@ at_make_font(analogterm_sim_t *sim, int fi, char *bits, unsigned int width, { Pixmap pm; XImage *xi; - unsigned long (*f)[8][7]; + uint8_t (*f)[8][7]; int c, r, b; assert(width == 96 * 7 && height == 8); @@ -358,7 +358,8 @@ at_make_font(analogterm_sim_t *sim, int fi, char *bits, unsigned int width, for (c = 0; c < 96; c++) { for (r = 0; r < 8; r++) { for (b = 0; b < 7; b++) - f[c][r][b] = XGetPixel(xi, (c * 7) + b, r % 8); + f[c][r][b] = (uint8_t)XGetPixel(xi, + (c * 7) + b, r % 8); } } @@ -592,9 +593,8 @@ analogterm_one_frame (analogterm_sim_t *sim) int rev, level, olevel, iblink; int c = st->textlines_char[textrow][col]; uint16_t m = st->textlines_mode[textrow][col]; - unsigned long (*f)[8][7] = - sim->text_font[(m & TMODE_GFX) != 0 ? 1 : 0]; - unsigned long (*cf)[7]; + uint8_t (*f)[8][7] = sim->text_font[(m & TMODE_GFX) != 0 ? 1 : 0]; + uint8_t (*cf)[7]; rev = ((m & (TMODE_INVERSE | TMODE_BGCOLOR)) != 0); @@ -629,7 +629,7 @@ analogterm_one_frame (analogterm_sim_t *sim) * resolution. */ for (i = 0; i < 7; i++) { - unsigned long *cb = cf[rowm], pix; + uint8_t *cb = cf[rowm], pix; if ((m & TMODE_INVISIBLE) != 0) pix = 0; diff --git a/hacks/analogterm.h b/hacks/analogterm.h index e263f78..db4d530 100644 --- a/hacks/analogterm.h +++ b/hacks/analogterm.h @@ -83,7 +83,7 @@ struct analogterm_sim_s { Display *dpy; Window window; XWindowAttributes xgwa; - unsigned long text_font[CHARSETS][96][8][7]; + uint8_t text_font[CHARSETS][96][8][7]; struct timeval basetime_tv; double curtime;