Chromium Code Reviews| 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 |