From e3690eb85a9456cc1f3ccda751ae7d9fdf2d3b03 Mon Sep 17 00:00:00 2001 From: Hampus Date: Tue, 4 Jan 2022 18:55:51 +0100 Subject: refactor: improve even more --- src/position_stack.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/position_stack.h') diff --git a/src/position_stack.h b/src/position_stack.h index 83fb98c..674da23 100644 --- a/src/position_stack.h +++ b/src/position_stack.h @@ -1,23 +1,19 @@ #ifndef POSITION_STACK_H #define POSITION_STACK_H +#include "position.h" + #define STACK_ERR_OVERFLOW 0xFFF01 #define STACK_ERR_UNDERFLOW 0xFFF02 -typedef struct Position -{ - int x; - int y; -} Position; - typedef struct PositionStack { - int capacity; + unsigned int capacity; int top; Position *items; } PositionStack; -PositionStack *pos_stack_create(int capacity); +PositionStack *pos_stack_create(unsigned int capacity); void pos_stack_destroy(PositionStack *pos_stack); -- cgit v1.2.3-18-g5258