From 362a4ef72833f87b889fd9699c178ba5f4f58998 Mon Sep 17 00:00:00 2001 From: David McMackins II Date: Sat, 13 May 2017 13:26:07 -0500 Subject: Change storage to int from char for CPU speed --- pfxtree.c | 6 +++--- pfxtree.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pfxtree.c b/pfxtree.c index a1c1d8f..cffce7f 100644 --- a/pfxtree.c +++ b/pfxtree.c @@ -76,7 +76,7 @@ get_last_child(const PrefixTree *self) } static PrefixTree * -get_child_by_ch(const PrefixTree *self, const char ch) +get_child_by_ch(const PrefixTree *self, const int ch) { PrefixTree *child; pt_child_foreach(self, child) @@ -89,7 +89,7 @@ get_child_by_ch(const PrefixTree *self, const char ch) } static int -add(PrefixTree *self, const char *word, union _pt_data data, char type) +add(PrefixTree *self, const char *word, union _pt_data data, int type) { int rc = 0; PrefixTree *node = self; @@ -218,7 +218,7 @@ pt_data_p(const PrefixTree *self) return self->data.p; } -char +int pt_data_type(const PrefixTree *self) { return self->type; diff --git a/pfxtree.h b/pfxtree.h index e691fe4..b4b6851 100644 --- a/pfxtree.h +++ b/pfxtree.h @@ -58,8 +58,8 @@ union _pt_data */ typedef struct _pt_trie { - char ch; - char type; + int ch; + int type; union _pt_data data; struct _pt_trie *parent; @@ -140,7 +140,7 @@ pt_data_p(const PrefixTree *self); * @param self The node whose type is to be examined. * @return 'i' if integer, 'p' if pointer, or '\0' if no data. */ -char +int pt_data_type(const PrefixTree *self); /** -- cgit v1.2.3