OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Finish to get the results. | 168 // Finish to get the results. |
169 helper_->Finish(); | 169 helper_->Finish(); |
170 DCHECK_EQ(helper_->interface()->GetParseError(), | 170 DCHECK_EQ(helper_->interface()->GetParseError(), |
171 BufferSyncInterface::PARSE_NO_ERROR); | 171 BufferSyncInterface::PARSE_NO_ERROR); |
172 DCHECK_EQ(raw_desc->size, size); | 172 DCHECK_EQ(raw_desc->size, size); |
173 } | 173 } |
174 | 174 |
175 const char *raw_desc_string = reinterpret_cast<char *>(raw_desc); | 175 const char *raw_desc_string = reinterpret_cast<char *>(raw_desc); |
176 if (raw_desc->name_offset) { | 176 if (raw_desc->name_offset) { |
177 DCHECK_LE(raw_desc->name_offset + raw_desc->name_size, raw_desc->size); | 177 DCHECK_LE(raw_desc->name_offset + raw_desc->name_size, raw_desc->size); |
178 DCHECK_GT(raw_desc->name_size, 0); | 178 DCHECK_GT(raw_desc->name_size, 0U); |
179 DCHECK_EQ(raw_desc_string[raw_desc->name_offset + raw_desc->name_size - 1], | 179 DCHECK_EQ(raw_desc_string[raw_desc->name_offset + raw_desc->name_size - 1], |
180 0); | 180 0); |
181 desc->name = String(raw_desc_string + raw_desc->name_offset, | 181 desc->name = String(raw_desc_string + raw_desc->name_offset, |
182 raw_desc->name_size - 1); | 182 raw_desc->name_size - 1); |
183 } else { | 183 } else { |
184 desc->name.clear(); | 184 desc->name.clear(); |
185 } | 185 } |
186 if (raw_desc->semantic_offset) { | 186 if (raw_desc->semantic_offset) { |
187 DCHECK_LE(raw_desc->semantic_offset + raw_desc->semantic_size, | 187 DCHECK_LE(raw_desc->semantic_offset + raw_desc->semantic_size, |
188 raw_desc->size); | 188 raw_desc->size); |
189 DCHECK_GT(raw_desc->semantic_size, 0); | 189 DCHECK_GT(raw_desc->semantic_size, 0U); |
190 DCHECK_EQ(raw_desc_string[raw_desc->semantic_offset + | 190 DCHECK_EQ(raw_desc_string[raw_desc->semantic_offset + |
191 raw_desc->semantic_size - 1], | 191 raw_desc->semantic_size - 1], |
192 0); | 192 0); |
193 desc->semantic = String(raw_desc_string + raw_desc->semantic_offset, | 193 desc->semantic = String(raw_desc_string + raw_desc->semantic_offset, |
194 raw_desc->semantic_size - 1); | 194 raw_desc->semantic_size - 1); |
195 } else { | 195 } else { |
196 desc->semantic.clear(); | 196 desc->semantic.clear(); |
197 } | 197 } |
198 shm_allocator_->Free(raw_desc); | 198 shm_allocator_->Free(raw_desc); |
199 return true; | 199 return true; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 Desc *raw_desc = raw_descs + j; | 269 Desc *raw_desc = raw_descs + j; |
270 desc->semantic = static_cast<vertex_struct::Semantic>(raw_desc->semantic); | 270 desc->semantic = static_cast<vertex_struct::Semantic>(raw_desc->semantic); |
271 desc->semantic_index = raw_desc->semantic_index; | 271 desc->semantic_index = raw_desc->semantic_index; |
272 } | 272 } |
273 } | 273 } |
274 shm_allocator_->Free(raw_descs); | 274 shm_allocator_->Free(raw_descs); |
275 return true; | 275 return true; |
276 } | 276 } |
277 } // namespace command_buffer | 277 } // namespace command_buffer |
278 } // namespace o3d | 278 } // namespace o3d |
OLD | NEW |