1
1
forked from 0ad/0ad

Fixed some integer type conversion warnings.

This was SVN commit r6130.
This commit is contained in:
Ykkrosh 2008-06-28 01:09:45 +00:00
parent 6b51050f96
commit 504ec69508
5 changed files with 7 additions and 7 deletions

View File

@ -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));

View File

@ -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)

View File

@ -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.

View File

@ -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)

View File

@ -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);