Codechange: clean up C-string support from settings

This commit is contained in:
rubidium42
2021-04-28 17:38:02 +02:00
committed by rubidium42
parent a032714dc4
commit 0f062b3882
6 changed files with 5 additions and 79 deletions

View File

@@ -585,7 +585,6 @@ static inline uint SlCalcConvMemLen(VarType conv)
switch (length << 4) {
case SLE_VAR_STRB:
case SLE_VAR_STRBQ:
case SLE_VAR_STR:
case SLE_VAR_STRQ:
return SlReadArrayLength();
@@ -881,7 +880,6 @@ static inline size_t SlCalcStringLen(const void *ptr, size_t length, VarType con
len = SIZE_MAX;
break;
case SLE_VAR_STRB:
case SLE_VAR_STRBQ:
str = (const char *)ptr;
len = length;
break;
@@ -920,7 +918,6 @@ static void SlString(void *ptr, size_t length, VarType conv)
switch (GetVarMemType(conv)) {
default: NOT_REACHED();
case SLE_VAR_STRB:
case SLE_VAR_STRBQ:
len = SlCalcNetStringLen((char *)ptr, length);
break;
case SLE_VAR_STR:
@@ -941,7 +938,6 @@ static void SlString(void *ptr, size_t length, VarType conv)
switch (GetVarMemType(conv)) {
default: NOT_REACHED();
case SLE_VAR_STRB:
case SLE_VAR_STRBQ:
if (len >= length) {
DEBUG(sl, 1, "String length in savegame is bigger than buffer, truncating");
SlCopyBytes(ptr, length);

View File

@@ -446,7 +446,6 @@ enum VarTypes {
SLE_VAR_U64 = 8 << 4,
SLE_VAR_NULL = 9 << 4, ///< useful to write zeros in savegame.
SLE_VAR_STRB = 10 << 4, ///< string (with pre-allocated buffer)
SLE_VAR_STRBQ = 11 << 4, ///< string enclosed in quotes (with pre-allocated buffer)
SLE_VAR_STR = 12 << 4, ///< string pointer
SLE_VAR_STRQ = 13 << 4, ///< string pointer enclosed in quotes
SLE_VAR_NAME = 14 << 4, ///< old custom name to be converted to a char pointer
@@ -470,7 +469,6 @@ enum VarTypes {
SLE_CHAR = SLE_FILE_I8 | SLE_VAR_CHAR,
SLE_STRINGID = SLE_FILE_STRINGID | SLE_VAR_U32,
SLE_STRINGBUF = SLE_FILE_STRING | SLE_VAR_STRB,
SLE_STRINGBQUOTE = SLE_FILE_STRING | SLE_VAR_STRBQ,
SLE_STRING = SLE_FILE_STRING | SLE_VAR_STR,
SLE_STRINGQUOTE = SLE_FILE_STRING | SLE_VAR_STRQ,
SLE_NAME = SLE_FILE_STRINGID | SLE_VAR_NAME,
@@ -479,7 +477,6 @@ enum VarTypes {
SLE_UINT = SLE_UINT32,
SLE_INT = SLE_INT32,
SLE_STRB = SLE_STRINGBUF,
SLE_STRBQ = SLE_STRINGBQUOTE,
SLE_STR = SLE_STRING,
SLE_STRQ = SLE_STRINGQUOTE,