From 504ec69508d9d7e15892193fccd6ab74a95482a3 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sat, 28 Jun 2008 01:09:45 +0000 Subject: [PATCH] Fixed some integer type conversion warnings. This was SVN commit r6130. --- source/lib/file/archive/archive_zip.cpp | 2 +- source/lib/res/graphics/ogl_tex.cpp | 2 +- source/lib/tex/tex_bmp.cpp | 2 +- source/lib/tex/tex_dds.cpp | 2 +- source/lib/tex/tex_jpg.cpp | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/lib/file/archive/archive_zip.cpp b/source/lib/file/archive/archive_zip.cpp index 5d6fe6bff2..9d19bc557b 100644 --- a/source/lib/file/archive/archive_zip.cpp +++ b/source/lib/file/archive/archive_zip.cpp @@ -523,7 +523,7 @@ public: ECDR* ecdr = (ECDR*)pool_alloc(&m_cdfhPool, sizeof(ECDR)); if(!ecdr) throw std::bad_alloc(); - const size_t cd_ofs = m_fileSize; + const off_t cd_ofs = m_fileSize; ecdr->Init(m_numEntries, cd_ofs, cd_size); m_unalignedWriter->Append(m_cdfhPool.da.base, cd_size+sizeof(ECDR)); diff --git a/source/lib/res/graphics/ogl_tex.cpp b/source/lib/res/graphics/ogl_tex.cpp index cea606cd0d..d0a34c0088 100644 --- a/source/lib/res/graphics/ogl_tex.cpp +++ b/source/lib/res/graphics/ogl_tex.cpp @@ -938,7 +938,7 @@ LibError ogl_tex_bind(Handle ht, size_t unit) { // note: there are many call sites of glActiveTextureARB, so caching // those and ignoring redundant sets isn't feasible. - pglActiveTextureARB(GL_TEXTURE0+unit); + pglActiveTextureARB((int)(GL_TEXTURE0+unit)); // special case: disable texturing if(ht == 0) diff --git a/source/lib/tex/tex_bmp.cpp b/source/lib/tex/tex_bmp.cpp index 85c6b14d3f..244d050b3b 100644 --- a/source/lib/tex/tex_bmp.cpp +++ b/source/lib/tex/tex_bmp.cpp @@ -115,7 +115,7 @@ static LibError bmp_encode(Tex* RESTRICT t, DynArray* RESTRICT da) const size_t hdr_size = sizeof(BmpHeader); // needed for BITMAPFILEHEADER const size_t img_size = tex_img_size(t); const size_t file_size = hdr_size + img_size; - const long h = (t->flags & TEX_TOP_DOWN)? -(long)t->h : t->h; + const long h = (t->flags & TEX_TOP_DOWN)? -(long)t->h : (long)t->h; int transforms = t->flags; transforms &= ~TEX_ORIENTATION; // no flip needed - we can set top-down bit. diff --git a/source/lib/tex/tex_dds.cpp b/source/lib/tex/tex_dds.cpp index 325b400741..9bf140faf3 100644 --- a/source/lib/tex/tex_dds.cpp +++ b/source/lib/tex/tex_dds.cpp @@ -440,7 +440,7 @@ static LibError decode_pf(const DDPIXELFORMAT* pf, size_t& bpp, size_t& flags) WARN_RETURN(ERR::TEX_FMT_INVALID); } - RETURN_ERR(tex_validate_plain_format(bpp, flags)); + RETURN_ERR(tex_validate_plain_format(bpp, (int)flags)); } // .. compressed else if(pf_flags & DDPF_FOURCC) diff --git a/source/lib/tex/tex_jpg.cpp b/source/lib/tex/tex_jpg.cpp index b56a7c10b1..cb6471f5cf 100644 --- a/source/lib/tex/tex_jpg.cpp +++ b/source/lib/tex/tex_jpg.cpp @@ -490,9 +490,9 @@ static LibError jpg_encode_impl(Tex* t, jpeg_compress_struct* cinfo, DynArray* d // describe image format // required: - cinfo->image_width = t->w; - cinfo->image_height = t->h; - cinfo->input_components = t->bpp / 8; + cinfo->image_width = (JDIMENSION)t->w; + cinfo->image_height = (JDIMENSION)t->h; + cinfo->input_components = (int)t->bpp / 8; cinfo->in_color_space = (t->bpp == 8)? JCS_GRAYSCALE : JCS_RGB; // defaults depend on cinfo->in_color_space already having been set! jpeg_set_defaults(cinfo);