From b3bd068f614a46580ee3e5688dd9cfd40694d75b Mon Sep 17 00:00:00 2001 From: Johnny Richard Date: Mon, 14 Apr 2025 23:22:57 +0200 Subject: Define clang-format and .editorconfig settings Signed-off-by: Johnny Richard --- src/stack.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/stack.c') diff --git a/src/stack.c b/src/stack.c index 5121f6b..c83b429 100644 --- a/src/stack.c +++ b/src/stack.c @@ -14,24 +14,25 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include #include "stack.h" +#include -void stack_push(stack_t *stack, int value) +void +stack_push(stack_t* stack, int value) { - if (stack->size >= stack->capacity) { - perror("stack overflow"); - exit(EXIT_FAILURE); - } - stack->data[stack->size++] = value; + if (stack->size >= stack->capacity) { + perror("stack overflow"); + exit(EXIT_FAILURE); + } + stack->data[stack->size++] = value; } -int stack_pop(stack_t *stack) +int +stack_pop(stack_t* stack) { - if (stack->size <= 0) { - perror("stack_pop: Stack already empty"); - exit(EXIT_FAILURE); - } - return stack->data[--stack->size]; + if (stack->size <= 0) { + perror("stack_pop: Stack already empty"); + exit(EXIT_FAILURE); + } + return stack->data[--stack->size]; } - -- cgit v1.2.3