diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2018-12-03 14:59:55 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2018-12-13 10:33:58 +0000 |
commit | 85bb44261edbf10552a09c839decc669f63a8142 (patch) | |
tree | e41f3756be4ba1b968e78b56cae826ad3125ca45 /psi/zfunc.c | |
parent | e280984683a5ca0f2d496a93d0333b4a89ab7f42 (diff) | |
download | ghostpdl-85bb44261edbf10552a09c839decc669f63a8142.tar.gz |
Add an "r_is_number()" macro
By moving the t_integer and t_real enum values to consecutive positions,
starting on a multiple of 2, we can check for a "number" type in a single step.
Useful for values specced as reals, but which may be integer values, and thus
parsed into integer objects. This means validation can be a single check,
rather than checking for real and integer individually.
Also use the macro in various places.
Diffstat (limited to 'psi/zfunc.c')
-rw-r--r-- | psi/zfunc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/psi/zfunc.c b/psi/zfunc.c index 135c31682..8fb3d8671 100644 --- a/psi/zfunc.c +++ b/psi/zfunc.c @@ -306,7 +306,7 @@ fn_build_float_array_forced(const ref * op, const char *kstr, bool required, if( r_is_array(par) ) size = r_size(par); - else if(r_type(par) == t_integer || r_type(par) == t_real) + else if(r_is_number(par)) size = 1; else return_error(gs_error_typecheck); |