summaryrefslogtreecommitdiffstats
path: root/o3d/core/cross/texture.cc
diff options
context:
space:
mode:
authorgspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 23:33:17 +0000
committergspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 23:33:17 +0000
commit1b2bfdd574d9c4e21251ec2214e41d8905da4541 (patch)
tree125a1781c38b840effa24926a16f9599c0631281 /o3d/core/cross/texture.cc
parentc7cc3f559ecc96849168432c7d3abcca4eeebb4f (diff)
downloadchromium_src-1b2bfdd574d9c4e21251ec2214e41d8905da4541.zip
chromium_src-1b2bfdd574d9c4e21251ec2214e41d8905da4541.tar.gz
chromium_src-1b2bfdd574d9c4e21251ec2214e41d8905da4541.tar.bz2
This fixes a number of things that are warnings in the Mac compiler.
It fixes at least two real bugs, one in the tar generator, and one in stream_bank.h. Review URL: http://codereview.chromium.org/159168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/core/cross/texture.cc')
-rw-r--r--o3d/core/cross/texture.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/o3d/core/cross/texture.cc b/o3d/core/cross/texture.cc
index 88897c3..0cc784f 100644
--- a/o3d/core/cross/texture.cc
+++ b/o3d/core/cross/texture.cc
@@ -96,8 +96,8 @@ void Texture2D::DrawImage(Bitmap* src_img,
int dst_width, int dst_height, int dest_mip) {
DCHECK(src_img->image_data());
- int mip_width = std::max(1, width() >> dest_mip);
- int mip_height = std::max(1, height() >> dest_mip);
+ unsigned int mip_width = std::max(1, width() >> dest_mip);
+ unsigned int mip_height = std::max(1, height() >> dest_mip);
// Clip source and destination rectangles to
// source and destination bitmaps.
@@ -123,8 +123,10 @@ void Texture2D::DrawImage(Bitmap* src_img,
// the entire bitmap on dest image, just perform memcpy.
if (src_x == 0 && src_y == 0 && dst_x == 0 && dst_y == 0 &&
src_img->width() == mip_width && src_img->height() == mip_height &&
- src_width == src_img->width() && src_height == src_img->height() &&
- dst_width == mip_width && dst_height == mip_height) {
+ static_cast<unsigned int>(src_width) == src_img->width() &&
+ static_cast<unsigned int>(src_height) == src_img->height() &&
+ static_cast<unsigned int>(dst_width) == mip_width &&
+ static_cast<unsigned int>(dst_height) == mip_height) {
void* data = NULL;
if (!Lock(dest_mip, &data))
return;
@@ -248,7 +250,7 @@ void TextureCUBE::DrawImage(Bitmap* src_img,
CubeFace dest_face, int dest_mip) {
DCHECK(src_img->image_data());
- int mip_length = std::max(1, edge_length() >> dest_mip);
+ unsigned int mip_length = std::max(1, edge_length() >> dest_mip);
// Clip source and destination rectangles to
// source and destination bitmaps.
@@ -274,8 +276,10 @@ void TextureCUBE::DrawImage(Bitmap* src_img,
// the entire bitmap on dest image, just perform memcpy.
if (src_x == 0 && src_y == 0 && dst_x == 0 && dst_y == 0 &&
src_img->width() == mip_length && src_img->height() == mip_length &&
- src_width == src_img->width() && src_height == src_img->height() &&
- dst_width == mip_length && dst_height == mip_length) {
+ static_cast<unsigned int>(src_width) == src_img->width() &&
+ static_cast<unsigned int>(src_height) == src_img->height() &&
+ static_cast<unsigned int>(dst_width) == mip_length &&
+ static_cast<unsigned int>(dst_height) == mip_length) {
// get mip data by lock method.
void* data = NULL;
if (!Lock(dest_face, dest_mip, &data))