Refactoring: replace a bunch of static array size computation or hardcoded constant
with a template function 'arraysize(static_array)', defined in Utils.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139444 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/OptionGroupFormat.cpp b/source/Interpreter/OptionGroupFormat.cpp
index a42099d..7f6ebbf 100644
--- a/source/Interpreter/OptionGroupFormat.cpp
+++ b/source/Interpreter/OptionGroupFormat.cpp
@@ -13,6 +13,7 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Utility/Utils.h"
using namespace lldb;
using namespace lldb_private;
@@ -35,14 +36,13 @@
static OptionDefinition
g_option_table[] =
{
-{ LLDB_OPT_SET_1 , false, "format", 'f', required_argument, NULL, 0, eArgTypeFormat , "Specify a format to be used for display."},
+ { LLDB_OPT_SET_1 , false, "format", 'f', required_argument, NULL, 0, eArgTypeFormat , "Specify a format to be used for display."},
};
-const uint32_t k_num_file_options = sizeof(g_option_table)/sizeof(OptionDefinition);
uint32_t
OptionGroupFormat::GetNumDefinitions ()
{
- return k_num_file_options;
+ return arraysize(g_option_table);
}
const OptionDefinition *