summaryrefslogtreecommitdiff
path: root/devices/gdevpsd.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-03-22 18:16:20 +0000
committerRobin Watts <Robin.Watts@artifex.com>2021-04-20 15:03:02 +0100
commit1d9b79910d988d074f262c65d3559c5045a5343f (patch)
tree75c820d2965985d7ff74e6760d5c1a32b4d6a14d /devices/gdevpsd.c
parent6f332dd0baee0135ebff0bf25c56e9adff0f944a (diff)
downloadghostpdl-1d9b79910d988d074f262c65d3559c5045a5343f.tar.gz
Further rationalisation of device init.
Move the initialize procedure out of the device procs table, and into a bare function pointer at the start of the device proc. Devices just initialise this, and the rest should fall into place. This means changes to the device instantion macros (and all the uses thereof), but makes the code nicer overall. In particular, this removes the vestigial 'static_procs' structure.
Diffstat (limited to 'devices/gdevpsd.c')
-rw-r--r--devices/gdevpsd.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/devices/gdevpsd.c b/devices/gdevpsd.c
index a4593d80c..c52a8fce0 100644
--- a/devices/gdevpsd.c
+++ b/devices/gdevpsd.c
@@ -194,12 +194,9 @@ psd_initialize(gx_device *dev)
/*
* PSD device with RGB process color model.
*/
-static const gx_device_procs spot_rgb_procs =
- devprocs_initialize(psd_initialize);
-
const psd_device gs_psdrgb_device =
{
- psd_device_body(spot_rgb_procs, "psdrgb", 3, GX_CINFO_POLARITY_ADDITIVE, 24, 255, 255, GX_CINFO_SEP_LIN, "DeviceRGB"),
+ psd_device_body(psd_initialize, "psdrgb", 3, GX_CINFO_POLARITY_ADDITIVE, 24, 255, 255, GX_CINFO_SEP_LIN, "DeviceRGB"),
/* devn_params specific parameters */
{ 8, /* Bits per color - must match ncomp, depth, etc. above */
DeviceRGBComponents, /* Names of color model colorants */
@@ -220,7 +217,7 @@ const psd_device gs_psdrgb_device =
const psd_device gs_psdrgb16_device =
{
- psd_device_body(spot_rgb_procs, "psdrgb16", 3, GX_CINFO_POLARITY_ADDITIVE, 48, 65535, 65535, GX_CINFO_SEP_LIN, "DeviceRGB"),
+ psd_device_body(psd_initialize, "psdrgb16", 3, GX_CINFO_POLARITY_ADDITIVE, 48, 65535, 65535, GX_CINFO_SEP_LIN, "DeviceRGB"),
/* devn_params specific parameters */
{ 16, /* Bits per color - must match ncomp, depth, etc. above */
DeviceRGBComponents, /* Names of color model colorants */
@@ -256,12 +253,10 @@ psdcmyk_initialize(gx_device *dev)
return 0;
}
-static const gx_device_procs spot_cmyk_procs =
- devprocs_initialize(psdcmyk_initialize);
const psd_device gs_psdcmyk_device =
{
- psd_device_body(spot_cmyk_procs, "psdcmyk",
+ psd_device_body(psdcmyk_initialize, "psdcmyk",
ARCH_SIZEOF_GX_COLOR_INDEX, /* Number of components - need a nominal 1 bit for each */
GX_CINFO_POLARITY_SUBTRACTIVE,
ARCH_SIZEOF_GX_COLOR_INDEX * 8, /* 8 bits per component (albeit in planes) */
@@ -286,7 +281,7 @@ const psd_device gs_psdcmyk_device =
const psd_device gs_psdcmyk16_device =
{
- psd_device_body(spot_cmyk_procs, "psdcmyk16",
+ psd_device_body(psdcmyk_initialize, "psdcmyk16",
ARCH_SIZEOF_GX_COLOR_INDEX, /* Number of components - need a nominal 1 bit for each */
GX_CINFO_POLARITY_SUBTRACTIVE,
ARCH_SIZEOF_GX_COLOR_INDEX * 16, /* 8 bits per component (albeit in planes) */