(svn r13019) -Fix [FS#1997]: silence some more MSVC x64 warnings (michi_cc)

This commit is contained in:
glx 2008-05-08 20:05:32 +00:00
parent ba853fdb0b
commit 0b37b81956
5 changed files with 11 additions and 11 deletions

View File

@ -411,7 +411,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
uint16 click_scroll_pos = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? w->vscroll.pos : w->vscroll2.pos;
uint16 click_scroll_cap = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? w->vscroll.cap : w->vscroll2.cap;
byte click_side = e->we.click.widget == RVW_WIDGET_LEFT_MATRIX ? 0 : 1;
uint16 engine_count = WP(w, replaceveh_d).list[click_side].size();
size_t engine_count = WP(w, replaceveh_d).list[click_side].size();
if (i < click_scroll_cap) {
i += click_scroll_pos;

View File

@ -1034,7 +1034,7 @@ static void BuildVehicleClickEvent(Window *w, WindowEvent *e)
case BUILD_VEHICLE_WIDGET_LIST: {
uint i = (e->we.click.pt.y - w->widget[BUILD_VEHICLE_WIDGET_LIST].top) / GetVehicleListHeight(bv->vehicle_type) + w->vscroll.pos;
uint num_items = bv->eng_list.size();
size_t num_items = bv->eng_list.size();
bv->sel_engine = (i < num_items) ? bv->eng_list[i] : INVALID_ENGINE;
w->SetDirty();
break;

View File

@ -1029,7 +1029,7 @@ lzo_uint do_compress ( const lzo_byte *in , lzo_uint in_len,
{
register const lzo_byte *m_pos;
lzo_moff_t m_off;
lzo_uint m_len;
lzo_ptrdiff_t m_len;
lzo_uint dindex;
DINDEX1(dindex,ip);

View File

@ -531,7 +531,7 @@ static void SlSaveLoadConv(void *ptr, VarType conv)
static inline size_t SlCalcNetStringLen(const char *ptr, size_t length)
{
if (ptr == NULL) return 0;
return minu(strlen(ptr), length - 1);
return min(strlen(ptr), length - 1);
}
/** Calculate the gross length of the string that it
@ -911,7 +911,7 @@ void SlAutolength(AutolengthProc *proc, void *arg)
static void SlLoadChunk(const ChunkHandler *ch)
{
byte m = SlReadByte();
size_t len;
uint32 len;
uint32 endoffs;
_sl.block_mode = m;
@ -1204,9 +1204,9 @@ static uint ReadZlib()
_z.avail_out = 4096;
do {
/* read more bytes from the file?*/
/* read more bytes from the file? */
if (_z.avail_in == 0) {
_z.avail_in = fread(_z.next_in = _sl.buf + 4096, 1, 4096, _sl.fh);
_z.avail_in = (uint)fread(_z.next_in = _sl.buf + 4096, 1, 4096, _sl.fh);
}
/* inflate the data */

View File

@ -1090,7 +1090,7 @@ bool InsertTextBufferClipboard(Textbuf *tb)
const char *ptr;
WChar c;
uint16 width, length;
size_t width, length;
if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
OpenClipboard(NULL);
@ -1123,7 +1123,7 @@ bool InsertTextBufferClipboard(Textbuf *tb)
if (!IsPrintable(c)) break;
size_t len = Utf8CharLen(c);
if (tb->length + length >= tb->maxlength - (uint16)len) break;
if (tb->length + length >= tb->maxlength - len) break;
byte charwidth = GetCharacterWidth(FS_NORMAL, c);
if (tb->maxwidth != 0 && width + tb->width + charwidth > tb->maxwidth) break;
@ -1253,7 +1253,7 @@ const TCHAR *OTTD2FS(const char *name)
* @return pointer to utf8_buf. If conversion fails the string is of zero-length */
char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen)
{
int len = WideCharToMultiByte(CP_UTF8, 0, name, -1, utf8_buf, buflen, NULL, NULL);
int len = WideCharToMultiByte(CP_UTF8, 0, name, -1, utf8_buf, (int)buflen, NULL, NULL);
if (len == 0) {
DEBUG(misc, 0, "[utf8] W2M error converting wide-string. Errno %d", GetLastError());
utf8_buf[0] = '\0';
@ -1272,7 +1272,7 @@ char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen)
* @return pointer to utf16_buf. If conversion fails the string is of zero-length */
wchar_t *convert_to_fs(const char *name, wchar_t *utf16_buf, size_t buflen)
{
int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, utf16_buf, buflen);
int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, utf16_buf, (int)buflen);
if (len == 0) {
DEBUG(misc, 0, "[utf8] M2W error converting '%s'. Errno %d", name, GetLastError());
utf16_buf[0] = '\0';