Codechange: Use std::string for most of the user-settable custom names.
This commit is contained in:
@@ -793,7 +793,7 @@ void WriteValue(void *ptr, VarType conv, int64 val)
|
||||
case SLE_VAR_U32: *(uint32*)ptr = val; break;
|
||||
case SLE_VAR_I64: *(int64 *)ptr = val; break;
|
||||
case SLE_VAR_U64: *(uint64*)ptr = val; break;
|
||||
case SLE_VAR_NAME: *(char**)ptr = CopyFromOldName(val); break;
|
||||
case SLE_VAR_NAME: *reinterpret_cast<std::string *>(ptr) = CopyFromOldName(val); break;
|
||||
case SLE_VAR_NULL: break;
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
@@ -1515,6 +1515,8 @@ static bool IsVariableSizeRight(const SaveLoad *sld)
|
||||
case SLE_VAR_I64:
|
||||
case SLE_VAR_U64:
|
||||
return sld->size == sizeof(int64);
|
||||
case SLE_VAR_NAME:
|
||||
return sld->size == sizeof(std::string);
|
||||
default:
|
||||
return sld->size == sizeof(void *);
|
||||
}
|
||||
|
Reference in New Issue
Block a user