summaryrefslogtreecommitdiff
path: root/contrib/gdevlx32.c
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 /contrib/gdevlx32.c
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 'contrib/gdevlx32.c')
-rw-r--r--contrib/gdevlx32.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/gdevlx32.c b/contrib/gdevlx32.c
index fe2076cb8..12ff12532 100644
--- a/contrib/gdevlx32.c
+++ b/contrib/gdevlx32.c
@@ -271,12 +271,15 @@ lxm3200_initialize(gx_device *dev)
set_dev_proc(dev, get_params, lxm3200_get_params);
set_dev_proc(dev, put_params, lxm3200_put_params);
+ /* The static init used in previous versions of the code leave
+ * encode_color and decode_color set to NULL (which are then rewritten
+ * 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 gx_device_procs lxm3200_procs =
- devprocs_initialize(lxm3200_initialize);
-
/* Define an extension (subclass) of gx_device_printer. */
struct lxm_device_s
{
@@ -323,7 +326,7 @@ struct lxm_device_s
lxm_device far_data gs_lxm3200_device =
{
prn_device_body(lxm_device,
- lxm3200_procs,
+ lxm3200_initialize,
"lxm3200",
DEFAULT_WIDTH_10THS,
DEFAULT_HEIGHT_10THS,