diff options
Diffstat (limited to 'lldb/tools/debugserver/source/TTYState.h')
| -rw-r--r-- | lldb/tools/debugserver/source/TTYState.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/tools/debugserver/source/TTYState.h b/lldb/tools/debugserver/source/TTYState.h index c01d5125543..7d26f5ec004 100644 --- a/lldb/tools/debugserver/source/TTYState.h +++ b/lldb/tools/debugserver/source/TTYState.h @@ -17,6 +17,8 @@ #include <termios.h> #include <stdint.h> +#include "llvm/ADT/STLExtras.h" + class TTYState { public: @@ -50,7 +52,7 @@ public: bool GetState(uint32_t idx, int fd, bool saveProcessGroup); bool SetState(uint32_t idx) const; - uint32_t NumStates() const { return sizeof(m_ttystates)/sizeof(TTYState); } + uint32_t NumStates() const { return llvm::array_lengthof(m_ttystates); } bool ValidStateIndex(uint32_t idx) const { return idx < NumStates(); } protected: @@ -58,4 +60,4 @@ protected: TTYState m_ttystates[2]; }; -#endif
\ No newline at end of file +#endif |

