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/gdevifno.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/gdevifno.c')
-rw-r--r-- | devices/gdevifno.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/devices/gdevifno.c b/devices/gdevifno.c index d3a8b9a3b..26e55c2db 100644 --- a/devices/gdevifno.c +++ b/devices/gdevifno.c @@ -81,13 +81,10 @@ gs_private_st_suffix_add1_final(st_inferno_device, inferno_device, "inferno_device", inferno_device_enum_ptrs, inferno_device_reloc_ptrs, gx_device_finalize, st_device_printer, p9color); -static int -inferno_initialize(gx_device *dev) +static void +inferno_initialize_device_procs(gx_device *dev) { - int code = gdev_prn_initialize(dev); - - if (code < 0) - return code; + gdev_prn_initialize_device_procs(dev); set_dev_proc(dev, open_device, inferno_open); set_dev_proc(dev, close_device, inferno_close); @@ -99,13 +96,11 @@ inferno_initialize(gx_device *dev) * by the system to the default. For compatibility we do the same. */ set_dev_proc(dev, encode_color, NULL); set_dev_proc(dev, decode_color, NULL); - - return 0; } inferno_device far_data gs_inferno_device = -{ prn_device_stype_body(inferno_device, inferno_initialize, "inferno", - &st_inferno_device, +{ prn_device_stype_body(inferno_device, inferno_initialize_device_procs, + "inferno", &st_inferno_device, DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, 0,0,0,0, /* margins */ |