|
@@ -13,7 +13,7 @@
|
|
|
static char tokenBuffer[TOKEN_BUFFER_LENGTH];
|
|
|
static int writeIndex = 0;
|
|
|
static int readIndex = 0;
|
|
|
-static int line = 1;
|
|
|
+static int16 line = 1;
|
|
|
static FILE* file = NULL;
|
|
|
static char error[ERROR_LENGTH] = {'\0'};
|
|
|
|
|
@@ -35,7 +35,7 @@ static bool tAdd(const void* data, int length) {
|
|
|
|
|
|
static bool tAddToken(Token token) {
|
|
|
unsigned char c = token;
|
|
|
- return tAdd(&c, 1) && tAdd(&line, sizeof(int));
|
|
|
+ return tAdd(&c, 1) && tAdd(&line, sizeof(line));
|
|
|
}
|
|
|
|
|
|
static bool tReadTokens(void* dest, int length) {
|
|
@@ -190,6 +190,13 @@ bool tReadInt(int* i) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+bool tReadInt16(int16* i) {
|
|
|
+ if(tReadTokens(i, sizeof(int16))) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
bool tReadFloat(float* f) {
|
|
|
if(tReadTokens(f, sizeof(float))) {
|
|
|
return true;
|