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/OptionGroupArchitecture.cpp b/source/Interpreter/OptionGroupArchitecture.cpp
index 9446f2e..377bac0 100644
--- a/source/Interpreter/OptionGroupArchitecture.cpp
+++ b/source/Interpreter/OptionGroupArchitecture.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;
@@ -29,15 +30,13 @@
static OptionDefinition
g_option_table[] =
{
-{ LLDB_OPT_SET_1 , false, "arch" , 'a', required_argument, NULL, 0, eArgTypeArchitecture , "Specify the architecture for the target."},
+ { LLDB_OPT_SET_1 , false, "arch" , 'a', required_argument, NULL, 0, eArgTypeArchitecture , "Specify the architecture for the target."},
};
-const uint32_t k_num_file_options = sizeof(g_option_table)/sizeof(OptionDefinition);
-
uint32_t
OptionGroupArchitecture::GetNumDefinitions ()
{
- return k_num_file_options;
+ return arraysize(g_option_table);
}
const OptionDefinition *