summaryrefslogtreecommitdiffstats
path: root/o3d/serializer
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/serializer
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/serializer')
-rw-r--r--o3d/serializer/cross/serializer.cc19
-rw-r--r--o3d/serializer/cross/serializer_binary.cc3
2 files changed, 12 insertions, 10 deletions
diff --git a/o3d/serializer/cross/serializer.cc b/o3d/serializer/cross/serializer.cc
index 25996c8..96dd01b 100644
--- a/o3d/serializer/cross/serializer.cc
+++ b/o3d/serializer/cross/serializer.cc
@@ -297,7 +297,7 @@ class PropertiesVisitor : public VisitorBase<PropertiesVisitor> {
writer_->BeginCompacting();
writer_->OpenArray();
const ElementRefArray& elements = shape->GetElementRefs();
- for (int i = 0; i != elements.size(); ++i) {
+ for (ElementRefArray::size_type i = 0; i != elements.size(); ++i) {
Serialize(writer_, elements[i].Get());
}
writer_->CloseArray();
@@ -312,7 +312,8 @@ class PropertiesVisitor : public VisitorBase<PropertiesVisitor> {
writer_->OpenArray();
const Skin::MatrixArray& inverse_bind_pose_matrices =
skin->inverse_bind_pose_matrices();
- for (int i = 0; i != inverse_bind_pose_matrices.size(); ++i) {
+ for (Skin::MatrixArray::size_type i = 0;
+ i != inverse_bind_pose_matrices.size(); ++i) {
const Matrix4& matrix = inverse_bind_pose_matrices[i];
Serialize(writer_, matrix);
}
@@ -327,7 +328,7 @@ class PropertiesVisitor : public VisitorBase<PropertiesVisitor> {
writer_->BeginCompacting();
writer_->OpenArray();
const ShapeRefArray& shape_array = transform->GetShapeRefs();
- for (int i = 0; i != shape_array.size(); ++i) {
+ for (ShapeRefArray::size_type i = 0; i != shape_array.size(); ++i) {
Serialize(writer_, shape_array[i]);
}
writer_->CloseArray();
@@ -427,7 +428,8 @@ class CustomVisitor : public VisitorBase<CustomVisitor> {
writer_->OpenArray();
const StreamParamVector& vertex_stream_params =
skin_eval->vertex_stream_params();
- for (int i = 0; i != vertex_stream_params.size(); ++i) {
+ for (StreamParamVector::size_type i = 0;
+ i != vertex_stream_params.size(); ++i) {
const Stream& stream = vertex_stream_params[i]->stream();
writer_->OpenObject();
writer_->WritePropertyName("stream");
@@ -452,7 +454,8 @@ class CustomVisitor : public VisitorBase<CustomVisitor> {
writer_->OpenArray();
const StreamParamVector& vertex_stream_params =
stream_bank->vertex_stream_params();
- for (int i = 0; i != vertex_stream_params.size(); ++i) {
+ for (StreamParamVector::size_type i = 0;
+ i != vertex_stream_params.size(); ++i) {
const Stream& stream = vertex_stream_params[i]->stream();
writer_->OpenObject();
writer_->WritePropertyName("stream");
@@ -757,7 +760,8 @@ void Serializer::SerializePack(Pack* pack) {
std::vector<const ObjectBase::Class*> classes =
class_manager_->GetAllClasses();
- for (int i = 0; i != classes.size(); ++i) {
+ for (std::vector<const ObjectBase::Class*>::size_type i = 0;
+ i != classes.size(); ++i) {
const ObjectBase::Class* current_class = classes[i];
if (!ObjectBase::ClassIsA(current_class, Param::GetApparentClass())) {
std::vector<ObjectBase*> objects_of_class;
@@ -771,7 +775,8 @@ void Serializer::SerializePack(Pack* pack) {
if (objects_of_class.size() != 0) {
writer_->WritePropertyName(current_class->name());
writer_->OpenArray();
- for (int j = 0; j != objects_of_class.size(); ++j) {
+ for (std::vector<ObjectBase*>::size_type j = 0;
+ j != objects_of_class.size(); ++j) {
writer_->OpenObject();
SerializeObject(objects_of_class[j]);
writer_->CloseObject();
diff --git a/o3d/serializer/cross/serializer_binary.cc b/o3d/serializer/cross/serializer_binary.cc
index 56793c4..463b165 100644
--- a/o3d/serializer/cross/serializer_binary.cc
+++ b/o3d/serializer/cross/serializer_binary.cc
@@ -105,9 +105,6 @@ void SerializeBuffer(const Buffer &buffer, MemoryBuffer<uint8> *output) {
// Write out the number of elements
stream.WriteLittleEndianUInt32(num_elements);
- // Make note of stream position at end of header
- size_t data_start_position = stream.GetStreamPosition();
-
// Write out the data for each field
// Write out the specification for the fields
for (size_t i = 0; i < num_fields; ++i) {