diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-04-26 18:10:56 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-04-26 19:49:13 +0100 |
commit | 20610dc28ee3cf7e64ad46f11e9b96fb3befba00 (patch) | |
tree | caf1ecd133beea5ab478858fc8f022081912ab89 /devices/gdevphex.c | |
parent | edd20b3b8c3c1a7117dd5dbee0b54cd1de7838bf (diff) | |
download | ghostpdl-20610dc28ee3cf7e64ad46f11e9b96fb3befba00.tar.gz |
Split initialize device proc into two.
The device initialize function currently performs 2 jobs. Firstly,
it fills out the device_procs. Secondly, it performs any minimal
initialization required by the device (typically none).
At various points in the code we want to be able to copy procs
from one 'prototype' device to another, so we call initialize
for that. This populates the device procs, but does other work
that typically requires a 'derived device' structure rather
than a vanilla gx_device to work in.
Accordingly, we split the job into two; initialize_device_procs
(the first part) and initialize_device (the second part). The
initialize_device_procs function will set up the initialize_device
function pointer along with the rest if required.
Diffstat (limited to 'devices/gdevphex.c')
-rw-r--r-- | devices/gdevphex.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/devices/gdevphex.c b/devices/gdevphex.c index 74d0c858a..2c832da6a 100644 --- a/devices/gdevphex.c +++ b/devices/gdevphex.c @@ -1007,13 +1007,10 @@ static const HFUNCS htable[ MAXHTONE ] = { * The definition is based on GS macros, the only real stuff that we * define here are the photoex_ functions. */ -static int -photoex_initialize(gx_device *dev) +static void +photoex_initialize_device_procs(gx_device *dev) { - int code = gdev_prn_initialize_bg(dev); - - if (code < 0) - return code; + gdev_prn_initialize_device_procs_bg(dev); set_dev_proc(dev, open_device, photoex_open); set_dev_proc(dev, map_rgb_color, photoex_map_rgb_color); @@ -1022,8 +1019,6 @@ photoex_initialize(gx_device *dev) set_dev_proc(dev, put_params, photoex_put_params); set_dev_proc(dev, encode_color, photoex_encode_color); set_dev_proc(dev, decode_color, photoex_decode_color); - - return 0; } /* @@ -1039,7 +1034,7 @@ gx_photoex_device far_data gs_photoex_device = { prn_device_body( gx_photoex_device, /* Device struct type */ - photoex_initialize, /* Initialize proc */ + photoex_initialize_device_procs, /* Initialize proc */ "photoex", /* Name of the device */ DEFAULT_WIDTH_10THS, /* Default width */ DEFAULT_HEIGHT_10THS, /* Default height */ |