Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: command_buffer/common/cross/cmd_buffer_format.h

Issue 248026: Fixing signed/unsigned mismatch warning showing up in gyp build.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 inline size_t RoundSizeToMultipleOfEntries(size_t size_in_bytes) { 172 inline size_t RoundSizeToMultipleOfEntries(size_t size_in_bytes) {
173 return ComputeNumEntries(size_in_bytes) * sizeof(uint32); // NOLINT 173 return ComputeNumEntries(size_in_bytes) * sizeof(uint32); // NOLINT
174 } 174 }
175 175
176 // Struct that defines the command header in the command buffer. 176 // Struct that defines the command header in the command buffer.
177 struct CommandHeader { 177 struct CommandHeader {
178 Uint32 size:8; 178 Uint32 size:8;
179 Uint32 command:24; 179 Uint32 command:24;
180 180
181 void Init(uint32 _command, uint32 _size) { 181 void Init(uint32 _command, uint32 _size) {
182 DCHECK_LT(_size, 256); 182 DCHECK_LT(_size, 256u);
183 DCHECK_LT(_command, static_cast<int>(kNumCommands)); 183 DCHECK_LT(_command, static_cast<unsigned int>(kNumCommands));
184 command = _command; 184 command = _command;
185 size = _size; 185 size = _size;
186 } 186 }
187 187
188 // Sets the header based on the passed in command. Can not be used for 188 // Sets the header based on the passed in command. Can not be used for
189 // variable sized commands like immediate commands or Noop. 189 // variable sized commands like immediate commands or Noop.
190 template <typename T> 190 template <typename T>
191 void SetCmd() { 191 void SetCmd() {
192 COMPILE_ASSERT(T::kArgFlags == cmd::kFixed, Cmd_kArgFlags_not_kFixed); 192 COMPILE_ASSERT(T::kArgFlags == cmd::kFixed, Cmd_kArgFlags_not_kFixed);
193 Init(T::kCmdId, ComputeNumEntries(sizeof(T))); // NOLINT 193 Init(T::kCmdId, ComputeNumEntries(sizeof(T))); // NOLINT
(...skipping 3120 matching lines...) Expand 10 before | Expand all | Expand 10 after
3314 OffsetOf_SetBackSurfaces_header_not_0); 3314 OffsetOf_SetBackSurfaces_header_not_0);
3315 3315
3316 O3D_POP_STRUCTURE_PACKING; 3316 O3D_POP_STRUCTURE_PACKING;
3317 3317
3318 } // namespace cmd 3318 } // namespace cmd
3319 3319
3320 } // namespace command_buffer 3320 } // namespace command_buffer
3321 } // namespace o3d 3321 } // namespace o3d
3322 3322
3323 #endif // O3D_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_FORMAT_H_ 3323 #endif // O3D_COMMAND_BUFFER_COMMON_CROSS_CMD_BUFFER_FORMAT_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698