Changeset - r1318:7c54e45c2a7b
[Not reviewed]
master
0 1 0
tron - 19 years ago 2005-02-06 14:27:50
tron@openttd.org
(svn r1822) Const correctness
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
strings.c
Show inline comments
 
@@ -124,13 +124,13 @@ static const uint16 _cargo_string_list[N
 
static char *str_cat(char *dst, const char *src)
 
{
 
	while ((*dst++ = *src++) != '\0') {}
 
	return dst - 1;
 
}
 

	
 
static char *GetStringPtr(uint16 string)
 
static const char *GetStringPtr(uint16 string)
 
{
 
	return _langpack_offs[_langtab_start[string >> 11] + (string & 0x7FF)];
 
}
 

	
 
char *GetString(char *buffr, uint16 string)
 
{
 
@@ -449,13 +449,13 @@ static char *DecodeString(char *buff, co
 
				buff = str_cat(buff, _openttd_revision);
 
				break;
 
			case 3: { /* {SHORTCARGO} */
 
				// Short description of cargotypes. Layout:
 
				// 8-bit = cargo type
 
				// 16-bit = cargo count
 
				char *s;
 
				const char *s;
 
				uint16 cargo_str = _cargo_string_list[_opt.landscape][(byte)GetParamInt8()];
 
				uint16 multiplier = (cargo_str == STR_LITERS) ? 1000 : 1;
 
				// liquid type of cargo is multiplied by 100 to get correct amount
 
				buff = FormatCommaNumber(buff, GetParamInt16() * multiplier);
 
				s = GetStringPtr(cargo_str);
 

	
 
@@ -474,13 +474,13 @@ static char *DecodeString(char *buff, co
 

	
 
		case 0x86: // {SKIP}
 
			GetParamInt16();
 
			//assert(0);
 
			break;
 
		case 0x87: { // {VOLUME}
 
			char *s;
 
			const char *s;
 
			buff = FormatCommaNumber(buff, GetParamInt16() * 1000);
 
			memcpy(buff++, " ", 1);
 
			s = GetStringPtr(STR_LITERS);
 
			while (*s) *buff++ = *s++;
 
			break;
 
		}
0 comments (0 inline, 0 general)