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

Unified Diff: command_buffer/common/cross/o3d_cmd_format.cc

Issue 329046: Splits the command buffers into common commands... (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 side-by-side diff with in-line comments
Download patch
Index: command_buffer/common/cross/o3d_cmd_format.cc
===================================================================
--- command_buffer/common/cross/o3d_cmd_format.cc (revision 30289)
+++ command_buffer/common/cross/o3d_cmd_format.cc (working copy)
@@ -39,7 +39,7 @@
namespace command_buffer {
namespace o3d {
-const char* GetCommandName(CommandId id) {
+const char* GetCommandName(CommandId command_id) {
static const char* const names[] = {
#define O3D_COMMAND_BUFFER_CMD_OP(name) # name,
@@ -50,8 +50,10 @@
};
- return (static_cast<int>(id) >= 0 && static_cast<int>(id) < kNumCommands) ?
- names[id] : "*unknown-command*";
+ int id = static_cast<int>(command_id);
+ return (static_cast<int>(id) > kStartPoint &&
apatrick 2009/10/28 16:44:01 no need for static_casts.
+ static_cast<int>(id) < kNumCommands) ?
+ names[id - kStartPoint - 1] : "*unknown-command*";
}
} // namespace cmd

Powered by Google App Engine
This is Rietveld 408576698