diff options
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 90ee2585..9e90eeb8 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -10048,17 +10048,38 @@ namespace BinaryNinja { */ struct Variable : public BNVariable { - Variable(); - Variable(BNVariableSourceType type, uint32_t index, uint64_t storage); - Variable(BNVariableSourceType type, uint64_t storage); - Variable(const BNVariable& var); - Variable(const Variable& var); + Variable() : BNVariable{RegisterVariableSourceType, 0, 0} {} + Variable(BNVariableSourceType type, uint64_t storage) : Variable(type, 0, storage) {} + Variable(BNVariableSourceType type, uint32_t index, uint64_t storage) + : BNVariable{type, index, static_cast<int64_t>(storage)} + { + } + Variable(const BNVariable& var) : BNVariable(var) {} + + Variable(const Variable&) = default; + Variable& operator=(const Variable&) = default; - Variable& operator=(const Variable& var); + Variable(Variable&&) = default; + Variable& operator=(Variable&&) = default; + + bool operator==(const Variable& var) const + { + return type == var.type && index == var.index && storage == var.storage; + } - bool operator==(const Variable& var) const; - bool operator!=(const Variable& var) const; - bool operator<(const Variable& var) const; + bool operator!=(const Variable& var) const + { + return !(*this == var); + } + + bool operator<(const Variable& var) const + { + if (type != var.type) + return type < var.type; + if (storage != var.storage) + return storage < var.storage; + return index < var.index; + } uint64_t ToIdentifier() const; static Variable FromIdentifier(uint64_t id); |
