From a2bc0d353c6ff336ee5a710154f8dd48a1f9f07d Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 25 Dec 2016 12:38:12 -0500 Subject: [PATCH] process -> code. --- Makefile | 2 +- disassembler.cpp | 4 ++-- disassembler.h | 8 ++++---- dumpobj.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 0c8acdf..399813a 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ CC=c++ -std=c++11 -g CXX=c++ -std=c++11 -g OBJS = dumpobj.o disasm.o -dumpobj : dumpobj.o disasm.o disassembler.o +dumpobj : dumpobj.o disassembler.o disassembler.o : disassembler.cpp disassembler.h dumpobj.o : dumpobj.cpp disassembler.h diff --git a/disassembler.cpp b/disassembler.cpp index 0bca003..7dcdce1 100644 --- a/disassembler.cpp +++ b/disassembler.cpp @@ -364,7 +364,7 @@ void disassembler::dump(const std::string &expr, unsigned size) { reset(); } -void disassembler::process(const std::string &expr, unsigned size) { +void disassembler::code(const std::string &expr, unsigned size) { if (_st != 1 || size != _size) { dump(expr, size); return; @@ -377,7 +377,7 @@ void disassembler::flush() { if (_st) dump(); } -void disassembler::process(uint8_t byte) { +void disassembler::code(uint8_t byte) { _bytes[_st++] = byte; if (_st == 1) { _op = byte; diff --git a/disassembler.h b/disassembler.h index e1dbf04..5062676 100644 --- a/disassembler.h +++ b/disassembler.h @@ -9,14 +9,14 @@ class disassembler { public: disassembler() = default; - void process(uint8_t byte); - void process(const std::string &expr, unsigned size); + void code(uint8_t byte); + void code(const std::string &expr, unsigned size); template - void process(Iter begin, Iter end) { while (begin != end) process(*begin++); } + void code(Iter begin, Iter end) { while (begin != end) code(*begin++); } template - void process(const T &t) { process(std::begin(t), std::end(t)); } + void code(const T &t) { code(std::begin(t), std::end(t)); } bool m() const { return _flags & 0x20; } bool x() const { return _flags & 0x10; } diff --git a/dumpobj.cpp b/dumpobj.cpp index ae09abd..32a5176 100644 --- a/dumpobj.cpp +++ b/dumpobj.cpp @@ -278,7 +278,7 @@ void dump_obj(const char *name, int fd) if (op < 0xf0) { auto end = iter + op; while (iter != end) { - d.process(*iter++); + d.code(*iter++); place_labels(labels, d.pc()); } continue; @@ -357,7 +357,7 @@ void dump_obj(const char *name, int fd) } } if (stack.size() != 1) errx(EX_DATAERR, "%s stack overflow error.", name); - d.process(stack.front(), bytes); + d.code(stack.front(), bytes); } break;