diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2023-01-04 11:19:52 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2023-01-04 15:09:44 +0000 |
commit | 4662fae9bec61c34b47310b6600f3efe035f5e4b (patch) | |
tree | 27de70e6470dc2d01e2e8f302cf12ab438ae57b3 | |
parent | 2414331e669dde44c69d2a82c00a4f58cb148aa0 (diff) | |
download | ghostpdl-4662fae9bec61c34b47310b6600f3efe035f5e4b.tar.gz |
Fix compiler warnings in devices/
Mismatched function prototype warnings, and one uninitialised variable.
-rw-r--r-- | devices/gdevbit.c | 6 | ||||
-rw-r--r-- | devices/gdevdsp.c | 4 | ||||
-rw-r--r-- | devices/gdevjpeg.c | 4 | ||||
-rw-r--r-- | devices/gdevpbm.c | 4 | ||||
-rw-r--r-- | devices/gdevplan.c | 8 | ||||
-rw-r--r-- | devices/gdevplib.c | 8 | ||||
-rw-r--r-- | devices/gdevpng.c | 4 | ||||
-rw-r--r-- | devices/gdevstc.c | 8 | ||||
-rw-r--r-- | devices/gdevupd.c | 14 | ||||
-rw-r--r-- | devices/vector/gdevpsf2.c | 4 |
10 files changed, 32 insertions, 32 deletions
diff --git a/devices/gdevbit.c b/devices/gdevbit.c index 952af9e95..a61e9aaa1 100644 --- a/devices/gdevbit.c +++ b/devices/gdevbit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -336,7 +336,7 @@ bittag_rgb_map_rgb_color(gx_device * dev, const gx_color_value cv[]) } static int -bittag_map_color_rgb(gx_device * dev, gx_color_index color, gx_color_value cv[4]) +bittag_map_color_rgb(gx_device * dev, gx_color_index color, gx_color_value cv[3]) { int depth = 24; int ncomp = 3; @@ -426,7 +426,7 @@ bitrgb_rgb_map_rgb_color(gx_device * dev, const gx_color_value cv[]) /* Map color to RGB. This has 3 separate cases, but since it is rarely */ /* used, we do a case test rather than providing 3 separate routines. */ static int -bit_map_color_rgb(gx_device * dev, gx_color_index color, gx_color_value cv[4]) +bit_map_color_rgb(gx_device * dev, gx_color_index color, gx_color_value cv[3]) { int depth = dev->color_info.depth; int ncomp = REAL_NUM_COMPONENTS(dev); diff --git a/devices/gdevdsp.c b/devices/gdevdsp.c index f757666aa..fc41cdec8 100644 --- a/devices/gdevdsp.c +++ b/devices/gdevdsp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -472,7 +472,7 @@ display_encode_color_device8(gx_device * dev, const gx_color_value cv[]) /* Map a color code to r-g-b-k. */ static int display_decode_color_device8(gx_device * dev, gx_color_index color, - gx_color_value prgb[4]) + gx_color_value prgb[]) { gx_color_value one; /* palette of 96 colors */ diff --git a/devices/gdevjpeg.c b/devices/gdevjpeg.c index 87ba3c4c9..4674f18b6 100644 --- a/devices/gdevjpeg.c +++ b/devices/gdevjpeg.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -172,7 +172,7 @@ jpegcmyk_map_cmyk_color(gx_device * dev, const gx_color_value cv[]) static int jpegcmyk_decode_color(gx_device * dev, gx_color_index color, - gx_color_value cv[4]) + gx_color_value cv[]) { color = ~color; cv[0] = gx_color_value_from_byte(0xff & (color>>24)); diff --git a/devices/gdevpbm.c b/devices/gdevpbm.c index 19e5ade0f..4845cd221 100644 --- a/devices/gdevpbm.c +++ b/devices/gdevpbm.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -456,7 +456,7 @@ pnm_encode_color(gx_device * pdev, const gx_color_value cv[]) /* Map a PPM color tuple back to an RGB color. */ static int ppm_decode_color(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) + gx_color_value prgb[]) { uint bitspercolor = dev->color_info.depth / 3; uint colormask = (1 << bitspercolor) - 1; diff --git a/devices/gdevplan.c b/devices/gdevplan.c index abef82957..a8b06ee01 100644 --- a/devices/gdevplan.c +++ b/devices/gdevplan.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -438,7 +438,7 @@ plang_encode_color(gx_device * pdev, const gx_color_value cv[]) /* Map a gray value back to an RGB color. */ static int plang_decode_color(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) + gx_color_value prgb[]) { gx_color_value gray = color * gx_max_color_value / dev->color_info.max_gray; @@ -452,7 +452,7 @@ plang_decode_color(gx_device * dev, gx_color_index color, /* Map an rgb color tuple back to an RGB color. */ static int plan_decode_color(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) + gx_color_value prgb[]) { uint bitspercolor = dev->color_info.depth / 3; uint colormask = (1 << bitspercolor) - 1; @@ -470,7 +470,7 @@ plan_decode_color(gx_device * dev, gx_color_index color, /* Map a cmyk color tuple back to an gs color. */ static int planc_decode_color(gx_device * dev, gx_color_index color, - gx_color_value prgb[4]) + gx_color_value prgb[]) { uint bitspercolor = dev->color_info.depth / 4; uint colormask = (1 << bitspercolor) - 1; diff --git a/devices/gdevplib.c b/devices/gdevplib.c index e4288717e..1e6ba3302 100644 --- a/devices/gdevplib.c +++ b/devices/gdevplib.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -734,7 +734,7 @@ plibg_encode_color(gx_device * pdev, const gx_color_value cv[]) /* Map a gray value back to an RGB color. */ static int plibg_decode_color(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) + gx_color_value prgb[]) { gx_color_value gray = color * gx_max_color_value / dev->color_info.max_gray; @@ -748,7 +748,7 @@ plibg_decode_color(gx_device * dev, gx_color_index color, /* Map an rgb color tuple back to an RGB color. */ static int plib_decode_color(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) + gx_color_value prgb[]) { uint bitspercolor = dev->color_info.depth / 3; uint colormask = (1 << bitspercolor) - 1; @@ -766,7 +766,7 @@ plib_decode_color(gx_device * dev, gx_color_index color, /* Map a cmyk color tuple back to CMYK colorants. */ static int plibc_decode_color(gx_device * dev, gx_color_index color, - gx_color_value prgb[4]) + gx_color_value prgb[]) { uint bitspercolor = dev->color_info.depth / 4; uint colormask = (1 << bitspercolor) - 1; diff --git a/devices/gdevpng.c b/devices/gdevpng.c index 4d102d13b..b2e0c3ac8 100644 --- a/devices/gdevpng.c +++ b/devices/gdevpng.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -944,7 +944,7 @@ pngalpha_encode_color(gx_device * dev, const gx_color_value cv[]) /* Map a color index to a r-g-b color. */ static int pngalpha_decode_color(gx_device * dev, gx_color_index color, - gx_color_value prgb[3]) + gx_color_value prgb[]) { prgb[0] = gx_color_value_from_byte((color >> 24) & 0xff); prgb[1] = gx_color_value_from_byte((color >> 16) & 0xff); diff --git a/devices/gdevstc.c b/devices/gdevstc.c index b4e8c9f4b..9a206f6eb 100644 --- a/devices/gdevstc.c +++ b/devices/gdevstc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2021 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -2096,7 +2096,7 @@ stc_gray_map_color_rgb(gx_device *pdev, gx_color_index color,gx_color_value prgb } static int -stc_gray_decode_color(gx_device *pdev, gx_color_index color,gx_color_value prgb[1]) +stc_gray_decode_color(gx_device *pdev, gx_color_index color,gx_color_value prgb[]) { stcolor_device *sd = (stcolor_device *) pdev; gx_color_index l = ((gx_color_index)1<<sd->stc.bits)-1; @@ -2271,7 +2271,7 @@ stc_cmyk_map_cmyk_color(gx_device *pdev, const gx_color_value cv[]) /* Modified to be a "decode_color" routine */ static int -stc_cmyk_decode_color(gx_device *pdev, gx_color_index color, gx_color_value cv[4]) +stc_cmyk_decode_color(gx_device *pdev, gx_color_index color, gx_color_value cv[]) { stcolor_device *sd = (stcolor_device *) pdev; @@ -2456,7 +2456,7 @@ stc_cmyk10_map_cmyk_color(gx_device *pdev, const gx_color_value cv[]) static int stc_cmyk10_decode_color(gx_device *pdev, gx_color_index color, - gx_color_value cv[4]) + gx_color_value cv[]) { stcolor_device *sd = (stcolor_device *) pdev; diff --git a/devices/gdevupd.c b/devices/gdevupd.c index 179c400d6..3118e3d78 100644 --- a/devices/gdevupd.c +++ b/devices/gdevupd.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -2220,7 +2220,7 @@ in the W- or K-Component. /* ------------------------------------------------------------------- */ static int -upd_icolor_rgb(gx_device *pdev, gx_color_index color, gx_color_value prgb[3]) +upd_icolor_rgb(gx_device *pdev, gx_color_index color, gx_color_value prgb[]) { const upd_p upd = ((upd_device *)pdev)->upd; gx_color_value c,m,y,k; @@ -2303,7 +2303,7 @@ upd_rgb_1color(gx_device *pdev, const gx_color_value cv[]) /* ------------------------------------------------------------------- */ static int -upd_1color_rgb(gx_device *pdev, gx_color_index color, gx_color_value cv[1]) +upd_1color_rgb(gx_device *pdev, gx_color_index color, gx_color_value cv[]) { const upd_p upd = ((upd_device *)pdev)->upd; /* @@ -2362,7 +2362,7 @@ upd_rgb_3color(gx_device *pdev, const gx_color_value cv[]) /* ------------------------------------------------------------------- */ static int -upd_3color_rgb(gx_device *pdev, gx_color_index color, gx_color_value prgb[3]) +upd_3color_rgb(gx_device *pdev, gx_color_index color, gx_color_value prgb[]) { const upd_p upd = ((upd_device *)pdev)->upd; @@ -2443,7 +2443,7 @@ upd_rgb_4color(gx_device *pdev, const gx_color_value cv[]) /* ------------------------------------------------------------------- */ static int -upd_4color_rgb(gx_device *pdev, gx_color_index color, gx_color_value prgb[3]) +upd_4color_rgb(gx_device *pdev, gx_color_index color, gx_color_value prgb[]) { const upd_p upd = ((upd_device *)pdev)->upd; @@ -2540,7 +2540,7 @@ upd_cmyk_kcolor(gx_device *pdev, const gx_color_value cv[]) /* ------------------------------------------------------------------- */ static int -upd_kcolor_rgb(gx_device *pdev, gx_color_index color, gx_color_value prgb[3]) +upd_kcolor_rgb(gx_device *pdev, gx_color_index color, gx_color_value prgb[]) { const upd_p upd = ((upd_device *)pdev)->upd; gx_color_value c,m,y,k; @@ -3559,7 +3559,7 @@ upd_close_fscomp(upd_device *udev) * 3/16 5/16 1/16 Y+1 */ #define FS_DIST(I) \ - if(!first) rowerr[I-dir] += ((3*pixel[I]+8)>>4); /* 3/16 */ \ + if(!first) { rowerr[I-dir] += ((3*pixel[I]+8)>>4);} /* 3/16 */ \ rowerr[I ] = ((5*pixel[I] )>>4) /* 5/16 */ \ + (( colerr[I]+4)>>3); /* 1/16 (rest) */ \ colerr[I ] = pixel[I] /* 8/16 (neu) */ \ diff --git a/devices/vector/gdevpsf2.c b/devices/vector/gdevpsf2.c index a6db8b5bc..253058826 100644 --- a/devices/vector/gdevpsf2.c +++ b/devices/vector/gdevpsf2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -203,7 +203,7 @@ put_bytes(stream * s, const byte *ptr, uint count) static int check_ioerror(stream * s) { - uint used; + uint used = 0; return sputs(s, (byte *)&used, 0, &used); } |