summaryrefslogtreecommitdiff
path: root/colm/keyops.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2020-01-08 16:55:45 +0200
committerAdrian Thurston <thurston@colm.net>2020-01-08 16:58:39 +0200
commit1bf8df38ebf912b454c7db1fe2e2a38c91526900 (patch)
treed3d8cb9ea15a03a94f5ed7cae4ddc099ae365952 /colm/keyops.h
parent6c670b0a9851bd5ec3c7a90f20b164be2a54c5b2 (diff)
downloadcolm-1bf8df38ebf912b454c7db1fe2e2a38c91526900.tar.gz
colm: using an unsigned char as alph type in scanner
Switching to unsigned so we can reference chars with the high bit set in the way that is common when discussing utf and unicode: using hex chars. Negative values are really uncomfortable and don't lend themselves to specifying ranges. This change is for the parser and stream/input code only. The collected tree data still uses char, which makes it convenient to extract the data from a top-down or bottom-up load. If we change the tree type we need to cast the pointers all over the loading code. refs #104 refs #97 refs #81
Diffstat (limited to 'colm/keyops.h')
-rw-r--r--colm/keyops.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/colm/keyops.h b/colm/keyops.h
index 094b09e2..ed58db8d 100644
--- a/colm/keyops.h
+++ b/colm/keyops.h
@@ -89,6 +89,7 @@ struct HostType
{
const char *data1;
const char *data2;
+ bool isSigned;
long long minVal;
long long maxVal;
unsigned int size;
@@ -98,8 +99,7 @@ struct HostLang
{
HostType *hostTypes;
int numHostTypes;
- HostType *defaultAlphType;
- bool explicitUnsigned;
+ int defaultHostType;
};
extern HostLang *hostLang;
@@ -113,9 +113,9 @@ struct KeyOps
KeyOps() : alphType(0) {}
Key minKey, maxKey;
- HostType *alphType;
+ const HostType *alphType;
- void setAlphType( HostType *alphType )
+ void setAlphType( const HostType *alphType )
{
this->alphType = alphType;
minKey = (long) alphType->minVal;