From 99b77e868d3ec165cd5f67be27cfa5b2d55f2c30 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 6 May 2018 09:53:06 -0500 Subject: [PATCH] [ox/buffer] Remove and and or keywords --- deps/ox/src/ox/ptrarith/nodebuffer.hpp | 8 ++++---- deps/ox/src/ox/ptrarith/ptr.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deps/ox/src/ox/ptrarith/nodebuffer.hpp b/deps/ox/src/ox/ptrarith/nodebuffer.hpp index 77ddff03..ff73c711 100644 --- a/deps/ox/src/ox/ptrarith/nodebuffer.hpp +++ b/deps/ox/src/ox/ptrarith/nodebuffer.hpp @@ -191,9 +191,9 @@ typename NodeBuffer::ItemPtr NodeBuffer::ptr(size_t auto itemSpace = m_header.size - itemOffset; auto item = reinterpret_cast(reinterpret_cast(this) + itemOffset); oxTrace("ox::ptrarith::NodeBuffer::ptr::itemOffset") << itemOffset << m_header.size - sizeof(Item); - if (itemOffset >= sizeof(Header) and - itemOffset < m_header.size - sizeof(Item) and - itemSpace >= static_cast(sizeof(Item)) and + if (itemOffset >= sizeof(Header) && + itemOffset < m_header.size - sizeof(Item) && + itemSpace >= static_cast(sizeof(Item)) && itemSpace >= item->fullSize()) { return ItemPtr(this, m_header.size, itemOffset, item->fullSize()); } else { @@ -270,7 +270,7 @@ void NodeBuffer::free(ItemPtr item) { template Error NodeBuffer::setSize(size_t size) { auto last = lastItem(); - if ((last.valid() and last.end() >= size) or size < sizeof(m_header)) { + if ((last.valid() && last.end() >= size) || size < sizeof(m_header)) { return 1; } else { m_header.size = size; diff --git a/deps/ox/src/ox/ptrarith/ptr.hpp b/deps/ox/src/ox/ptrarith/ptr.hpp index 6d31f6eb..a39e640e 100644 --- a/deps/ox/src/ox/ptrarith/ptr.hpp +++ b/deps/ox/src/ox/ptrarith/ptr.hpp @@ -85,9 +85,9 @@ inline Ptr::Ptr(std::nullptr_t) { template inline Ptr::Ptr(void *dataStart, size_t dataSize, size_t itemStart, size_t itemSize) { // do some sanity checks before assuming this is valid - if (itemSize >= sizeof(T) and - dataStart and - itemStart >= minOffset and + if (itemSize >= sizeof(T) && + dataStart && + itemStart >= minOffset && static_cast(itemStart + itemSize) <= dataSize) { m_dataStart = reinterpret_cast(dataStart); m_dataSize = dataSize; @@ -171,7 +171,7 @@ inline T &Ptr::operator*() { template inline Ptr::operator size_t() const { - if (m_dataStart and m_itemOffset) { + if (m_dataStart && m_itemOffset) { return m_itemOffset; } return 0;