Changeset - r16492:d477cc0703a4
[Not reviewed]
master
0 2 0
rubidium - 14 years ago 2010-11-17 19:43:15
rubidium@openttd.org
(svn r21228) -Fix: some MSVC 64 bits warnings
2 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/newgrf_text.cpp
Show inline comments
 
@@ -135,7 +135,7 @@ public:
 
	 * @param text   The text to store in the new GRFText.
 
	 * @param len    The length of the text.
 
	 */
 
	static GRFText *New(byte langid, const char *text, int len)
 
	static GRFText *New(byte langid, const char *text, size_t len)
 
	{
 
		return new (len) GRFText(langid, text, len);
 
	}
 
@@ -175,7 +175,7 @@ private:
 
	 * @param text_   The text to store in this GRFText.
 
	 * @param len_    The length of the text to store.
 
	 */
 
	GRFText(byte langid_, const char *text_, int len_) : next(NULL), len(len_), langid(langid_)
 
	GRFText(byte langid_, const char *text_, size_t len_) : next(NULL), len(len_), langid(langid_)
 
	{
 
		/* We need to use memcpy instead of strcpy due to
 
		 * the possibility of "choice lists" and therefor
 
@@ -196,7 +196,7 @@ private:
 

	
 
public:
 
	GRFText *next; ///< The next GRFText in this chain.
 
	int len;       ///< The length of the stored string, used for copying.
 
	size_t len;    ///< The length of the stored string, used for copying.
 
	byte langid;   ///< The language associated with this GRFText.
 
	char text[];   ///< The actual (translated) text.
 
};
 
@@ -295,7 +295,7 @@ struct UnmappedChoiceList : ZeroedMemory
 
		if (lm == NULL && this->type != SCC_PLURAL_LIST) {
 
			NOT_REACHED();
 
			/* In case there is no mapping, just ignore everything but the default. */
 
			int len = strlen(this->strings[0]);
 
			size_t len = strlen(this->strings[0]);
 
			memcpy(d, this->strings[0], len);
 
			return d + len;
 
		}
 
@@ -327,7 +327,7 @@ struct UnmappedChoiceList : ZeroedMemory
 
				*d++ = i;
 

	
 
				/* "<LENn>" */
 
				int len = strlen(str);
 
				size_t len = strlen(str);
 
				*d++ = GB(len, 8, 8);
 
				*d++ = GB(len, 0, 8);
 

	
 
@@ -338,7 +338,7 @@ struct UnmappedChoiceList : ZeroedMemory
 
			}
 

	
 
			/* "<STRINGDEFAULT>" */
 
			int len = strlen(this->strings[0]);
 
			size_t len = strlen(this->strings[0]);
 
			memcpy(d, this->strings[0], len);
 
			d += len;
 
			*d++ = '\0';
 
@@ -363,16 +363,16 @@ struct UnmappedChoiceList : ZeroedMemory
 
			for (int i = 0; i < count; i++) {
 
				int idx = (this->type == SCC_GENDER_LIST ? lm->GetReverseMapping(i, true) : i + 1);
 
				const char *str = this->strings[this->strings.Contains(idx) ? idx : 0];
 
				int len = strlen(str) + 1;
 
				size_t len = strlen(str) + 1;
 
				if (len > 0xFF) grfmsg(1, "choice list string is too long");
 
				*d++ = len;
 
				*d++ = GB(len, 0, 8);
 
			}
 

	
 
			/* "<STRINGs>" */
 
			for (int i = 0; i < count; i++) {
 
				int idx = (this->type == SCC_GENDER_LIST ? lm->GetReverseMapping(i, true) : i + 1);
 
				const char *str = this->strings[this->strings.Contains(idx) ? idx : 0];
 
				int len = strlen(str);
 
				size_t len = strlen(str);
 
				memcpy(d, str, len);
 
				d += len;
 
				*d++ = '\0';
src/settings_gui.cpp
Show inline comments
 
@@ -317,7 +317,7 @@ struct GameOptionsWindow : Window {
 
				/* Sort language names */
 
				LangList langs;
 
				int current_lang = 0;
 
				for (size_t i = 0; i < _languages.Length(); i++) {
 
				for (int i = 0; i < (int)_languages.Length(); i++) {
 
					if (&_languages[i] == _current_language) current_lang = i;
 
					langs[SPECSTR_LANGUAGE_START + i] = i;
 
				}
0 comments (0 inline, 0 general)