Convert OptionGroupVariable.cpp to use the arraysize() template function, as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139452 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/OptionGroupVariable.cpp b/source/Interpreter/OptionGroupVariable.cpp
index 9cf8d41..a2bdbb2 100644
--- a/source/Interpreter/OptionGroupVariable.cpp
+++ b/source/Interpreter/OptionGroupVariable.cpp
@@ -15,6 +15,7 @@
// Project includes
#include "lldb/Target/Target.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Utility/Utils.h"
using namespace lldb;
using namespace lldb_private;
@@ -88,6 +89,7 @@
summary = "";
}
+#define NUM_FRAME_OPTS 3
const OptionDefinition*
OptionGroupVariable::GetDefinitions ()
@@ -99,16 +101,18 @@
// Skip the "--no-args", "--no-locals" and "--show-globals"
// options if we are not showing frame specific options (globals only)
- return &g_option_table[3];
+ return &g_option_table[NUM_FRAME_OPTS];
}
uint32_t
OptionGroupVariable::GetNumDefinitions ()
{
+ // Count the "--no-args", "--no-locals" and "--show-globals"
+ // options if we are showing frame specific options.
if (include_frame_options)
- return 8;
+ return arraysize(g_option_table);
else
- return 5;
+ return arraysize(g_option_table) - NUM_FRAME_OPTS;
}