From 8c41443935e0dc124436caf1537868e9b633d5b4 Mon Sep 17 00:00:00 2001 From: AnnaSnoeijs Date: Wed, 25 Jun 2025 11:26:06 +0200 Subject: [PATCH] Moved top() and bottom() to macros.h --- logic.c | 9 +-------- macros.h | 3 +++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/logic.c b/logic.c index 47ac14a..1bd09c3 100644 --- a/logic.c +++ b/logic.c @@ -17,14 +17,7 @@ * along with this program. If not, see . */ #include "logic.h" - -static int top( const int a, const int b ){ - return a < b ? b : a; -} - -static int bottom( const int a, const int b ){ - return a < b ? a : b; -} +#include "macros.h" static int heightMask( const int a ){ return ( 1 << a ) - 1; diff --git a/macros.h b/macros.h index a364109..0326c6c 100644 --- a/macros.h +++ b/macros.h @@ -1,5 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #pragma once +#define top( a, b ) ( a < b ? b : a ) +#define bottom( a, b ) ( a < b ? a : b ) + #define XSTR(s) STR(s) #define STR(s) #s