summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid McMackins II <contact@mcmackins.org>2017-05-13 13:26:07 -0500
committerDavid McMackins II <contact@mcmackins.org>2017-05-13 13:26:07 -0500
commit362a4ef72833f87b889fd9699c178ba5f4f58998 (patch)
tree51817ac6264266d9874c8588166822351e27db33
parentb2c5baaa0a3803db286bd7fbb8e20f2057c95ac1 (diff)
Change storage to int from char for CPU speed0.3.0
-rw-r--r--pfxtree.c6
-rw-r--r--pfxtree.h6
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);
/**