From 634daac467e4c7dd0844c89e7a8317d44e566a16 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 9 Jul 2010 03:08:52 +0200 Subject: Fix up restrict keyword in prototypes to remove warnings on MSVC. --- draw/archport.c | 7 +++---- draw/imagedraw.c | 10 +++++----- draw/imagescale.c | 40 ++++++++++++++++++++-------------------- draw/imageunpack.c | 10 +++++----- draw/porterduff.c | 28 ++++++++++++++-------------- 5 files changed, 47 insertions(+), 48 deletions(-) (limited to 'draw') diff --git a/draw/archport.c b/draw/archport.c index 2fb491d7..3ed56973 100644 --- a/draw/archport.c +++ b/draw/archport.c @@ -7,9 +7,8 @@ typedef unsigned char byte; #define MASK 0xFF00FF00; static void -path_w4i1o4_32bit(byte * restrict rgba, - byte * restrict src, byte cov, int len, - byte * restrict dst) +path_w4i1o4_32bit(byte *rgba, + byte * restrict src, byte cov, int len, byte * restrict dst) { /* COLOR * coverage + DST * (256-coverage) = (COLOR - DST)*coverage + DST*256 */ unsigned int *dst32 = (unsigned int *)(void *)dst; @@ -77,7 +76,7 @@ path_w4i1o4_32bit(byte * restrict rgba, } static void -text_w4i1o4_32bit(byte * restrict rgba, +text_w4i1o4_32bit(byte *rgba, byte * restrict src, int srcw, byte * restrict dst, int dstw, int w0, int h) { diff --git a/draw/imagedraw.c b/draw/imagedraw.c index 71bd4360..c43f9f24 100644 --- a/draw/imagedraw.c +++ b/draw/imagedraw.c @@ -343,8 +343,8 @@ img_w4i1o4(byte *rgba, byte * restrict src, byte cov, int len, byte * restrict d } } -void (*fz_img_1o1)(byte*, byte, int, byte*, fz_pixmap *image, int u, int v, int fa, int fb) = img_1o1; -void (*fz_img_2o2)(byte*, byte, int, byte*, fz_pixmap *image, int u, int v, int fa, int fb) = img_2o2; -void (*fz_img_4o4)(byte*, byte, int, byte*, fz_pixmap *image, int u, int v, int fa, int fb) = img_4o4; -void (*fz_img_w2i1o2)(byte*, byte*, byte, int, byte*, fz_pixmap *image, int u, int v, int fa, int fb) = img_w2i1o2; -void (*fz_img_w4i1o4)(byte*, byte*, byte, int, byte*, fz_pixmap *image, int u, int v, int fa, int fb) = img_w4i1o4; +void (*fz_img_1o1)(byte*restrict, byte, int, byte*restrict, fz_pixmap *image, int u, int v, int fa, int fb) = img_1o1; +void (*fz_img_2o2)(byte*restrict, byte, int, byte*restrict, fz_pixmap *image, int u, int v, int fa, int fb) = img_2o2; +void (*fz_img_4o4)(byte*restrict, byte, int, byte*restrict, fz_pixmap *image, int u, int v, int fa, int fb) = img_4o4; +void (*fz_img_w2i1o2)(byte*, byte*restrict, byte, int, byte*restrict, fz_pixmap *image, int u, int v, int fa, int fb) = img_w2i1o2; +void (*fz_img_w4i1o4)(byte*, byte*restrict, byte, int, byte*restrict, fz_pixmap *image, int u, int v, int fa, int fb) = img_w4i1o4; diff --git a/draw/imagescale.c b/draw/imagescale.c index 687b53b5..60edadb5 100644 --- a/draw/imagescale.c +++ b/draw/imagescale.c @@ -102,22 +102,22 @@ static inline void srowc(byte * restrict src, byte * restrict dst, int w, int de } } -static void srow1(byte *src, byte *dst, int w, int denom) +static void srow1(byte * restrict src, byte * restrict dst, int w, int denom) { srowc(src, dst, w, denom, 1); } -static void srow2(byte *src, byte *dst, int w, int denom) +static void srow2(byte * restrict src, byte * restrict dst, int w, int denom) { srowc(src, dst, w, denom, 2); } -static void srow4(byte *src, byte *dst, int w, int denom) +static void srow4(byte * restrict src, byte * restrict dst, int w, int denom) { srowc(src, dst, w, denom, 4); } -static void srow5(byte *src, byte *dst, int w, int denom) +static void srow5(byte * restrict src, byte * restrict dst, int w, int denom) { srowc(src, dst, w, denom, 5); } @@ -190,37 +190,37 @@ static inline void scolc(byte * restrict src, byte * restrict dst, int w, int de } } -static void scol1(byte *src, byte *dst, int w, int denom) +static void scol1(byte * restrict src, byte * restrict dst, int w, int denom) { scolc(src, dst, w, denom, 1); } -static void scol2(byte *src, byte *dst, int w, int denom) +static void scol2(byte * restrict src, byte * restrict dst, int w, int denom) { scolc(src, dst, w, denom, 2); } -static void scol4(byte *src, byte *dst, int w, int denom) +static void scol4(byte * restrict src, byte * restrict dst, int w, int denom) { scolc(src, dst, w, denom, 4); } -static void scol5(byte *src, byte *dst, int w, int denom) +static void scol5(byte * restrict src, byte * restrict dst, int w, int denom) { scolc(src, dst, w, denom, 5); } -void (*fz_srown)(byte *src, byte *dst, int w, int denom, int n) = srown; -void (*fz_srow1)(byte *src, byte *dst, int w, int denom) = srow1; -void (*fz_srow2)(byte *src, byte *dst, int w, int denom) = srow2; -void (*fz_srow4)(byte *src, byte *dst, int w, int denom) = srow4; -void (*fz_srow5)(byte *src, byte *dst, int w, int denom) = srow5; +void (*fz_srown)(byte *restrict, byte *restrict, int w, int denom, int n) = srown; +void (*fz_srow1)(byte *restrict, byte *restrict, int w, int denom) = srow1; +void (*fz_srow2)(byte *restrict, byte *restrict, int w, int denom) = srow2; +void (*fz_srow4)(byte *restrict, byte *restrict, int w, int denom) = srow4; +void (*fz_srow5)(byte *restrict, byte *restrict, int w, int denom) = srow5; -void (*fz_scoln)(byte *src, byte *dst, int w, int denom, int n) = scoln; -void (*fz_scol1)(byte *src, byte *dst, int w, int denom) = scol1; -void (*fz_scol2)(byte *src, byte *dst, int w, int denom) = scol2; -void (*fz_scol4)(byte *src, byte *dst, int w, int denom) = scol4; -void (*fz_scol5)(byte *src, byte *dst, int w, int denom) = scol5; +void (*fz_scoln)(byte *restrict, byte *restrict, int w, int denom, int n) = scoln; +void (*fz_scol1)(byte *restrict, byte *restrict, int w, int denom) = scol1; +void (*fz_scol2)(byte *restrict, byte *restrict, int w, int denom) = scol2; +void (*fz_scol4)(byte *restrict, byte *restrict, int w, int denom) = scol4; +void (*fz_scol5)(byte *restrict, byte *restrict, int w, int denom) = scol5; fz_pixmap * fz_scalepixmap(fz_pixmap *src, int xdenom, int ydenom) @@ -231,8 +231,8 @@ fz_scalepixmap(fz_pixmap *src, int xdenom, int ydenom) int ow, oh, n; int remaining; - void (*srowx)(byte *src, byte *dst, int w, int denom) = nil; - void (*scolx)(byte *src, byte *dst, int w, int denom) = nil; + void (*srowx)(byte * restrict src, byte * restrict dst, int w, int denom) = nil; + void (*scolx)(byte * restrict src, byte * restrict dst, int w, int denom) = nil; ow = (src->w + xdenom - 1) / xdenom; oh = (src->h + ydenom - 1) / ydenom; diff --git a/draw/imageunpack.c b/draw/imageunpack.c index 48c420bf..25a21770 100644 --- a/draw/imageunpack.c +++ b/draw/imageunpack.c @@ -303,9 +303,9 @@ static void loadtile16(byte * restrict src, int sw, byte * restrict dst, int dw, TILE(thex) void (*fz_decodetile)(fz_pixmap *pix, int skip, float *decode) = decodetile; -void (*fz_loadtile1)(byte*, int sw, byte*, int dw, int w, int h, int pad) = loadtile1; -void (*fz_loadtile2)(byte*, int sw, byte*, int dw, int w, int h, int pad) = loadtile2; -void (*fz_loadtile4)(byte*, int sw, byte*, int dw, int w, int h, int pad) = loadtile4; -void (*fz_loadtile8)(byte*, int sw, byte*, int dw, int w, int h, int pad) = loadtile8; -void (*fz_loadtile16)(byte*, int sw, byte*, int dw, int w, int h, int pad) = loadtile16; +void (*fz_loadtile1)(byte*restrict, int sw, byte*restrict, int dw, int w, int h, int pad) = loadtile1; +void (*fz_loadtile2)(byte*restrict, int sw, byte*restrict, int dw, int w, int h, int pad) = loadtile2; +void (*fz_loadtile4)(byte*restrict, int sw, byte*restrict, int dw, int w, int h, int pad) = loadtile4; +void (*fz_loadtile8)(byte*restrict, int sw, byte*restrict, int dw, int w, int h, int pad) = loadtile8; +void (*fz_loadtile16)(byte*restrict, int sw, byte*restrict, int dw, int w, int h, int pad) = loadtile16; diff --git a/draw/porterduff.c b/draw/porterduff.c index 9af8b55c..40f900e0 100644 --- a/draw/porterduff.c +++ b/draw/porterduff.c @@ -207,7 +207,7 @@ path_1o1(byte * restrict src, byte cov, int len, byte * restrict dst) } static void -path_w2i1o2(byte * restrict ga, byte * restrict src, byte cov, int len, byte * restrict dst) +path_w2i1o2(byte *ga, byte * restrict src, byte cov, int len, byte * restrict dst) { byte g = ga[0]; int a = FZ_EXPAND(ga[1]); @@ -224,7 +224,7 @@ path_w2i1o2(byte * restrict ga, byte * restrict src, byte cov, int len, byte * r } static void -path_w4i1o4(byte * restrict rgba, byte * restrict src, byte cov, int len, byte * restrict dst) +path_w4i1o4(byte *rgba, byte * restrict src, byte cov, int len, byte * restrict dst) { byte r = rgba[0]; byte g = rgba[1]; @@ -268,7 +268,7 @@ text_1o1(byte * restrict src, int srcw, byte * restrict dst, int dstw, int w0, i } static void -text_w2i1o2(byte * restrict ga, byte * restrict src, int srcw, byte * restrict dst, int dstw, int w0, int h) +text_w2i1o2(byte *ga, byte * restrict src, int srcw, byte * restrict dst, int dstw, int w0, int h) { byte g = ga[0]; int a = FZ_EXPAND(ga[1]); @@ -292,7 +292,7 @@ text_w2i1o2(byte * restrict ga, byte * restrict src, int srcw, byte * restrict d } static void -text_w4i1o4(byte * restrict rgba, byte * restrict src, int srcw, byte * restrict dst, int dstw, int w0, int h) +text_w4i1o4(byte *rgba, byte * restrict src, int srcw, byte * restrict dst, int dstw, int w0, int h) { byte r = rgba[0]; byte g = rgba[1]; @@ -323,15 +323,15 @@ text_w4i1o4(byte * restrict rgba, byte * restrict src, int srcw, byte * restrict * ... and the function pointers */ -void (*fz_duff_ni1on)(byte*,int,int,byte*,int,byte*,int,int,int) = duff_ni1on; -void (*fz_duff_1i1o1)(byte*,int,byte*,int,byte*,int,int,int) = duff_1i1o1; -void (*fz_duff_2i1o2)(byte*,int,byte*,int,byte*,int,int,int) = duff_2i1o2; -void (*fz_duff_4i1o4)(byte*,int,byte*,int,byte*,int,int,int) = duff_4i1o4; +void (*fz_duff_ni1on)(byte*restrict,int,int,byte*restrict,int,byte*restrict,int,int,int) = duff_ni1on; +void (*fz_duff_1i1o1)(byte*restrict,int,byte*restrict,int,byte*restrict,int,int,int) = duff_1i1o1; +void (*fz_duff_2i1o2)(byte*restrict,int,byte*restrict,int,byte*restrict,int,int,int) = duff_2i1o2; +void (*fz_duff_4i1o4)(byte*restrict,int,byte*restrict,int,byte*restrict,int,int,int) = duff_4i1o4; -void (*fz_path_1o1)(byte*,byte,int,byte*) = path_1o1; -void (*fz_path_w2i1o2)(byte*,byte*,byte,int,byte*) = path_w2i1o2; -void (*fz_path_w4i1o4)(byte*,byte*,byte,int,byte*) = path_w4i1o4; +void (*fz_path_1o1)(byte*restrict,byte,int,byte*restrict) = path_1o1; +void (*fz_path_w2i1o2)(byte*,byte*restrict,byte,int,byte*restrict) = path_w2i1o2; +void (*fz_path_w4i1o4)(byte*,byte*restrict,byte,int,byte*restrict) = path_w4i1o4; -void (*fz_text_1o1)(byte*,int,byte*,int,int,int) = text_1o1; -void (*fz_text_w2i1o2)(byte*,byte*,int,byte*,int,int,int) = text_w2i1o2; -void (*fz_text_w4i1o4)(byte*,byte*,int,byte*,int,int,int) = text_w4i1o4; +void (*fz_text_1o1)(byte*restrict,int,byte*restrict,int,int,int) = text_1o1; +void (*fz_text_w2i1o2)(byte*,byte*restrict,int,byte*restrict,int,int,int) = text_w2i1o2; +void (*fz_text_w4i1o4)(byte*,byte*restrict,int,byte*restrict,int,int,int) = text_w4i1o4; -- cgit v1.2.3