summaryrefslogtreecommitdiff
path: root/contrib/gdevdj9.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-04-26 18:10:56 +0100
committerRobin Watts <Robin.Watts@artifex.com>2021-04-26 19:49:13 +0100
commit20610dc28ee3cf7e64ad46f11e9b96fb3befba00 (patch)
treecaf1ecd133beea5ab478858fc8f022081912ab89 /contrib/gdevdj9.c
parentedd20b3b8c3c1a7117dd5dbee0b54cd1de7838bf (diff)
downloadghostpdl-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 'contrib/gdevdj9.c')
-rw-r--r--contrib/gdevdj9.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/contrib/gdevdj9.c b/contrib/gdevdj9.c
index a7d6ab915..87a62b320 100644
--- a/contrib/gdevdj9.c
+++ b/contrib/gdevdj9.c
@@ -510,13 +510,10 @@ typedef struct
terminate_page\
}
-static int
-cdj970_initialize(gx_device *dev)
+static void
+cdj970_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, hp_colour_open);
set_dev_proc(dev, close_device, cdj970_close);
@@ -531,8 +528,6 @@ cdj970_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;
}
static void
@@ -549,7 +544,8 @@ static void
cdj970_terminate_page(gx_device_printer * pdev, gp_file * prn_stream);
const gx_device_cdj970 gs_cdj970_device =
-cdj_970_device(cdj970_initialize, "cdj970", 600, 600, 32, cdj970_print_page, 0,
+cdj_970_device(cdj970_initialize_device_procs, "cdj970",
+ 600, 600, 32, cdj970_print_page, 0,
NORMAL, PLAIN_PAPER, NONE, 4, DJ970C, 2,
1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
cdj970_start_raster_mode, cdj970_print_non_blank_lines,