mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 17:19:09 +00:00
(svn r5871) -Feature: Add a possibility to handle pointer strings without a buffer from the configuration file. Handy for variables that will never be changed during runtime
This commit is contained in:
@@ -510,11 +510,13 @@ static inline size_t SlCalcStringLen(const char *ptr, uint length)
|
||||
* Save/Load a string.
|
||||
* @param ptr the string being manipulated
|
||||
* @param the length of the string (full length)
|
||||
* @param conv must be SLE_FILE_STRING */
|
||||
* @param conv must be SLE_FILE_STRING
|
||||
* XXX - only works with global strings of a pre-allocated buffer */
|
||||
static void SlString(void *ptr, uint length, VarType conv)
|
||||
{
|
||||
uint len;
|
||||
assert(GetVarFileType(conv) == SLE_FILE_STRING);
|
||||
assert(GetVarMemType(conv) == SLE_VAR_STRB || GetVarMemType(conv) == SLE_VAR_STRQ);
|
||||
|
||||
if (_sl.save) {
|
||||
len = SlCalcNetStringLen(ptr, length);
|
||||
|
Reference in New Issue
Block a user