From 4c9b738247e91ffe3a856e50312db861ebc62bfb Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Tue, 16 Mar 2021 12:29:39 +0100 Subject: [PATCH] (cosmetics) --- include/fxos/disasm-passes/print.h | 2 +- include/fxos/domains.h | 16 ++++++++-------- include/fxos/errors.h | 2 +- include/fxos/semantics.h | 5 ++--- lib/load-asm.l | 2 -- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/include/fxos/disasm-passes/print.h b/include/fxos/disasm-passes/print.h index c9fc3ea..9a823b0 100644 --- a/include/fxos/disasm-passes/print.h +++ b/include/fxos/disasm-passes/print.h @@ -31,7 +31,7 @@ public: Never=1, /* Promote but keep the lower-level information */ Append=0, - /* Promove and hide the lower-level information */ + /* Promote and hide the lower-level information */ Promote=2, }; diff --git a/include/fxos/domains.h b/include/fxos/domains.h index 83ed228..f658167 100644 --- a/include/fxos/domains.h +++ b/include/fxos/domains.h @@ -69,15 +69,15 @@ struct RelConst /* The following fields concurrently indicate the base. The order of resolution is as follows (non-trivial types in parentheses): - * If [spe] is equal to Bottom or Top, this is the value. - * If [arg] is non-zero, the value of the arg-th argument is used. - * If [org] is non-zero, the original value of the associated - callee-saved register is used. (CpuRegister) - * If [reg] is non-zero, the base is that register. (CpuRegister) + * If [spe] is equal to Bottom or Top, this is the value. + * If [arg] is non-zero, the value of the arg-th argument is used. + * If [org] is non-zero, the original value of the associated + callee-saved register is used. (CpuRegister) + * If [reg] is non-zero, the base is that register. (CpuRegister) - For efficiency, checking [base==0] will tell apart plain old - constants from values with bases (and specials but these are usually - handled first). */ + For efficiency, checking [base==0] will tell apart plain old + constants from values with bases (and specials but these are usually + handled first). */ union { struct { uint8_t spe; diff --git a/include/fxos/errors.h b/include/fxos/errors.h index fba263e..0be8152 100644 --- a/include/fxos/errors.h +++ b/include/fxos/errors.h @@ -6,7 +6,7 @@ // Fatal errors (caught by main): // std::logic_error Internal consistency, fxos is broken // FxOS::LimitError fxos doesn't know how to handle the input -// FxOS::LangError Program is invalid or dabatase too poor +// FxOS::LangError Program is invalid or database too poor // // Recoverable errors: // std::runtime_error External errors (fi. file access) diff --git a/include/fxos/semantics.h b/include/fxos/semantics.h index 17e3ce8..39cd6e0 100644 --- a/include/fxos/semantics.h +++ b/include/fxos/semantics.h @@ -99,7 +99,7 @@ struct StructType: public BaseType class DataType { public: - /* Variant identifier (think of it as a named sum type */ + /* Variant identifier (think of it as a named sum type) */ enum DataKind { Integer=0, Bitfield=1, Array=2, String=3, Struct=4 }; DataKind kind() const noexcept; @@ -125,8 +125,7 @@ public: DataType(StructType t): v(t) {} private: - std::variant v; + std::variant v; }; //--- diff --git a/lib/load-asm.l b/lib/load-asm.l index 8ac1af7..7dc8252 100644 --- a/lib/load-asm.l +++ b/lib/load-asm.l @@ -301,9 +301,7 @@ int load_asm(Buffer const &file, size_t start_offset, size_t start_line) /* Finalize current instruction */ if(!mnemonic) err("%d: missing mnemonic", line); - /* TODO: Generate all parameters and fill */ Pattern p = make_pattern(code); - total += instantiate(p, mnemonic, argtoken1,argtoken2); if(code) free(code);