aboutsummaryrefslogtreecommitdiff
path: root/src/sp_tree.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-08-21 23:31:48 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-08-21 23:31:48 +0300
commit97ffab0a8472981b927d0f4e81bb72f6ecd69b86 (patch)
treec8a36352d599dc9477a6e647878d5e6191b4e98f /src/sp_tree.c
parentab011165cd440b5535d39febd8118e3e26b64b57 (diff)
downloadkmi-97ffab0a8472981b927d0f4e81bb72f6ecd69b86.tar.gz
kmi-97ffab0a8472981b927d0f4e81bb72f6ecd69b86.zip
add malloc test
Diffstat (limited to 'src/sp_tree.c')
-rw-r--r--src/sp_tree.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sp_tree.c b/src/sp_tree.c
index 5166cc3..0c5b3c4 100644
--- a/src/sp_tree.c
+++ b/src/sp_tree.c
@@ -21,7 +21,7 @@
*
* @param n Node to turn left.
*/
-static void __sp_turn_left(struct sp_node *n)
+static __inline void __sp_turn_left(struct sp_node *n)
{
struct sp_node *l = sp_left(n);
struct sp_node *p = sp_paren(n);
@@ -51,7 +51,7 @@ static void __sp_turn_left(struct sp_node *n)
*
* @param n Node to turn right.
*/
-static void __sp_turn_right(struct sp_node *n)
+static __inline void __sp_turn_right(struct sp_node *n)
{
struct sp_node *r = sp_right(n);
struct sp_node *p = sp_paren(n);
@@ -78,7 +78,7 @@ static void __sp_turn_right(struct sp_node *n)
* @param n Node to calculate balance for.
* @return Balance of node.
*/
-static int_fast16_t __sp_balance(struct sp_node *n)
+static __inline int_fast16_t __sp_balance(struct sp_node *n)
{
int_fast16_t l = 0;
int_fast16_t r = 0;
@@ -98,7 +98,7 @@ static int_fast16_t __sp_balance(struct sp_node *n)
* @param n Node to calculate highest hint for.
* @return Highest hint.
*/
-static int_fast16_t __sp_max_hint(struct sp_node *n)
+static __inline int_fast16_t __sp_max_hint(struct sp_node *n)
{
int_fast16_t l = 0;
int_fast16_t r = 0;
@@ -121,7 +121,7 @@ static int_fast16_t __sp_max_hint(struct sp_node *n)
* @param root Root of tree.
* @param n Node to start balancing operation from.
*/
-static void __sp_update(struct sp_node **root, struct sp_node *n)
+static __inline void __sp_update(struct sp_node **root, struct sp_node *n)
{
while (n) {
int b = __sp_balance(n);
@@ -175,7 +175,7 @@ void sp_insert(struct sp_node **root, struct sp_node *p, struct sp_node *n,
* @param n Node to replace.
* @param r Node to replace with.
*/
-static void __sp_replace_right(struct sp_node *n, struct sp_node *r)
+static __inline void __sp_replace_right(struct sp_node *n, struct sp_node *r)
{
struct sp_node *p = sp_paren(n);
struct sp_node *rp = sp_paren(r);
@@ -212,7 +212,7 @@ static void __sp_replace_right(struct sp_node *n, struct sp_node *r)
* @param n Node to replace.
* @param l Node to replace with.
*/
-static void __sp_replace_left(struct sp_node *n, struct sp_node *l)
+static __inline void __sp_replace_left(struct sp_node *n, struct sp_node *l)
{
struct sp_node *p = sp_paren(n);
struct sp_node *lp = sp_paren(l);