summaryrefslogtreecommitdiff
path: root/gs/psi/zrelbit.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-04-19 23:49:56 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-04-19 23:49:56 +0200
commit781969994b5381ba4bed03beef217f9bde6e7c58 (patch)
treeaede27c7532f0fbe82f03dc0c04c9316be510fd5 /gs/psi/zrelbit.c
parent0b17959f31afe3baffbc328e7f92e88e634ad8b8 (diff)
Indent with spaces and strip trailing whitespace.
Diffstat (limited to 'gs/psi/zrelbit.c')
-rw-r--r--gs/psi/zrelbit.c168
1 files changed, 84 insertions, 84 deletions
diff --git a/gs/psi/zrelbit.c b/gs/psi/zrelbit.c
index 9d733ebb1..47f605234 100644
--- a/gs/psi/zrelbit.c
+++ b/gs/psi/zrelbit.c
@@ -1,6 +1,6 @@
/* Copyright (C) 2001-2006 Artifex Software, Inc.
All Rights Reserved.
-
+
This software is provided AS-IS with no warranty, either express or
implied.
@@ -29,11 +29,11 @@
/* Define the type test for eq and its relatives. */
#define EQ_CHECK_READ(opp, dflt)\
switch ( r_type(opp) ) {\
- case t_string:\
- check_read(*(opp));\
- break;\
- default:\
- dflt;\
+ case t_string:\
+ check_read(*(opp));\
+ break;\
+ default:\
+ dflt;\
}
/* Forward references */
@@ -58,7 +58,7 @@ zne(i_ctx_t *i_ctx_p)
int code = zeq(i_ctx_p);
if (!code)
- osp->value.boolval ^= 1;
+ osp->value.boolval ^= 1;
return code;
}
@@ -71,7 +71,7 @@ zge(i_ctx_t *i_ctx_p)
int code = obj_le(op, op - 1);
if (code < 0)
- return code;
+ return code;
make_bool(op - 1, code);
pop(1);
return 0;
@@ -86,7 +86,7 @@ zgt(i_ctx_t *i_ctx_p)
int code = obj_le(op - 1, op);
if (code < 0)
- return code;
+ return code;
make_bool(op - 1, code ^ 1);
pop(1);
return 0;
@@ -101,7 +101,7 @@ zle(i_ctx_t *i_ctx_p)
int code = obj_le(op - 1, op);
if (code < 0)
- return code;
+ return code;
make_bool(op - 1, code);
pop(1);
return 0;
@@ -116,7 +116,7 @@ zlt(i_ctx_t *i_ctx_p)
int code = obj_le(op, op - 1);
if (code < 0)
- return code;
+ return code;
make_bool(op - 1, code ^ 1);
pop(1);
return 0;
@@ -131,9 +131,9 @@ zmax(i_ctx_t *i_ctx_p)
int code = obj_le(op - 1, op);
if (code < 0)
- return code;
+ return code;
if (code) {
- ref_assign(op - 1, op);
+ ref_assign(op - 1, op);
}
pop(1);
return 0;
@@ -148,9 +148,9 @@ zmin(i_ctx_t *i_ctx_p)
int code = obj_le(op - 1, op);
if (code < 0)
- return code;
+ return code;
if (!code) {
- ref_assign(op - 1, op);
+ ref_assign(op - 1, op);
}
pop(1);
return 0;
@@ -164,16 +164,16 @@ zand(i_ctx_t *i_ctx_p)
os_ptr op = osp;
switch (r_type(op)) {
- case t_boolean:
- check_type(op[-1], t_boolean);
- op[-1].value.boolval &= op->value.boolval;
- break;
- case t_integer:
- check_type(op[-1], t_integer);
- op[-1].value.intval &= op->value.intval;
- break;
- default:
- return_op_typecheck(op);
+ case t_boolean:
+ check_type(op[-1], t_boolean);
+ op[-1].value.boolval &= op->value.boolval;
+ break;
+ case t_integer:
+ check_type(op[-1], t_integer);
+ op[-1].value.intval &= op->value.intval;
+ break;
+ default:
+ return_op_typecheck(op);
}
pop(1);
return 0;
@@ -187,14 +187,14 @@ znot(i_ctx_t *i_ctx_p)
os_ptr op = osp;
switch (r_type(op)) {
- case t_boolean:
- op->value.boolval = !op->value.boolval;
- break;
- case t_integer:
- op->value.intval = ~op->value.intval;
- break;
- default:
- return_op_typecheck(op);
+ case t_boolean:
+ op->value.boolval = !op->value.boolval;
+ break;
+ case t_integer:
+ op->value.intval = ~op->value.intval;
+ break;
+ default:
+ return_op_typecheck(op);
}
return 0;
}
@@ -207,16 +207,16 @@ zor(i_ctx_t *i_ctx_p)
os_ptr op = osp;
switch (r_type(op)) {
- case t_boolean:
- check_type(op[-1], t_boolean);
- op[-1].value.boolval |= op->value.boolval;
- break;
- case t_integer:
- check_type(op[-1], t_integer);
- op[-1].value.intval |= op->value.intval;
- break;
- default:
- return_op_typecheck(op);
+ case t_boolean:
+ check_type(op[-1], t_boolean);
+ op[-1].value.boolval |= op->value.boolval;
+ break;
+ case t_integer:
+ check_type(op[-1], t_integer);
+ op[-1].value.intval |= op->value.intval;
+ break;
+ default:
+ return_op_typecheck(op);
}
pop(1);
return 0;
@@ -230,16 +230,16 @@ zxor(i_ctx_t *i_ctx_p)
os_ptr op = osp;
switch (r_type(op)) {
- case t_boolean:
- check_type(op[-1], t_boolean);
- op[-1].value.boolval ^= op->value.boolval;
- break;
- case t_integer:
- check_type(op[-1], t_integer);
- op[-1].value.intval ^= op->value.intval;
- break;
- default:
- return_op_typecheck(op);
+ case t_boolean:
+ check_type(op[-1], t_boolean);
+ op[-1].value.boolval ^= op->value.boolval;
+ break;
+ case t_integer:
+ check_type(op[-1], t_integer);
+ op[-1].value.intval ^= op->value.intval;
+ break;
+ default:
+ return_op_typecheck(op);
}
pop(1);
return 0;
@@ -255,11 +255,11 @@ zbitshift(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
check_type(op[-1], t_integer);
if (op->value.intval < -31 || op->value.intval > 31)
- op[-1].value.intval = 0;
+ op[-1].value.intval = 0;
else if ((shift = op->value.intval) < 0)
- op[-1].value.intval = ((uint)(op[-1].value.intval)) >> -shift;
+ op[-1].value.intval = ((uint)(op[-1].value.intval)) >> -shift;
else
- op[-1].value.intval <<= shift;
+ op[-1].value.intval <<= shift;
pop(1);
return 0;
}
@@ -284,11 +284,11 @@ zidenteq(i_ctx_t *i_ctx_p)
static int
zidentne(i_ctx_t *i_ctx_p)
{
- /* We'll just be lazy and use .identeq. */
+ /* We'll just be lazy and use .identeq. */
int code = zidenteq(i_ctx_p);
if (!code)
- osp->value.boolval ^= 1;
+ osp->value.boolval ^= 1;
return code;
}
@@ -309,7 +309,7 @@ const op_def zrelbit_op_defs[] =
{"1not", znot},
{"2or", zor},
{"2xor", zxor},
- /* Extensions */
+ /* Extensions */
{"2.identeq", zidenteq},
{"2.identne", zidentne},
op_def_end(0)
@@ -324,30 +324,30 @@ static int
obj_le(register os_ptr op1, register os_ptr op)
{
switch (r_type(op1)) {
- case t_integer:
- switch (r_type(op)) {
- case t_integer:
- return (op1->value.intval <= op->value.intval);
- case t_real:
- return ((double)op1->value.intval <= op->value.realval);
- default:
- return_op_typecheck(op);
- }
- case t_real:
- switch (r_type(op)) {
- case t_real:
- return (op1->value.realval <= op->value.realval);
- case t_integer:
- return (op1->value.realval <= (double)op->value.intval);
- default:
- return_op_typecheck(op);
- }
- case t_string:
- check_read(*op1);
- check_read_type(*op, t_string);
- return (bytes_compare(op1->value.bytes, r_size(op1),
- op->value.bytes, r_size(op)) <= 0);
- default:
- return_op_typecheck(op1);
+ case t_integer:
+ switch (r_type(op)) {
+ case t_integer:
+ return (op1->value.intval <= op->value.intval);
+ case t_real:
+ return ((double)op1->value.intval <= op->value.realval);
+ default:
+ return_op_typecheck(op);
+ }
+ case t_real:
+ switch (r_type(op)) {
+ case t_real:
+ return (op1->value.realval <= op->value.realval);
+ case t_integer:
+ return (op1->value.realval <= (double)op->value.intval);
+ default:
+ return_op_typecheck(op);
+ }
+ case t_string:
+ check_read(*op1);
+ check_read_type(*op, t_string);
+ return (bytes_compare(op1->value.bytes, r_size(op1),
+ op->value.bytes, r_size(op)) <= 0);
+ default:
+ return_op_typecheck(op1);
}
}