summaryrefslogtreecommitdiff
path: root/cups
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 /cups
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 'cups')
-rw-r--r--cups/gdevcups.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/cups/gdevcups.c b/cups/gdevcups.c
index f5ffe6db4..e49149c26 100644
--- a/cups/gdevcups.c
+++ b/cups/gdevcups.c
@@ -338,11 +338,8 @@ cups_initialize(gx_device *dev)
return 0;
}
-private gx_device_procs cups_procs =
- devprocs_initialize(cups_initialize);
-
-#define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\
- std_device_full_body_type(dtype, &procs, dname, &st_device_printer,\
+#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)\
+ std_device_full_body_type(dtype, init, dname, &st_device_printer,\
(int)((long)(w10) * (xdpi) / 10),\
(int)((long)(h10) * (ydpi) / 10),\
xdpi, ydpi,\
@@ -376,7 +373,7 @@ private gx_device_procs cups_procs =
#define gs_xxx_device(dname, mediaclass)\
prn_device_body_copies(gx_device_cups,/* type */\
- cups_procs, /* procedures */\
+ cups_initialize,/* init */\
dname, /* device name */\
85, /* initial width */\
110, /* initial height */\