Lines Matching refs:rhs
74 static int cmp(struct value *lhs, struct value *rhs) in cmp() argument
76 if (lhs->s || rhs->s) { in cmp()
79 char *rs = rhs->s ? rhs->s : num_to_str(rhs->i); in cmp()
81 } else return lhs->i - rhs->i; in cmp()
84 static void re(struct value *lhs, struct value *rhs) in re() argument
89 xregcomp(&rp, rhs->s, 0); in re()
105 static void mod(struct value *lhs, struct value *rhs) in mod() argument
107 if (lhs->s || rhs->s) error_exit("non-integer argument"); in mod()
108 if (is_zero(rhs)) error_exit("division by zero"); in mod()
109 lhs->i %= rhs->i; in mod()
112 static void divi(struct value *lhs, struct value *rhs) in divi() argument
114 if (lhs->s || rhs->s) error_exit("non-integer argument"); in divi()
115 if (is_zero(rhs)) error_exit("division by zero"); in divi()
116 lhs->i /= rhs->i; in divi()
119 static void mul(struct value *lhs, struct value *rhs) in mul() argument
121 if (lhs->s || rhs->s) error_exit("non-integer argument"); in mul()
122 lhs->i *= rhs->i; in mul()
125 static void sub(struct value *lhs, struct value *rhs) in sub() argument
127 if (lhs->s || rhs->s) error_exit("non-integer argument"); in sub()
128 lhs->i -= rhs->i; in sub()
131 static void add(struct value *lhs, struct value *rhs) in add() argument
133 if (lhs->s || rhs->s) error_exit("non-integer argument"); in add()
134 lhs->i += rhs->i; in add()
137 static void ne(struct value *lhs, struct value *rhs) in ne() argument
139 lhs->i = cmp(lhs, rhs) != 0; in ne()
143 static void lte(struct value *lhs, struct value *rhs) in lte() argument
145 lhs->i = cmp(lhs, rhs) <= 0; in lte()
149 static void lt(struct value *lhs, struct value *rhs) in lt() argument
151 lhs->i = cmp(lhs, rhs) < 0; in lt()
155 static void gte(struct value *lhs, struct value *rhs) in gte() argument
157 lhs->i = cmp(lhs, rhs) >= 0; in gte()
161 static void gt(struct value *lhs, struct value *rhs) in gt() argument
163 lhs->i = cmp(lhs, rhs) > 0; in gt()
167 static void eq(struct value *lhs, struct value *rhs) in eq() argument
169 lhs->i = !cmp(lhs, rhs); in eq()
173 static void and(struct value *lhs, struct value *rhs) in and() argument
175 if (is_zero(lhs) || is_zero(rhs)) { in and()
181 static void or(struct value *lhs, struct value *rhs) in or() argument
183 if (is_zero(lhs)) *lhs = *rhs; in or()
221 void (*calc)(struct value *lhs, struct value *rhs);
251 struct value rhs; in parse_op() local
252 parse_op(&rhs, tok, op + 1); in parse_op()
253 if (rhs.s && !*rhs.s) error_exit("syntax error"); // premature end of expression in parse_op()
254 op->calc(lhs, &rhs); in parse_op()