Changeset - r9768:3ae775ddbb05
[Not reviewed]
master
0 1 0
glx - 16 years ago 2008-07-31 22:55:12
glx@openttd.org
(svn r13904) -Fix (r13715): 'cast from/to pointer to/from integer of different size' warnings
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/strings.cpp
Show inline comments
 
@@ -179,25 +179,25 @@ char *InlineString(char *buf, StringID s
 
	buf += Utf8Encode(buf, SCC_STRING_ID);
 
	buf += Utf8Encode(buf, string);
 
	return buf;
 
}
 

	
 

	
 
/** This function is used to "bind" a C string to a OpenTTD dparam slot.
 
 * @param n slot of the string
 
 * @param str string to bind
 
 */
 
void SetDParamStr(uint n, const char *str)
 
{
 
	SetDParam(n, (uint64)str);
 
	SetDParam(n, (uint64)(size_t)str);
 
}
 

	
 
void InjectDParam(int amount)
 
{
 
	memmove(_decode_parameters + amount, _decode_parameters, sizeof(_decode_parameters) - amount * sizeof(uint64));
 
}
 

	
 
// TODO
 
static char *FormatCommaNumber(char *buff, int64 number, const char *last)
 
{
 
	uint64 divisor = 10000000000000000000ULL;
 
	uint64 quot;
 
@@ -288,25 +288,25 @@ static char *FormatMonthAndYear(char *bu
 

	
 
static char *FormatTinyDate(char *buff, Date date, const char* last)
 
{
 
	YearMonthDay ymd;
 
	ConvertDateToYMD(date, &ymd);
 

	
 
	char day[3];
 
	char month[3];
 
	/* We want to zero-pad the days and months */
 
	snprintf(day,   lengthof(day),   "%02i", ymd.day);
 
	snprintf(month, lengthof(month), "%02i", ymd.month + 1);
 

	
 
	int64 args[3] = { (int64)day, (int64)month, ymd.year };
 
	int64 args[3] = { (int64)(size_t)day, (int64)(size_t)month, ymd.year };
 
	return FormatString(buff, GetStringPtr(STR_DATE_TINY), args, 0, last);
 
}
 

	
 
static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money number, bool compact, const char* last)
 
{
 
	/* We are going to make number absolute for printing, so
 
	 * keep this piece of data as we need it later on */
 
	bool negative = number < 0;
 
	const char *multiplier = "";
 
	char buf[40];
 
	char *p;
 
	int j;
 
@@ -547,25 +547,25 @@ static char* FormatString(char* buff, co
 
				if (buff + Utf8CharLen(SCC_SETXY) + 2 < last) {
 
					buff += Utf8Encode(buff, SCC_SETXY);
 
					*buff++ = *str++;
 
					*buff++ = *str++;
 
				}
 
				break;
 

	
 
			case SCC_STRING_ID: // {STRINL}
 
				buff = GetStringWithArgs(buff, Utf8Consume(&str), argv, last);
 
				break;
 

	
 
			case SCC_RAW_STRING_POINTER: { // {RAW_STRING}
 
				const char *str = (const char*)GetInt64(&argv);
 
				const char *str = (const char*)(size_t)GetInt64(&argv);
 
				buff = FormatString(buff, str, argv, casei, last);
 
				break;
 
			}
 

	
 
			case SCC_DATE_LONG: // {DATE_LONG}
 
				buff = FormatYmdString(buff, GetInt32(&argv), last);
 
				break;
 

	
 
			case SCC_DATE_SHORT: // {DATE_SHORT}
 
				buff = FormatMonthAndYear(buff, GetInt32(&argv), last);
 
				break;
 

	
0 comments (0 inline, 0 general)