[BACK]Return to stack.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / dc

Diff for /src/usr.bin/dc/stack.c between version 1.8 and 1.9

version 1.8, 2006/01/15 19:11:59 version 1.9, 2006/01/16 08:09:25
Line 96 
Line 96 
         return copy;          return copy;
 }  }
   
 int  size_t
 stack_size(const struct stack *stack)  stack_size(const struct stack *stack)
 {  {
         return stack->sp + 1;          return stack->sp + 1;
Line 133 
Line 133 
 static void  static void
 stack_grow(struct stack *stack)  stack_grow(struct stack *stack)
 {  {
         int new_size, i;          size_t new_size, i;
   
         if (++stack->sp == stack->size) {          if (++stack->sp == stack->size) {
                 new_size = stack->size * 2 + 1;                  new_size = stack->size * 2 + 1;
Line 254 
Line 254 
 void  void
 stack_print(FILE *f, const struct stack *stack, const char *prefix, u_int base)  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--) {          for (i = stack->sp; i >= 0; i--) {
                 print_value(f, &stack->stack[i], prefix, base);                  print_value(f, &stack->stack[i], prefix, base);
Line 277 
Line 277 
 static __inline void  static __inline void
 array_free(struct array *a)  array_free(struct array *a)
 {  {
         u_int i;          size_t i;
   
         if (a == NULL)          if (a == NULL)
                 return;                  return;
Line 291 
Line 291 
 array_dup(const struct array *a)  array_dup(const struct array *a)
 {  {
         struct array    *n;          struct array    *n;
         u_int           i;          size_t          i;
   
         if (a == NULL)          if (a == NULL)
                 return NULL;                  return NULL;

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9