summaryrefslogtreecommitdiff
path: root/cups
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 /cups
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 'cups')
-rw-r--r--cups/gdevcups.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cups/gdevcups.c b/cups/gdevcups.c
index e49149c26..7f4b86825 100644
--- a/cups/gdevcups.c
+++ b/cups/gdevcups.c
@@ -312,8 +312,8 @@ typedef struct gx_device_cups_s
/* Used by cups_put_params(): */
} gx_device_cups;
-static int
-cups_initialize(gx_device *dev)
+static void
+cups_initialize_device_procs(gx_device *dev)
{
set_dev_proc(dev, open_device, cups_open);
set_dev_proc(dev, get_initial_matrix, cups_get_matrix);
@@ -334,8 +334,6 @@ cups_initialize(gx_device *dev)
set_dev_proc(dev, put_params, cups_put_params);
set_dev_proc(dev, get_page_device, gx_page_device_get_page_device);
set_dev_proc(dev, dev_spec_op, cups_spec_op);
-
- return 0;
}
#define prn_device_body_copies(dtype, init, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\
@@ -373,7 +371,7 @@ cups_initialize(gx_device *dev)
#define gs_xxx_device(dname, mediaclass)\
prn_device_body_copies(gx_device_cups,/* type */\
- cups_initialize,/* init */\
+ cups_initialize_device_procs,/* init */\
dname, /* device name */\
85, /* initial width */\
110, /* initial height */\