From d7961033ee224fc5d2c96a16bea3f3399dd29561 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 12 Mar 2020 17:22:36 +0000 Subject: Add support for 64bit and size_t paramaters. Cope with both int64_t's and size_t's with appropriate rangechecks when casting will cause problems. -d values on the command line are read as int64_t's. If we ever find outselves wanting to assign a size_t where the 63rd bit matters, then we may have to rethink this :) We also change various params (such as MaxBitmap, MaxPatternBitmap etc) to be size_t's. This affects the device structure itself. --- psi/iparam.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'psi/iparam.c') diff --git a/psi/iparam.c b/psi/iparam.c index 3106f412e..6ae475125 100644 --- a/psi/iparam.c +++ b/psi/iparam.c @@ -222,8 +222,17 @@ ref_param_write_typed(gs_param_list * plist, gs_param_name pkey, make_int(&value, pvalue->value.i); break; case gs_param_type_long: + /* FIXME: Rangecheck? */ make_int(&value, pvalue->value.l); break; + case gs_param_type_size_t: + /* FIXME: Rangecheck? */ + make_int(&value, pvalue->value.z); + break; + case gs_param_type_i64: + /* FIXME: Rangecheck? */ + make_int(&value, pvalue->value.i64); + break; case gs_param_type_float: make_real(&value, pvalue->value.f); break; @@ -782,8 +791,8 @@ ref_param_read_typed(gs_param_list * plist, gs_param_name pkey, } return 0; case t_integer: - pvalue->type = gs_param_type_long; - pvalue->value.l = loc.pvalue->value.intval; + pvalue->type = gs_param_type_i64; + pvalue->value.i64 = loc.pvalue->value.intval; return 0; case t_name: pvalue->type = gs_param_type_name; -- cgit v1.2.1