aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan3/literal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/alan3/literal.cpp')
-rw-r--r--engines/glk/alan3/literal.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/engines/glk/alan3/literal.cpp b/engines/glk/alan3/literal.cpp
index ad49aa8ed5..6040074c78 100644
--- a/engines/glk/alan3/literal.cpp
+++ b/engines/glk/alan3/literal.cpp
@@ -40,40 +40,41 @@ LiteralEntry *literals = literalTable;
/*======================================================================*/
int instanceFromLiteral(int literalIndex) {
- return literalIndex + header->instanceMax;
+ return literalIndex + header->instanceMax;
}
/*----------------------------------------------------------------------*/
void createIntegerLiteral(int integerValue) {
- litCount++;
- literals[litCount]._class = header->integerClassId;
- literals[litCount].type = NUMERIC_LITERAL;
- literals[litCount].value = integerValue;
+ litCount++;
+ literals[litCount]._class = header->integerClassId;
+ literals[litCount].type = NUMERIC_LITERAL;
+ literals[litCount].value = integerValue;
}
/*----------------------------------------------------------------------*/
void createStringLiteral(char *unquotedString) {
- litCount++;
- literals[litCount]._class = header->stringClassId;
- literals[litCount].type = STRING_LITERAL;
- literals[litCount].value = toAptr(strdup(unquotedString));
+ litCount++;
+ literals[litCount]._class = header->stringClassId;
+ literals[litCount].type = STRING_LITERAL;
+ literals[litCount].value = toAptr(strdup(unquotedString));
}
/*----------------------------------------------------------------------*/
void freeLiterals() {
- int i;
+ int i;
- for (i = 0; i <= litCount; i++)
- if (literals[i].type == STRING_LITERAL && literals[i].value != 0) {
- deallocate((void *)fromAptr(literals[i].value));
- }
- litCount = 0;}
+ for (i = 0; i <= litCount; i++)
+ if (literals[i].type == STRING_LITERAL && literals[i].value != 0) {
+ deallocate((void *)fromAptr(literals[i].value));
+ }
+ litCount = 0;
+}
/*======================================================================*/
int literalFromInstance(int instance) {
- return instance - header->instanceMax;
+ return instance - header->instanceMax;
}
} // End of namespace Alan3