summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-01-16 08:09:26 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-01-16 08:09:26 +0000
commit68489bdc5d85570687fb2fb385d6571c9784bb90 (patch)
treeba0ad370ce2cf7c6d1e2bcc62fa8640ca92f3664 /usr.bin
parent4c84479000c6dff676c5c2ea88c768928b9d4f8c (diff)
delint; use size_t as stack size and ssize_t as stack pointer.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/dc/bcode.c8
-rw-r--r--usr.bin/dc/bcode.h6
-rw-r--r--usr.bin/dc/extern.h4
-rw-r--r--usr.bin/dc/stack.c14
4 files changed, 16 insertions, 16 deletions
diff --git a/usr.bin/dc/bcode.c b/usr.bin/dc/bcode.c
index d6e62c04386..d658853a304 100644
--- a/usr.bin/dc/bcode.c
+++ b/usr.bin/dc/bcode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcode.c,v 1.32 2006/01/15 19:14:40 otto Exp $ */
+/* $OpenBSD: bcode.c,v 1.33 2006/01/16 08:09:25 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: bcode.c,v 1.32 2006/01/15 19:14:40 otto Exp $";
+static const char rcsid[] = "$OpenBSD: bcode.c,v 1.33 2006/01/16 08:09:25 otto Exp $";
#endif /* not lint */
#include <ssl/ssl.h>
@@ -644,7 +644,7 @@ set_ibase(void)
static void
stackdepth(void)
{
- u_int i;
+ size_t i;
struct number *n;
i = stack_size(&bmachine.stack);
@@ -749,7 +749,7 @@ to_ascii(void)
normalize(n, 0);
if (BN_num_bits(n->number) > 8)
bn_check(BN_mask_bits(n->number, 8));
- str[0] = BN_get_word(n->number);
+ str[0] = (char)BN_get_word(n->number);
break;
case BCODE_STRING:
str[0] = value->u.string[0];
diff --git a/usr.bin/dc/bcode.h b/usr.bin/dc/bcode.h
index 87e917e5ff5..a6d2291c79b 100644
--- a/usr.bin/dc/bcode.h
+++ b/usr.bin/dc/bcode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcode.h,v 1.4 2006/01/15 19:11:59 otto Exp $ */
+/* $OpenBSD: bcode.h,v 1.5 2006/01/16 08:09:25 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -58,8 +58,8 @@ struct array {
struct stack {
struct value *stack;
- int sp;
- int size;
+ ssize_t sp;
+ size_t size;
};
struct source;
diff --git a/usr.bin/dc/extern.h b/usr.bin/dc/extern.h
index 386b3bc7c51..b179d2e0e46 100644
--- a/usr.bin/dc/extern.h
+++ b/usr.bin/dc/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.2 2003/11/04 08:10:06 otto Exp $ */
+/* $OpenBSD: extern.h,v 1.3 2006/01/16 08:09:25 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -44,7 +44,7 @@ void stack_init(struct stack *);
void stack_free_value(struct value *);
struct value *stack_dup_value(const struct value *, struct value *);
void stack_swap(struct stack *);
-int stack_size(const struct stack *);
+size_t stack_size(const struct stack *);
void stack_dup(struct stack *);
void stack_pushnumber(struct stack *, struct number *);
void stack_pushstring(struct stack *stack, char *);
diff --git a/usr.bin/dc/stack.c b/usr.bin/dc/stack.c
index 9ab98f9a799..c8302574f56 100644
--- a/usr.bin/dc/stack.c
+++ b/usr.bin/dc/stack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stack.c,v 1.8 2006/01/15 19:11:59 otto Exp $ */
+/* $OpenBSD: stack.c,v 1.9 2006/01/16 08:09:25 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: stack.c,v 1.8 2006/01/15 19:11:59 otto Exp $";
+static const char rcsid[] = "$OpenBSD: stack.c,v 1.9 2006/01/16 08:09:25 otto Exp $";
#endif /* not lint */
#include <err.h>
@@ -96,7 +96,7 @@ stack_dup_value(const struct value *a, struct value *copy)
return copy;
}
-int
+size_t
stack_size(const struct stack *stack)
{
return stack->sp + 1;
@@ -133,7 +133,7 @@ stack_swap(struct stack *stack)
static void
stack_grow(struct stack *stack)
{
- int new_size, i;
+ size_t new_size, i;
if (++stack->sp == stack->size) {
new_size = stack->size * 2 + 1;
@@ -254,7 +254,7 @@ stack_clear(struct stack *stack)
void
stack_print(FILE *f, const struct stack *stack, const char *prefix, u_int base)
{
- int i;
+ ssize_t i;
for (i = stack->sp; i >= 0; i--) {
print_value(f, &stack->stack[i], prefix, base);
@@ -277,7 +277,7 @@ array_new(void)
static __inline void
array_free(struct array *a)
{
- u_int i;
+ size_t i;
if (a == NULL)
return;
@@ -291,7 +291,7 @@ static struct array *
array_dup(const struct array *a)
{
struct array *n;
- u_int i;
+ size_t i;
if (a == NULL)
return NULL;