summaryrefslogtreecommitdiff
path: root/apps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'apps/unix')
-rw-r--r--apps/unix/x11pdf.c11
-rw-r--r--apps/unix/ximage.c4
2 files changed, 6 insertions, 9 deletions
diff --git a/apps/unix/x11pdf.c b/apps/unix/x11pdf.c
index 5941d4d0..54aaae36 100644
--- a/apps/unix/x11pdf.c
+++ b/apps/unix/x11pdf.c
@@ -200,7 +200,7 @@ static void fillrect(int x, int y, int w, int h)
static void invertcopyrect()
{
- unsigned char *p;
+ unsigned t, *p;
int x, y;
int x0 = gapp.selr.x0 - gapp.panx;
@@ -215,14 +215,11 @@ static void invertcopyrect()
for (y = y0; y < y1; y++)
{
- p = gapp.image->samples + (y * gapp.image->w + x0) * 4;
+ p = (unsigned *)(gapp.image->samples + (y * gapp.image->w + x0) * 4);
for (x = x0; x < x1; x++)
{
- p[0] = 255 - p[0];
- p[1] = 255 - p[1];
- p[2] = 255 - p[2];
- p[3] = 255 - p[3];
- p += 4;
+ *p = ~0 - *p;
+ p ++;
}
}
diff --git a/apps/unix/ximage.c b/apps/unix/ximage.c
index 22e04a41..b37cf544 100644
--- a/apps/unix/ximage.c
+++ b/apps/unix/ximage.c
@@ -440,8 +440,8 @@ static void
ximage_convert_argb8888(PARAMS)
{
int x, y;
- unsigned *s = (unsigned *)src;
- unsigned *d = (unsigned *)dst;
+ unsigned * restrict s = (unsigned * restrict )src;
+ unsigned * restrict d = (unsigned * restrict )dst;
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
d[x] = s[x];