diff options
Diffstat (limited to 'chromium/sandbox/linux/seccomp-bpf/basicblock.h')
-rw-r--r-- | chromium/sandbox/linux/seccomp-bpf/basicblock.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/chromium/sandbox/linux/seccomp-bpf/basicblock.h b/chromium/sandbox/linux/seccomp-bpf/basicblock.h index 1782a8076bd..d15a372cfea 100644 --- a/chromium/sandbox/linux/seccomp-bpf/basicblock.h +++ b/chromium/sandbox/linux/seccomp-bpf/basicblock.h @@ -9,8 +9,7 @@ #include "sandbox/linux/seccomp-bpf/instruction.h" - -namespace playground2 { +namespace sandbox { struct BasicBlock { BasicBlock(); @@ -20,25 +19,24 @@ struct BasicBlock { // identify common sequences of basic blocks. This would normally be // really easy to do, but STL requires us to wrap the comparator into // a class. We begrudgingly add some code here that provides this wrapping. - template<class T> class Less { + template <class T> + class Less { public: - Less(const T& data, int (*cmp)(const BasicBlock *, const BasicBlock *, - const T& data)) - : data_(data), - cmp_(cmp) { - } + Less(const T& data, + int (*cmp)(const BasicBlock*, const BasicBlock*, const T& data)) + : data_(data), cmp_(cmp) {} - bool operator() (const BasicBlock *a, const BasicBlock *b) const { + bool operator()(const BasicBlock* a, const BasicBlock* b) const { return cmp_(a, b, data_) < 0; } private: const T& data_; - int (*cmp_)(const BasicBlock *, const BasicBlock *, const T&); + int (*cmp_)(const BasicBlock*, const BasicBlock*, const T&); }; // Basic blocks are essentially nothing more than a set of instructions. - std::vector<Instruction *> instructions; + std::vector<Instruction*> instructions; // In order to compute relative branch offsets we need to keep track of // how far our block is away from the very last basic block. The "offset_" @@ -46,6 +44,6 @@ struct BasicBlock { int offset; }; -} // namespace playground2 +} // namespace sandbox #endif // SANDBOX_LINUX_SECCOMP_BPF_BASICBLOCK_H__ |