diff --git a/include/ast.h b/include/ast.h index e9a912d..08cccc1 100644 --- a/include/ast.h +++ b/include/ast.h @@ -241,7 +241,7 @@ struct GlobalVariable : public AstIdent struct GlobalVariableIdx : public AstIdent { bool valid; - int idxGlbIdx; /* idx into localId, GLOB_VAR_IDX */ + int idxGlbIdx; /* idx into localId, GLOB_VAR_IDX */ virtual Expr *clone() const { @@ -255,9 +255,9 @@ struct GlobalVariableIdx : public AstIdent struct Constant : public AstIdent { struct _kte - { /* for CONSTANT only */ - uint32_t kte; /* value of the constant */ - uint8_t size; /* #bytes size constant */ + { /* for CONSTANT only */ + uint32_t kte; /* value of the constant */ + uint8_t size; /* #bytes size constant */ } kte; Constant(uint32_t _kte, uint8_t size) @@ -276,7 +276,7 @@ struct Constant : public AstIdent }; struct FuncNode : public AstIdent { - struct _call { /* for FUNCTION only */ + struct _call { /* for FUNCTION only */ Function *proc; STKFRAME *args; } call; @@ -297,8 +297,8 @@ struct FuncNode : public AstIdent struct RegisterNode : public AstIdent { const LOCAL_ID *m_syms; - regType regiType; /* for REGISTER only */ - int regiIdx; /* index into localId, REGISTER */ + regType regiType; /* for REGISTER only */ + int regiIdx; /* index into localId, REGISTER */ virtual Expr *insertSubTreeReg(Expr *_expr, eReg regi, const LOCAL_ID *locsym); diff --git a/include/bundle.h b/include/bundle.h index fd5d234..7f5a084 100644 --- a/include/bundle.h +++ b/include/bundle.h @@ -36,7 +36,7 @@ public: }; extern bundle cCode; -#define lineSize 360 /* 3 lines in the mean time */ +#define lineSize 360 /* 3 lines in the mean time */ //void newBundle (bundle *procCode); void writeBundle (QIODevice & ios, bundle procCode); diff --git a/include/dcc.h b/include/dcc.h index 6f7afa4..cc5a316 100644 --- a/include/dcc.h +++ b/include/dcc.h @@ -23,11 +23,11 @@ #include "BasicBlock.h" class Project; /* CALL GRAPH NODE */ -extern bundle cCode; /* Output C procedure's declaration and code */ +extern bundle cCode; /* Output C procedure's declaration and code */ /**** Global variables ****/ -extern QString asm1_name, asm2_name; /* Assembler output filenames */ +extern QString asm1_name, asm2_name; /* Assembler output filenames */ typedef struct { /* Command line option flags */ unsigned verbose : 1; @@ -38,7 +38,7 @@ typedef struct { /* Command line option flags */ unsigned Stats : 1; unsigned Interact : 1; /* Interactive mode */ unsigned Calls : 1; /* Follow register indirect calls */ - QString filename; /* The input filename */ + QString filename; /* The input filename */ uint32_t CustomEntryPoint; } OPTION; @@ -60,13 +60,13 @@ enum eAreaType /* Intermediate instructions statistics */ struct STATS { - int numBBbef; /* number of basic blocks initially */ - int numBBaft; /* number of basic blocks at the end */ - int nOrder; /* n-th order */ - int numLLIcode; /* number of low-level Icode instructions */ - int numHLIcode; /* number of high-level Icode instructions */ - int totalLL; /* total number of low-level Icode insts */ - int totalHL; /* total number of high-level Icod insts */ + int numBBbef; /* number of basic blocks initially */ + int numBBaft; /* number of basic blocks at the end */ + int nOrder; /* n-th order */ + int numLLIcode; /* number of low-level Icode instructions */ + int numHLIcode; /* number of high-level Icode instructions */ + int totalLL; /* total number of low-level Icode insts */ + int totalHL; /* total number of high-level Icod insts */ }; extern STATS stats; /* Icode statistics */ diff --git a/src/disassem.cpp b/src/disassem.cpp index 7b3e3b0..382aa0b 100644 --- a/src/disassem.cpp +++ b/src/disassem.cpp @@ -29,7 +29,7 @@ using namespace std; #define POS_LAB 15 /* Position of label */ #define POS_OPC 20 /* Position of opcode */ #define POS_OPR 25 /* Position of operand */ -#define WID_PTR 10 /* Width of the "xword ptr" lingo */ +#define WID_PTR 10 /* Width of the "xword ptr" lingo */ #define POS_OPR2 POS_OPR+WID_PTR /* Position of operand after "xword ptr" */ #define POS_CMT 54 /* Position of comment */ @@ -108,7 +108,7 @@ static vector posStack; /* position stack */ #define printfd(x) printf(x) #define dis_newline() printf("\n") -#define dis_show() // Nothing to do unless using Curses +#define dis_show() // Nothing to do unless using Curses void LLInst::findJumpTargets(CIcodeRec &_pc) @@ -134,9 +134,9 @@ void LLInst::findJumpTargets(CIcodeRec &_pc) } /***************************************************************************** * disassem - Prints a disassembled listing of a procedure. - * pass == 1 generates output on file .a1 - * pass == 2 generates output on file .a2 - * pass == 3 generates output on file .b + * pass == 1 generates output on file .a1 + * pass == 2 generates output on file .a2 + * pass == 3 generates output on file .b ****************************************************************************/ void Disassembler::disassem(PtrFunction ppProc) @@ -551,7 +551,7 @@ void Disassembler::dis1Line(LLInst &inst,int loc_ip, int pass) /* output to .b code buffer */ if (inst.testFlags(SYNTHETIC)) result_stream<<";Synthetic inst"; - if (pass == 3) { /* output to .b code buffer */ + if (pass == 3) { /* output to .b code buffer */ cCode.appendCode("%s\n", qPrintable(result_contents)); } @@ -564,7 +564,7 @@ void Disassembler::dis1Line(LLInst &inst,int loc_ip, int pass) { sprintf(buf,"%03d %06X",loc_ip, inst.label); } - else /* SYNTHETIC instruction */ + else /* SYNTHETIC instruction */ { sprintf(buf,"%03d ",loc_ip); result_stream<<";Synthetic inst"; @@ -636,7 +636,7 @@ QTextStream &LLInst::strSrc(QTextStream &os,bool skip_comma) os<<", "; if (testFlags(I)) os<= PATLEN) return; - quad = (uint8_t) (op & 0xC0); /* Quadrant of the opcode map */ + quad = (uint8_t) (op & 0xC0); /* Quadrant of the opcode map */ if (quad == 0) { /* Arithmetic group 00-3F */ diff --git a/src/graph.cpp b/src/graph.cpp index c58cdf0..6311438 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -1,5 +1,5 @@ /***************************************************************************** - * dcc project CFG related functions + * dcc project CFG related functions * (C) Cristina Cifuentes ****************************************************************************/ @@ -47,7 +47,7 @@ void Function::createCFG() BB * psBB; BB * pBB; - iICODE pIcode = Icode.begin(); + iICODE pIcode = Icode.begin(); stats.numBBbef = stats.numBBaft = 0; rICODE current_range=make_iterator_range(pIcode,++iICODE(pIcode)); @@ -205,7 +205,7 @@ void Function::freeCFG() void Function::compressCFG() { BB *pNxt; - int ip, first=0, last; + int ip, first=0, last; /* First pass over BB list removes redundant jumps of the form * (Un)Conditional -> Unconditional jump */ @@ -241,7 +241,7 @@ void Function::compressCFG() { if (pBB->inEdges.empty()) { - if (entry_node) /* Init it misses out on */ + if (entry_node) /* Init it misses out on */ pBB->index = UN_INIT; else { @@ -321,7 +321,7 @@ BB *BB::rmJMP(int marker, BB * pBB) ****************************************************************************/ void BB::mergeFallThrough( CIcodeRec &Icode) { - BB * pChild; + BB * pChild; if (nullptr==this) { printf("mergeFallThrough on empty BB!\n"); @@ -374,7 +374,7 @@ void BB::mergeFallThrough( CIcodeRec &Icode) ****************************************************************************/ void BB::dfsNumbering(std::vector &dfsLast, int *first, int *last) { - BB * pChild; + BB * pChild; traversed = DFS_NUM; dfsFirstNum = (*first)++; diff --git a/src/hlicode.cpp b/src/hlicode.cpp index a0196e5..42fcc4c 100644 --- a/src/hlicode.cpp +++ b/src/hlicode.cpp @@ -520,7 +520,7 @@ QString writeJcond (const HLTYPE &h, Function * pProc, int *numLoc) /* Displays the inverse output of a HLI_JCOND icode. This is used in the case * when the THEN clause of an if..then..else is empty. The clause is - * negated and the ELSE clause is used instead. */ + * negated and the ELSE clause is used instead. */ QString writeJcondInv(HLTYPE h, Function * pProc, int *numLoc) { QString _form; @@ -559,10 +559,11 @@ void HLTYPE::set(Expr *l, Expr *r) asgn.m_lhs=l; asgn.m_rhs=r; } -/* Returns a string with the contents of the current high-level icode. - * Note: this routine does not output the contens of HLI_JCOND icodes. This is - * done in a separate routine to be able to support the removal of - * empty THEN clauses on an if..then..else. */ +/** Returns a string with the contents of the current high-level icode. + * \note this routine does not output the contens of HLI_JCOND icodes. This is + * done in a separate routine to be able to support the removal of + * empty THEN clauses on an if..then..else. + */ QString HLTYPE::write1HlIcode (Function * pProc, int *numLoc) const { const HlTypeSupport *p = get(); diff --git a/src/icode.cpp b/src/icode.cpp index 912eecf..93197e3 100644 --- a/src/icode.cpp +++ b/src/icode.cpp @@ -4,8 +4,8 @@ #include "msvc_fixes.h" #include "dcc.h" -#include "types.h" // Common types like uint8_t, etc -#include "ast.h" // Some icode types depend on these +#include "types.h" // Common types like uint8_t, etc +#include "ast.h" // Some icode types depend on these #include diff --git a/src/idioms/idiom1.cpp b/src/idioms/idiom1.cpp index 7b5c30e..360661b 100644 --- a/src/idioms/idiom1.cpp +++ b/src/idioms/idiom1.cpp @@ -53,8 +53,8 @@ int Idiom1::checkStkVars (iICODE pIcode) ****************************************************************************/ bool Idiom1::match(iICODE picode) { - //uint8_t type = 0; /* type of variable: 1 = reg-var, 2 = local */ - //uint8_t regi; /* register of the MOV */ + //uint8_t type = 0; /* type of variable: 1 = reg-var, 2 = local */ + //uint8_t regi; /* register of the MOV */ if(m_func->flg & PROC_HLL) return false; if(picode==m_end) @@ -109,10 +109,10 @@ bool Idiom1::match(iICODE picode) m_min_off = 2 + (n * 2); } else - return false; // Cristina: check this please! + return false; // Cristina: check this please! } else - return false; // Cristina: check this please! + return false; // Cristina: check this please! } } else // push di [push si] / push si [push di] diff --git a/src/locident.cpp b/src/locident.cpp index 76f96a5..2ee4419 100644 --- a/src/locident.cpp +++ b/src/locident.cpp @@ -204,8 +204,8 @@ int LOCAL_ID::newLongReg(hlType t, const LONGID_TYPE &longT, iICODE ix_) id_arr.back().idx.push_back(ix_); return (id_arr.size() - 1); } -/* Returns an identifier conditional expression node of type TYPE_LONG or - * TYPE_WORD_SIGN */ +/** Returns an identifier conditional expression node of type TYPE_LONG or + * TYPE_WORD_SIGN */ AstIdent * LOCAL_ID::createId(const ID *retVal, iICODE ix_) { return AstIdent::idID(retVal,this,ix_); diff --git a/src/machine_x86.cpp b/src/machine_x86.cpp index ad9fbf7..3aa3e71 100644 --- a/src/machine_x86.cpp +++ b/src/machine_x86.cpp @@ -47,7 +47,7 @@ static const QString szOps[] = "RCL", "RCR", "ROL", "ROR", "RET", "RETF", "SAHF", "SAR", "SHL", "SHR", "SBB", "SCAS", "REPNE SCAS","REPE SCAS", "CWD", "STC", "STD", "STI", "STOS", "REP STOS", "SUB", "TEST", "WAIT", "XCHG", - "XLAT", "XOR", "INTO", "NOP", "REPNE", "REPE", "MOD" + "XLAT", "XOR", "INTO", "NOP", "REPNE", "REPE", "MOD" }; /* The following opcodes are for mod != 3 */ static const QString szFlops1[] = diff --git a/src/parser.cpp b/src/parser.cpp index f310850..a014f88 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -802,7 +802,7 @@ bool Function::process_CALL(ICODE & pIcode, CALL_GRAPH * pcallGraph, STATE *psta /* return ((p->flg & TERMINATES) != 0); */ } - return false; // Cristina, please check!! + return false; // Cristina, please check!! } @@ -1020,7 +1020,7 @@ static void setBits(int16_t type, uint32_t start, uint32_t len) for (i = start + len - 1; i >= start; i--) { prog.map[i >> 2] |= type << ((i & 3) << 1); - if (i == 0) break; // Fixes inf loop! + if (i == 0) break; // Fixes inf loop! } } } @@ -1181,8 +1181,8 @@ void Function::process_operands(ICODE & pIcode, STATE * pstate) case iXCHG: /* This instruction is replaced by 3 instructions, only need - * to define the src operand and use the destination operand - * in the mean time. */ + * to define the src operand and use the destination operand + * in the mean time.*/ use(SRC, pIcode, this, pstate, cb); def(DST, pIcode, this, pstate, cb); break; diff --git a/src/procs.cpp b/src/procs.cpp index 6db112a..3c35f10 100644 --- a/src/procs.cpp +++ b/src/procs.cpp @@ -97,7 +97,7 @@ void LOCAL_ID::newRegArg(iICODE picode, iICODE ticode) const condId type; Function * tproc; eReg regL = rUNDEF; - eReg regH; /* Registers involved in arguments */ + eReg regH; /* Registers involved in arguments */ /* Flag ticode as having register arguments */ tproc = ticode->hl()->call.proc; @@ -245,7 +245,7 @@ bool CallType::newStkArg(Expr *exp, llIcode opcode, Function * pproc) /* Places the actual argument exp in the position given by pos in the - * argument list of picode. */ + * argument list of picode. */ void CallType::placeStkArg (Expr *exp, int pos) { (*args)[pos].actual = exp; @@ -289,7 +289,7 @@ Expr *Function::adjustActArgType (Expr *_exp, hlType forType) case TYPE_STR: switch (actType) { case TYPE_CONST: - /* It's an offset into image where a string is found. Point to the string. */ + /* It's an offset into image where a string is found. Point to the string. */ { Constant *c=dynamic_cast(expr); assert(c);