-/* $OpenBSD: bcode.c,v 1.60 2017/12/12 18:58:59 otto Exp $ */
+/* $OpenBSD: bcode.c,v 1.61 2017/12/12 19:07:10 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
static __inline struct value *tos(void);
static __inline struct number *pop_number(void);
static __inline char *pop_string(void);
-static __inline void clear_stack(void);
-static __inline void print_tos(void);
+static void clear_stack(void);
+static void print_tos(void);
static void print_err(void);
static void pop_print(void);
static void pop_printn(void);
-static __inline void print_stack(void);
-static __inline void dup(void);
+static void print_stack(void);
+static void dup(void);
static void swap(void);
static void drop(void);
return stack_popstring(&bmachine.stack);
}
-static __inline void
+static void
clear_stack(void)
{
stack_clear(&bmachine.stack);
}
-static __inline void
+static void
print_stack(void)
{
stack_print(stdout, &bmachine.stack, "", bmachine.obase);
}
-static __inline void
+static void
print_tos(void)
{
struct value *value = tos();
if (value != NULL) {
print_value(stdout, value, "", bmachine.obase);
(void)putchar('\n');
- }
- else
+ } else
warnx("stack empty");
}
if (value != NULL) {
print_value(stderr, value, "", bmachine.obase);
(void)putc('\n', stderr);
- }
- else
+ } else
warnx("stack empty");
}
}
}
-static __inline void
+static void
dup(void)
{
stack_dup(&bmachine.stack);
bmachine.scale = (u_int)scale;
else
warnx("scale too large");
- }
+ }
free_number(n);
}
}
u_int scale = 0;
struct number *n;
-
value = pop();
if (value != NULL) {
switch (value->type) {
n = new_number();
bn_check(BN_set_word(n->number, 0));
push_number(n);
- }
- else
+ } else
push(stack_dup_value(v, ©));
}
free_number(inumber);
warnx("Runtime warning: non-zero fractional part in exponent");
BN_free(i);
BN_free(f);
- }
- normalize(p, 0);
+ normalize(p, 0);
+ }
- neg = false;
- if (BN_is_negative(p->number)) {
- neg = true;
+ neg = BN_is_negative(p->number);
+ if (neg) {
negate(p);
rscale = bmachine.scale;
} else {
}
}
-
static void
nop(void)
{