commit 8b843d004f349ae66bc7d8afa63d1724fd5506fb
parent 8cce46ea6b95f31c6733a5abc2cdcf3dfdcd174e
Author: Kyle Milz <kyle@0x30.net>
Date: Fri, 19 Aug 2016 21:37:01 -0600
src: fiddle with interface
Diffstat:
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/runtime_proc.cc b/src/runtime_proc.cc
@@ -38,10 +38,9 @@ RuntimeProcess::RuntimeProcess(shm &s) :
while (m_shm.at_end() == false) {
TranslationUnit t;
- uint8_t ready = 0;
- while (ready == 0)
- m_shm.read_pos(&ready);
+ while (m_shm.get_pos() == 0);
// Hack to increment the counter.
+ uint8_t ready;
m_shm.read_all(&ready);
m_shm.read_all(&t.num_lines);
diff --git a/src/shm.h b/src/shm.h
@@ -15,16 +15,15 @@ public:
m_pos += sizeof(T);
};
- void read_pos(uint8_t *bit)
+ uint8_t get_pos()
{
- *bit = m_mem[m_pos];
+ return m_mem[m_pos];
}
void read_cstring(const char **);
void *get_block(size_t);
bool at_end();
-
//void read_string(std::string &);
private:
int m_fd;