summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-20 12:09:32 +0000
committertruelight <truelight@openttd.org>2006-08-20 12:09:32 +0000
commit5fb6c9e1cc073ad96d62efc423e87d79d38d435a (patch)
tree8ea819b5d596c612f5f825b3e4881663c4af5722
parentb83703b215bec2b7a6147a6b4a7ec60832da5230 (diff)
downloadopenttd-5fb6c9e1cc073ad96d62efc423e87d79d38d435a.tar.xz
(svn r5974) -Codechange: added casts all around the place to make Windows 64bit happy (michi_cc)
-rw-r--r--bmp.c2
-rw-r--r--console.c2
-rw-r--r--misc.c2
-rw-r--r--namegen.c6
-rw-r--r--network_server.c2
-rw-r--r--newgrf.c2
-rw-r--r--oldloader.c4
-rw-r--r--players.c2
-rw-r--r--spritecache.c2
-rw-r--r--strings.c2
-rw-r--r--win32.c2
11 files changed, 14 insertions, 14 deletions
diff --git a/bmp.c b/bmp.c
index ee5382123..c2bd91270 100644
--- a/bmp.c
+++ b/bmp.c
@@ -15,7 +15,7 @@ void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file) {
static inline void AdvanceBuffer(BmpBuffer *buffer)
{
- buffer->read = fread(buffer->data, 1, BMP_BUFFER_SIZE, buffer->file);
+ buffer->read = (int)fread(buffer->data, 1, BMP_BUFFER_SIZE, buffer->file);
buffer->pos = 0;
}
diff --git a/console.c b/console.c
index 6dbbe803d..5c7eadf93 100644
--- a/console.c
+++ b/console.c
@@ -680,7 +680,7 @@ IConsoleAlias *IConsoleAliasGet(const char *name)
/** copy in an argument into the aliasstream */
static inline int IConsoleCopyInParams(char *dst, const char *src, uint bufpos)
{
- int len = min(ICON_MAX_STREAMSIZE - bufpos, strlen(src));
+ int len = min(ICON_MAX_STREAMSIZE - bufpos, (int)strlen(src));
strncpy(dst, src, len);
return len;
diff --git a/misc.c b/misc.c
index c74b68055..e18db9bb1 100644
--- a/misc.c
+++ b/misc.c
@@ -253,7 +253,7 @@ static void Save_NAME(void)
for (i = 0; i != lengthof(_name_array); ++i) {
if (_name_array[i][0] != '\0') {
SlSetArrayIndex(i);
- SlArray(_name_array[i], strlen(_name_array[i]), SLE_UINT8);
+ SlArray(_name_array[i], (uint)strlen(_name_array[i]), SLE_UINT8);
}
}
}
diff --git a/namegen.c b/namegen.c
index 44e347452..92c471d1c 100644
--- a/namegen.c
+++ b/namegen.c
@@ -475,7 +475,7 @@ static byte MakeCzechTownName(char *buf, uint32 seed)
if (do_prefix) {
CzechPattern pattern = name_czech_adj[prefix].pattern;
- int endpos;
+ size_t endpos;
strcat(buf, name_czech_adj[prefix].name);
endpos = strlen(buf) - 1;
@@ -496,7 +496,7 @@ static byte MakeCzechTownName(char *buf, uint32 seed)
if (postfix < lengthof(name_czech_subst_postfix)) {
const char *poststr = name_czech_subst_postfix[postfix];
const char *endstr = name_czech_subst_ending[ending].name;
- int postlen, endlen;
+ size_t postlen, endlen;
postlen = strlen(poststr);
endlen = strlen(endstr);
@@ -507,7 +507,7 @@ static byte MakeCzechTownName(char *buf, uint32 seed)
(poststr[1] != 'v' || poststr[1] != endstr[1]) &&
poststr[2] != endstr[1])
) {
- uint buflen;
+ size_t buflen;
strcat(buf, poststr);
buflen = strlen(buf);
diff --git a/network_server.c b/network_server.c
index 9a3c64930..b4e05f940 100644
--- a/network_server.c
+++ b/network_server.c
@@ -313,7 +313,7 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP)
for (i = 0; i < sent_packets; i++) {
Packet *p = NetworkSend_Init(PACKET_SERVER_MAP);
NetworkSend_uint8(p, MAP_PACKET_NORMAL);
- res = fread(p->buffer + p->size, 1, SEND_MTU - p->size, file_pointer);
+ res = (int)fread(p->buffer + p->size, 1, SEND_MTU - p->size, file_pointer);
if (ferror(file_pointer)) {
error("Error reading temporary network savegame!");
}
diff --git a/newgrf.c b/newgrf.c
index 5d557f216..27a31e608 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -1876,7 +1876,7 @@ static void FeatureNewName(byte *buf, int len)
}
}
name += ofs;
- len -= ofs;
+ len -= (int)ofs;
}
}
diff --git a/oldloader.c b/oldloader.c
index 6bdea4f09..ce3a78d1d 100644
--- a/oldloader.c
+++ b/oldloader.c
@@ -120,7 +120,7 @@ static byte ReadByteFromFile(LoadgameState *ls)
and just return a byte per time */
if (ls->buffer_cur >= ls->buffer_count) {
/* Read some new bytes from the file */
- int count = fread(ls->buffer, 1, BUFFER_SIZE, ls->file);
+ int count = (int)fread(ls->buffer, 1, BUFFER_SIZE, ls->file);
/* We tried to read, but there is nothing in the file anymore.. */
if (count == 0) {
@@ -376,7 +376,7 @@ static void FixOldVehicles(void)
* - OCL_CHUNK: load an other proc to load a part of the savegame, 'amount' times
* - OCL_ASSERT: to check if we are really at the place we expect to be.. because old savegames are too binary to be sure ;)
*/
-#define OCL_SVAR(type, base, offset) { type, 1, NULL, offsetof(base, offset), NULL }
+#define OCL_SVAR(type, base, offset) { type, 1, NULL, (uint)offsetof(base, offset), NULL }
#define OCL_VAR(type, amount, pointer) { type, amount, pointer, 0, NULL }
#define OCL_END() { OC_END, 0, NULL, 0, NULL }
#define OCL_NULL(amount) { OC_NULL, amount, NULL, 0, NULL }
diff --git a/players.c b/players.c
index 8e96393da..d27477c4d 100644
--- a/players.c
+++ b/players.c
@@ -1065,7 +1065,7 @@ void SaveToHighScore(void)
for (i = 0; i < LAST_HS_ITEM; i++) { // don't save network highscores
for (hs = _highscore_table[i]; hs != endof(_highscore_table[i]); hs++) {
/* First character is a command character, so strlen will fail on that */
- byte length = min(sizeof(hs->company), (hs->company[0] == '\0') ? 0 : strlen(&hs->company[1]) + 1);
+ byte length = min(sizeof(hs->company), (hs->company[0] == '\0') ? 0 : (int)strlen(&hs->company[1]) + 1);
fwrite(&length, sizeof(length), 1, fp); // write away string length
fwrite(hs->company, length, 1, fp);
diff --git a/spritecache.c b/spritecache.c
index 8e99a34f4..9fe087f99 100644
--- a/spritecache.c
+++ b/spritecache.c
@@ -192,7 +192,7 @@ static inline MemBlock* NextBlock(MemBlock* block)
static uint32 GetSpriteCacheUsage(void)
{
- size_t tot_size = 0;
+ uint32 tot_size = 0;
MemBlock* s;
for (s = _spritecache_ptr; s->size != 0; s = NextBlock(s))
diff --git a/strings.c b/strings.c
index 89c2b4a1c..6945d9443 100644
--- a/strings.c
+++ b/strings.c
@@ -1229,7 +1229,7 @@ void InitializeLanguagePacks(void)
// go through the language files and make sure that they are valid.
for (i = m = 0; i != n; i++) {
- int j;
+ size_t j;
char *s = str_fmt("%s%s", _path.lang_dir, files[i]);
in = fopen(s, "rb");
diff --git a/win32.c b/win32.c
index 099cc8f98..48c50027c 100644
--- a/win32.c
+++ b/win32.c
@@ -265,7 +265,7 @@ static const char *SubmitCrashReport(HWND wnd, void *msg, size_t msglen, const c
http = _wininet.HttpOpenRequest(conn, "POST", buff, NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE , 0);
if (http == NULL) { err = "httpopenrequest failed"; goto error3; }
- if (!_wininet.HttpSendRequest(http, "Content-type: application/binary", -1, msg, msglen)) { err = "httpsendrequest failed"; goto error4; }
+ if (!_wininet.HttpSendRequest(http, "Content-type: application/binary", -1, msg, (DWORD)msglen)) { err = "httpsendrequest failed"; goto error4; }
len = sizeof(code);
if (!_wininet.HttpQueryInfo(http, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &code, &len, 0)) { err = "httpqueryinfo failed"; goto error4; }