From 8c66266e99f7a9c52aa12ac39be55e5bb8e03dcb Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 15 Aug 2022 18:11:20 +0200 Subject: [PATCH] Lint for trailing spaces --- libr/anal/arch/v850/opc.inc | 2 +- libr/anal/arch/v850/v850dis.c | 4 +-- libr/anal/p/anal_arm_cs.c | 2 +- libr/anal/p/anal_arm_v35.c | 2 +- libr/anal/p/anal_bpf_cs.c | 44 +++++++++++++--------------- libr/anal/p/anal_gb.c | 4 +-- libr/anal/p/anal_i4004.c | 2 +- libr/anal/p/anal_loongarch_gnu.c | 4 +-- libr/anal/p/anal_rsp.c | 2 +- libr/anal/p/anal_v850.c | 1 - libr/anal/p/anal_x86_cs.c | 24 +++++++-------- libr/anal/var.c | 2 +- libr/asm/arch/arm/armass64.c | 8 ++--- libr/bin/format/objc/mach0_classes.c | 2 +- libr/bin/p/bin_xnu_kernelcache.c | 2 +- libr/core/cmd_anal.c | 6 ++-- libr/core/cmd_print.c | 4 +-- libr/core/disasm.c | 2 +- libr/core/linux_heap_glibc.c | 2 +- libr/core/rtr_http.c | 2 +- libr/egg/egg_cfile.c | 1 - libr/include/r_util/r_print.h | 2 +- libr/io/io_plugin.c | 2 +- libr/io/p/io_ihex.c | 2 +- libr/io/p/io_xalz.c | 2 +- libr/magic/d/default/archive | 6 ++-- libr/main/r2pm.c | 2 +- libr/parse/c/tcc.h | 2 +- libr/util/sys_sh.c | 2 +- sys/lint.sh | 1 + 30 files changed, 70 insertions(+), 73 deletions(-) diff --git a/libr/anal/arch/v850/opc.inc b/libr/anal/arch/v850/opc.inc index 20c0857b0c..23d18f2554 100644 --- a/libr/anal/arch/v850/opc.inc +++ b/libr/anal/arch/v850/opc.inc @@ -921,7 +921,7 @@ const struct v850_opcode v850_opcodes[] = { { "ld.w", two (0x0780, 0x0009), two (0xffe0, 0x001f), {D23_ALIGN1, R1, R3}, 2, V850_CPU_E2_UP, R_ANAL_OP_TYPE_LOAD, "#0,[4],#1,=" }, { "ld.w23", two (0x0780, 0x0009), two (0x07e0, 0x001f), {D23_ALIGN1, R1, R3}, 2, V850_CPU_E2_UP | V850_CPU_OPTION_ALIAS, R_ANAL_OP_TYPE_LOAD }, { "ldl.w", two (0x07e0, 0x0378), two (0xffe0, 0x07ff), {R1, R3}, 1, V850_CPU_E3V5_UP, R_ANAL_OP_TYPE_LOAD }, - /// XXX load status word is always zero + /// XXX load status word is always zero { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, SR2, SELID}, 0, V850_CPU_E3V5_UP, R_ANAL_OP_TYPE_LOAD, "#1,#0,:=" }, { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, SR2}, 0, V850_CPU_E3V5_UP, R_ANAL_OP_TYPE_LOAD, "#1,#0,:=" }, { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, OLDSR2}, 0, (V850_CPU_ALL & (~ V850_CPU_E3V5_UP)), R_ANAL_OP_TYPE_LOAD, "#1,#0,:=" }, diff --git a/libr/anal/arch/v850/v850dis.c b/libr/anal/arch/v850/v850dis.c index 66b08aa151..966f1f569e 100644 --- a/libr/anal/arch/v850/v850dis.c +++ b/libr/anal/arch/v850/v850dis.c @@ -6,7 +6,7 @@ enum { V850_ARG_TYPE_UNKNOWN, V850_ARG_TYPE_STRING, - V850_ARG_TYPE_NUMBER + V850_ARG_TYPE_NUMBER }; static const ut8 v850_cacheop_codes[] = { @@ -433,7 +433,7 @@ static bool v850np_disassemble(v850np_inst *inst, int cpumodel, ut64 memaddr, co } // first argument have no special processing - const char *prefix = (operand->flags & V850_OPERAND_BANG)? "|" :(operand->flags & V850_OPERAND_PERCENT)? "%":""; + const char *prefix = (operand->flags & V850_OPERAND_BANG)? "|" :(operand->flags & V850_OPERAND_PERCENT)? "%":""; #define IS_PUSHPOP(x) (!strcmp ((x), "pushsp") || !strcmp ((x), "popsp") || !strcmp ((x), "dbpush" )) if (opnum == 1 && opnum == memop) { r_strbuf_append (sb, "["); diff --git a/libr/anal/p/anal_arm_cs.c b/libr/anal/p/anal_arm_cs.c index 1e3e8139d1..481afad725 100644 --- a/libr/anal/p/anal_arm_cs.c +++ b/libr/anal/p/anal_arm_cs.c @@ -1900,7 +1900,7 @@ static int analop64_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int l r_strbuf_appendf (&op->esil, "}{,pstate,1,28,1,<<,-,&,28,%"PFMT64d",<<,|,pstate,:=", IMM64 (2)); } break; - case ARM64_INS_CMN: + case ARM64_INS_CMN: case ARM64_INS_CCMN: ARG64_APPEND (&op->esil, 1); COMMA (&op->esil); diff --git a/libr/anal/p/anal_arm_v35.c b/libr/anal/p/anal_arm_v35.c index 62f604cbe8..9e7b48f5f4 100644 --- a/libr/anal/p/anal_arm_v35.c +++ b/libr/anal/p/anal_arm_v35.c @@ -657,7 +657,7 @@ static void arg64_append(RStrBuf *sb, Instruction *insn, int n, int i, int sign) if (!signext) { // this is weird but signext+shift is all in shiftType? // not extend. why even have an extend field? - // why not just shiftType = sx* with a shiftValue of 0? + // why not just shiftType = sx* with a shiftValue of 0? signext = decode_sign_ext64 (op.shiftType); } if (sign && !signext) { diff --git a/libr/anal/p/anal_bpf_cs.c b/libr/anal/p/anal_bpf_cs.c index f932e5dabe..2bd977a528 100644 --- a/libr/anal/p/anal_bpf_cs.c +++ b/libr/anal/p/anal_bpf_cs.c @@ -227,7 +227,6 @@ static char* regname(uint8_t reg) { } #define REG(n) (regname(OP(n).reg)) - void bpf_alu(RAnal *a, RAnalOp *op, cs_insn *insn, const char* operation, int bits) { if (OPCOUNT == 2 && a->config->bits == 64) { // eBPF if (bits == 64) { @@ -240,10 +239,10 @@ void bpf_alu(RAnal *a, RAnalOp *op, cs_insn *insn, const char* operation, int bi } else { if (OP (1).type == BPF_OP_IMM) { op->val = IMM (1); - esilprintf (op, "%" PFMT64d ",%s,0xffffffff,&,%s,0xffffffff,&,%s,=", + esilprintf (op, "%" PFMT64d ",%s,0xffffffff,&,%s,0xffffffff,&,%s,=", IMM (1), REG (0), operation, REG (0)); } else { - esilprintf (op, "%s,%s,0xffffffff,&,%s,0xffffffff,&,%s,=", + esilprintf (op, "%s,%s,0xffffffff,&,%s,0xffffffff,&,%s,=", REG (1), REG (0), operation, REG (0)); } } @@ -251,7 +250,7 @@ void bpf_alu(RAnal *a, RAnalOp *op, cs_insn *insn, const char* operation, int bi if (OPCOUNT > 0 && OP (0).type == BPF_OP_IMM) { op->val = IMM (0); esilprintf (op, "%" PFMT64d ",a,%s=", IMM (0), operation); - } else { + } else { esilprintf (op, "x,a,%s=", operation); } } @@ -259,12 +258,12 @@ void bpf_alu(RAnal *a, RAnalOp *op, cs_insn *insn, const char* operation, int bi void bpf_load(RAnal *a, RAnalOp *op, cs_insn *insn, char* reg, int size) { if (OPCOUNT > 1 && OP (0).type == BPF_OP_REG) { - esilprintf (op, "%d,%s,+,[%d],%s,=", + esilprintf (op, "%d,%s,+,[%d],%s,=", OP (1).mem.disp, regname(OP (1).mem.base), size, REG (0)); } else if (OPCOUNT > 0 && OP (0).type == BPF_OP_MMEM) { // cBPF esilprintf (op, "m[%d],%s,=", OP (0).mmem, reg); } else if (OPCOUNT > 0) { - esilprintf (op, "%d,%s,+,[%d],%s,=", + esilprintf (op, "%d,%s,+,[%d],%s,=", OP (0).mem.disp, regname(OP (0).mem.base), size, reg); } } @@ -274,10 +273,10 @@ void bpf_store(RAnal *a, RAnalOp *op, cs_insn *insn, char *reg, int size) { esilprintf (op, "%s,m[%d],=", reg, OP (0).mmem); } else if (OPCOUNT > 1) { // eBPF if (OP (1).type == BPF_OP_IMM) { - esilprintf (op, "%" PFMT64d ",%d,%s,+,=[%d]", + esilprintf (op, "%" PFMT64d ",%d,%s,+,=[%d]", IMM (1), OP (0).mem.disp, regname(OP (0).mem.base), size); } else { - esilprintf (op, "%s,%d,%s,+,=[%d]", + esilprintf (op, "%s,%d,%s,+,=[%d]", REG (1), OP (0).mem.disp, regname(OP (0).mem.base), size); } } @@ -286,18 +285,18 @@ void bpf_store(RAnal *a, RAnalOp *op, cs_insn *insn, char *reg, int size) { void bpf_jump(RAnal *a, RAnalOp *op, cs_insn *insn, char *condition) { if (OPCOUNT > 0 && a->config->bits == 32) { // cBPF if (OP (0).type == BPF_OP_IMM) { - esilprintf (op, "%" PFMT64d ",a,NUM,%s,?{,0x%" PFMT64x ",}{,0x%" PFMT64x ",},pc,=", + esilprintf (op, "%" PFMT64d ",a,NUM,%s,?{,0x%" PFMT64x ",}{,0x%" PFMT64x ",},pc,=", IMM (0), condition, op->jump, op->fail); } else { - esilprintf (op, "x,NUM,a,NUM,%s,?{,0x%" PFMT64x ",}{,0x%" PFMT64x ",},pc,=", + esilprintf (op, "x,NUM,a,NUM,%s,?{,0x%" PFMT64x ",}{,0x%" PFMT64x ",},pc,=", condition, op->jump, op->fail); } } else if (OPCOUNT > 1) { // eBPF if (OP (1).type == BPF_OP_IMM) { - esilprintf (op, "%" PFMT64d ",%s,%s,?{,0x%" PFMT64x ",pc,=,}", + esilprintf (op, "%" PFMT64d ",%s,%s,?{,0x%" PFMT64x ",pc,=,}", IMM (1), REG (0), condition, op->jump); } else { - esilprintf (op, "%s,%s,%s,?{,0x%" PFMT64x ",pc,=,}", + esilprintf (op, "%s,%s,%s,?{,0x%" PFMT64x ",pc,=,}", REG (1), REG (0), condition, op->jump); } } @@ -349,20 +348,20 @@ void analop_esil(RAnal *a, RAnalOp *op, cs_insn *insn, ut64 addr) { case BPF_INS_CALL: ///< eBPF only // the call immediate is almost never used as an addr so its an INT // maybe this will change in the future once the relocs are added? - esilprintf (op, "pc,sp,=[8],8,sp,-=,0x%" PFMT64x ",$", IMM (0)); + esilprintf (op, "pc,sp,=[8],8,sp,-=,0x%" PFMT64x ",$", IMM (0)); break; case BPF_INS_EXIT: ///< eBPF only - esilprintf (op, "8,sp,+=,sp,[8],pc,="); + esilprintf (op, "8,sp,+=,sp,[8],pc,="); break; case BPF_INS_RET: // cBPF shouldnt really need the stack, but gonna leave it - esilprintf (op, "%" PFMT64d ",r0,=,8,sp,+=,sp,[8],pc,=", IMM (0)); + esilprintf (op, "%" PFMT64d ",r0,=,8,sp,+=,sp,[8],pc,=", IMM (0)); break; case BPF_INS_TAX: - esilprintf (op, "a,x,="); + esilprintf (op, "a,x,="); break; case BPF_INS_TXA: - esilprintf (op, "x,a,="); + esilprintf (op, "x,a,="); break; case BPF_INS_ADD: ALU ("+", 32); @@ -523,9 +522,8 @@ void analop_esil(RAnal *a, RAnalOp *op, cs_insn *insn, ut64 addr) { LOAD ("x", 1); break; case BPF_INS_LDXDW: ///< eBPF only - LOAD ("a", 8); // reg never used here + LOAD ("a", 8); // reg never used here break; - ///< Store case BPF_INS_STW: ///< eBPF only STORE ("a", 4); @@ -547,14 +545,14 @@ void analop_esil(RAnal *a, RAnalOp *op, cs_insn *insn, ut64 addr) { break; case BPF_INS_XADDW: ///< eBPF only - esilprintf (op, "%s,0xffffffff,&,%d,%s,+,[4],DUP,%s,=,+,%d,%s,+,=[4]", - REG (1), OP (0).mem.disp, regname(OP (0).mem.base), + esilprintf (op, "%s,0xffffffff,&,%d,%s,+,[4],DUP,%s,=,+,%d,%s,+,=[4]", + REG (1), OP (0).mem.disp, regname(OP (0).mem.base), REG (1), OP (0).mem.disp, regname(OP (0).mem.base)); break; case BPF_INS_XADDDW: ///< eBPF only - esilprintf (op, "%s,NUM,%d,%s,+,[8],DUP,%s,=,+,%d,%s,+,=[8]", - REG (1), OP (0).mem.disp, regname(OP (0).mem.base), + esilprintf (op, "%s,NUM,%d,%s,+,[8],DUP,%s,=,+,%d,%s,+,=[8]", + REG (1), OP (0).mem.disp, regname(OP (0).mem.base), REG (1), OP (0).mem.disp, regname(OP (0).mem.base)); break; diff --git a/libr/anal/p/anal_gb.c b/libr/anal/p/anal_gb.c index a853fe3820..eb81214458 100644 --- a/libr/anal/p/anal_gb.c +++ b/libr/anal/p/anal_gb.c @@ -622,9 +622,9 @@ static inline void gb_anal_cb_rr(RReg *reg, RAnalOp *op, const ut8 data) { r_strbuf_setf (&op->esil, "1,%s,&,H,:=,1,%s,>>,7,C,<<,|,%s,=,H,C,:=,0,H,:=,0,N,:=", regs_x[data & 7], regs_x[data & 7], regs_x[data & 7]); //HACK } } - + static inline void gb_anal_cb_sla(RReg *reg, RAnalOp *op, const ut8 data) { - //sra+sla+srl in one function, like xoaasc + //sra+sla+srl in one function, like xoaasc op->dst = r_anal_value_new (); op->src[0] = r_anal_value_new (); op->src[0]->imm = 1; diff --git a/libr/anal/p/anal_i4004.c b/libr/anal/p/anal_i4004.c index 13d6e0b889..a283fcc749 100644 --- a/libr/anal/p/anal_i4004.c +++ b/libr/anal/p/anal_i4004.c @@ -132,7 +132,7 @@ static int i4004_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len } } break; - case 1: + case 1: op->type = R_ANAL_OP_TYPE_CJMP; if (mask & R_ANAL_OP_MASK_DISASM) { snprintf (basm, basz, "jcn 0x%x 0x%x", low, buf[1]); diff --git a/libr/anal/p/anal_loongarch_gnu.c b/libr/anal/p/anal_loongarch_gnu.c index c7631cb174..bb9693e3f9 100644 --- a/libr/anal/p/anal_loongarch_gnu.c +++ b/libr/anal/p/anal_loongarch_gnu.c @@ -978,10 +978,10 @@ static int analop_esil(RAnal *a, RAnalOp *op, ut32 opcode) { r_strbuf_appendf(&op->esil, "%s,%s,0x%"LA_PFM",+,=[1]", LA_RD(), LA_RJ(), I12_SX(opcode)); break; case LA_INS_ST_H: - r_strbuf_appendf(&op->esil, "%s,%s,0x%"LA_PFM",+,=[2]", LA_RD(), LA_RJ(), I12_SX(opcode)); + r_strbuf_appendf(&op->esil, "%s,%s,0x%"LA_PFM",+,=[2]", LA_RD(), LA_RJ(), I12_SX(opcode)); break; case LA_INS_ST_W: - r_strbuf_appendf(&op->esil, "%s,%s,0x%"LA_PFM",+,=[4]", LA_RD(), LA_RJ(), I12_SX(opcode)); + r_strbuf_appendf(&op->esil, "%s,%s,0x%"LA_PFM",+,=[4]", LA_RD(), LA_RJ(), I12_SX(opcode)); break; case LA_INS_ST_D: r_strbuf_appendf(&op->esil, "%s,%s,0x%"LA_PFM",+,=[8]", LA_RD(), LA_RJ(), I12_SX(opcode)); diff --git a/libr/anal/p/anal_rsp.c b/libr/anal/p/anal_rsp.c index bd7ceb8e36..da6b7ced81 100644 --- a/libr/anal/p/anal_rsp.c +++ b/libr/anal/p/anal_rsp.c @@ -64,7 +64,7 @@ static RStrBuf *disassemble(RStrBuf *buf_asm, rsp_instruction *r_instr) { (ut32)r_instr->operands[i].s); break; case RSP_OPND_C2_VREG_ELEMENT: - r_strbuf_appendf (buf_asm, "%s%s", rsp_c2_vreg_names[r_instr->operands[i].u], + r_strbuf_appendf (buf_asm, "%s%s", rsp_c2_vreg_names[r_instr->operands[i].u], rsp_c2_vreg_element_names[r_instr->operands[i].s]); break; default: /* should not happend */ diff --git a/libr/anal/p/anal_v850.c b/libr/anal/p/anal_v850.c index 192cb4123f..48e0a93e56 100644 --- a/libr/anal/p/anal_v850.c +++ b/libr/anal/p/anal_v850.c @@ -557,7 +557,6 @@ static int v850_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, op->fail = addr + inst.size; break; case R_ANAL_OP_TYPE_POP: - // if (inst.op->memop == 3) { if (inst.op && strstr (inst.op->esil, "#2")) { op->type = R_ANAL_OP_TYPE_RET; } diff --git a/libr/anal/p/anal_x86_cs.c b/libr/anal/p/anal_x86_cs.c index a084321948..04fd3d90e6 100644 --- a/libr/anal/p/anal_x86_cs.c +++ b/libr/anal/p/anal_x86_cs.c @@ -987,16 +987,16 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, char shft[32]; cs_x86_op operand = insn->detail->x86.operands[2]; if (operand.type == X86_OP_IMM) { - sprintf(shft, "%" PFMT64d, operand.imm); + sprintf (shft, "%" PFMT64d, operand.imm); } else { - strcpy(shft, "cl"); + strcpy (shft, "cl"); } src = getarg (&gop, 1, 0, NULL, SRC_AR, NULL); dst_r = getarg (&gop, 0, 0, NULL, DST_R_AR, NULL); dst_w = getarg (&gop, 0, 1, NULL, DST_W_AR, &bitsize); esilprintf (op, // set CF to last bit shifted out, OF if sign changes "%s,?{,1,1,%s,-,%s,>>,&,cf,:=,1,%s,-,!,%s,%d,%s,>>,^,!,&,of,:=," - "%s,%d,-,%s,<<,%s,%s,>>,|,1,%d,1,<<,-,&,%s,$z,zf,:=,$p,pf,:=,%d,$s,sf,:=,}", + "%s,%d,-,%s,<<,%s,%s,>>,|,1,%d,1,<<,-,&,%s,$z,zf,:=,$p,pf,:=,%d,$s,sf,:=,}", shft, shft, dst_r, shft, src, bitsize-1, dst_r, shft, bitsize, src, shft, dst_r, bitsize, dst_w, bitsize-1); @@ -1978,7 +1978,7 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, ut32 bitsize; src = getarg (&gop, 1, 0, NULL, SRC_AR, NULL); dst = getarg (&gop, 0, 0, NULL, DST_AR, &bitsize); - esilprintf (op, "%u,%u,%s,F2D,%u,%s,F2D,F+,D2F,%s,=", + esilprintf (op, "%u,%u,%s,F2D,%u,%s,F2D,F+,D2F,%s,=", bitsize, bitsize, src, bitsize, dst, dst); break; @@ -2017,7 +2017,7 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, } src = getarg (&gop, 1, 0, NULL, SRC_AR, NULL); dst = getarg (&gop, 0, 0, NULL, DST_AR, NULL); - esilprintf (op, "32,32,%s,F2D,32,%s,F2D,F%c,D2F,%s,=", + esilprintf (op, "32,32,%s,F2D,32,%s,F2D,F%c,D2F,%s,=", src, dst, operator, dst); } break; @@ -2127,13 +2127,13 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, case X86_INS_CVTSD2SS: case X86_INS_CVTSS2SD: case X86_INS_CVTSI2SS: - case X86_INS_CVTSI2SD: + case X86_INS_CVTSI2SD: case X86_INS_CVTPS2PI: case X86_INS_CVTPD2PI: case X86_INS_CVTPD2PS: case X86_INS_CVTPS2PD: case X86_INS_CVTPI2PS: - case X86_INS_CVTPI2PD: + case X86_INS_CVTPI2PD: { src = getarg (&gop, 1, 0, NULL, SRC_AR, NULL); dst = getarg (&gop, 0, 1, NULL, DST_AR, NULL); @@ -2151,16 +2151,16 @@ static void anop_esil(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, case X86_INS_CVTPD2PS: esilprintf (op, "32,%s,D2F,%s", src, dst); break; - case X86_INS_CVTSS2SD: - case X86_INS_CVTPS2PD: + case X86_INS_CVTSS2SD: + case X86_INS_CVTPS2PD: esilprintf (op, "32,%s,F2D,%s", src, dst); break; - case X86_INS_CVTSI2SS: - case X86_INS_CVTPI2PS: + case X86_INS_CVTSI2SS: + case X86_INS_CVTPI2PS: esilprintf (op, "32,%s,I2D,D2F,%s", src, dst); break; case X86_INS_CVTPI2PD: - case X86_INS_CVTSI2SD: + case X86_INS_CVTSI2SD: default: esilprintf (op, "%s,I2D,%s", src, dst); break; diff --git a/libr/anal/var.c b/libr/anal/var.c index 2a53506873..39dcd3f4c3 100644 --- a/libr/anal/var.c +++ b/libr/anal/var.c @@ -896,7 +896,7 @@ static RAnalVar *get_stack_var(RAnalFunction *fcn, int delta) { static void extract_arg(RAnal *anal, RAnalFunction *fcn, RAnalOp *op, const char *reg, const char *sign, char type) { st64 ptr = 0; char *addr, *esil_buf = NULL; - const st64 maxstackframe = 1024 * 8; + const st64 maxstackframe = 1024 * 8; r_return_if_fail (anal && fcn && op && reg); diff --git a/libr/asm/arch/arm/armass64.c b/libr/asm/arch/arm/armass64.c index 96f6887689..3937077529 100644 --- a/libr/asm/arch/arm/armass64.c +++ b/libr/asm/arch/arm/armass64.c @@ -389,8 +389,8 @@ static ut32 r_n_math(ArmOp *op, ut32 data_64, ut32 data_32 , bool is64) { int k = 0; if (is64) { k = data_64; - } else { - k = data_32; + } else { + k = data_32; } check_cond (op->operands[0].type == ARM_GPR); check_cond (op->operands[1].type == ARM_GPR); @@ -643,7 +643,7 @@ static ut32 tst(ArmOp *op) { } else if (check4){ k = 0x1f000072; } - data = k | (op->operands[0].reg & 0x7) << 29; + data = k | (op->operands[0].reg & 0x7) << 29; data |= (op->operands[0].reg & 0x18) << 13; // encode immediate for tst @@ -1360,7 +1360,7 @@ static ut32 adrp(ArmOp *op, ut64 addr, ut32 k) { //, int reg, ut64 dst) { ---+-------+-----------+-------+---- op | immlo | 1 0 0 0 0 | immhi | Rd - op = 0 (adr) || 1 (adrp) + op = 0 (adr) || 1 (adrp) #endif ut32 immlo = (at & 3) << 29; ut32 immhi = (at >> 2) << 5; diff --git a/libr/bin/format/objc/mach0_classes.c b/libr/bin/format/objc/mach0_classes.c index 6a12edb8a6..d75d34df04 100644 --- a/libr/bin/format/objc/mach0_classes.c +++ b/libr/bin/format/objc/mach0_classes.c @@ -1246,7 +1246,7 @@ typedef struct { st32 *fieldmd; ut64 fieldmd_addr; size_t fieldmd_size; -} SwiftType; +} SwiftType; static SwiftType parse_type_entry(RBinFile *bf, ut64 typeaddr) { SwiftType st = {0}; diff --git a/libr/bin/p/bin_xnu_kernelcache.c b/libr/bin/p/bin_xnu_kernelcache.c index 045097c505..9bfa2353b8 100644 --- a/libr/bin/p/bin_xnu_kernelcache.c +++ b/libr/bin/p/bin_xnu_kernelcache.c @@ -2048,7 +2048,7 @@ static int kernelcache_io_read(RIO *io, RIODesc *fd, ut8 *buf, int count) { return -1; } - // move into + // move into if (count > cache->internal_buffer_size) { if (cache->internal_buffer) { R_FREE (cache->internal_buffer); diff --git a/libr/core/cmd_anal.c b/libr/core/cmd_anal.c index cde90edb1c..bcd7e7ce76 100644 --- a/libr/core/cmd_anal.c +++ b/libr/core/cmd_anal.c @@ -7670,7 +7670,7 @@ static void cmd_anal_esil(RCore *core, const char *input, bool verbose) { r_reg_setv (reg, "PC", pc); break; } - case 'x': + case 'x': if (input[1] == ' ') { // "aex" char *hex; int ret, bufsz; @@ -8717,7 +8717,7 @@ static bool cmd_anal_refs(RCore *core, const char *input) { //get all xrefs pointing to addr list = r_anal_xrefs_get (core->anal, addr); r_list_foreach (list, iter, ref) { - r_cons_printf ("0x%"PFMT64x" %s %s\n", ref->addr, + r_cons_printf ("0x%"PFMT64x" %s %s\n", ref->addr, r_anal_ref_perm_tostring (ref), r_anal_ref_type_tostring (ref->type)); r_anal_xrefs_set (core->anal, ref->addr, at, ref->type); @@ -8883,7 +8883,7 @@ static bool cmd_anal_refs(RCore *core, const char *input) { : r_str_newf ("%s", fcn ? fcn->name : "(nofunc)"); free (print_comment); r_cons_printf ("%s 0x%" PFMT64x " [%s:%s] %s\n", - buf_fcn, ref->addr, r_anal_ref_type_tostring (ref->type), + buf_fcn, ref->addr, r_anal_ref_type_tostring (ref->type), r_anal_ref_perm_tostring (ref), buf_asm); free (buf_asm); free (buf_fcn); diff --git a/libr/core/cmd_print.c b/libr/core/cmd_print.c index c2804d61d4..26ca68df58 100644 --- a/libr/core/cmd_print.c +++ b/libr/core/cmd_print.c @@ -1654,14 +1654,14 @@ static void r_core_cmd_print_binformat(RCore *core, const char *arg, int mode) { r_cons_printf ("%s`-%s %8s = 0x%016"PFMT64x" @ %d + %d\n", pad?pad:"", pad2, la->name?la->name: "", - la->value, + la->value, la->pos, la->sz ); } else { r_cons_printf ("%s`-%s %8s = %4"PFMT64o"o %5"PFMT64d" 0x%02"PFMT64x" @ %d + %d\n", pad?pad:"", pad2, la->name?la->name: "", - la->value, la->value, la->value, + la->value, la->value, la->value, la->pos, la->sz ); } diff --git a/libr/core/disasm.c b/libr/core/disasm.c index 9eef80fb64..4f20a862ca 100644 --- a/libr/core/disasm.c +++ b/libr/core/disasm.c @@ -1512,7 +1512,7 @@ static void ds_show_xrefs(RDisasmState *ds) { r_list_foreach (addrs, it, addrptr) { if (R_STR_ISNOTEMPTY (addrptr)) { char ch = xrefs_char [i++]; - ds_comment (ds, false, "%s%s0x%"PFMT64x"(%c)", + ds_comment (ds, false, "%s%s0x%"PFMT64x"(%c)", it == addrs->head ? "" : ", ", plus, *addrptr, ch); } } diff --git a/libr/core/linux_heap_glibc.c b/libr/core/linux_heap_glibc.c index 2c4e93df07..caa6c000bd 100644 --- a/libr/core/linux_heap_glibc.c +++ b/libr/core/linux_heap_glibc.c @@ -1195,7 +1195,7 @@ static void GH(print_heap_segment)(RCore *core, MallocState *main_arena, case '*': r_cons_printf ("fs heap.corrupted\n"); ut64 chunkflag = (ut64)((prev_chunk >> 4) & 0xffffULL); - r_cons_printf ("f chunk.corrupted.%06"PFMT64x" %d 0x%"PFMT64x"\n", + r_cons_printf ("f chunk.corrupted.%06"PFMT64x" %d 0x%"PFMT64x"\n", chunkflag, (int)cnk->size, (ut64)prev_chunk); break; case 'g': diff --git a/libr/core/rtr_http.c b/libr/core/rtr_http.c index e38f38edb7..a2dedf30b7 100644 --- a/libr/core/rtr_http.c +++ b/libr/core/rtr_http.c @@ -196,7 +196,7 @@ static int r_core_rtr_http_run(RCore *core, int launch, int browse, const char * } if (r_config_get_b (core->config, "http.channel")) { - // start a new thread with + // start a new thread with // char *res = r_core_cmd_str_r (core, cmd); if (rs) { r_socket_http_response (rs, 200, "TODO", 0, headers); diff --git a/libr/egg/egg_cfile.c b/libr/egg/egg_cfile.c index 9e7397433a..18c0b6fe34 100644 --- a/libr/egg/egg_cfile.c +++ b/libr/egg/egg_cfile.c @@ -196,7 +196,6 @@ static struct cEnv_t* r_egg_cfile_set_cEnv(const char *arch, const char *os, int free (cEnv->LDFLAGS); cEnv->LDFLAGS = strdup (buffer); } - if (r_egg_cfile_check_cEnv (cEnv)) { R_LOG_ERROR ("invalid cEnv allocation"); goto fail; diff --git a/libr/include/r_util/r_print.h b/libr/include/r_util/r_print.h index 832b557baf..58b32359d0 100644 --- a/libr/include/r_util/r_print.h +++ b/libr/include/r_util/r_print.h @@ -100,7 +100,7 @@ typedef struct r_print_t { bool scr_prompt; int (*disasm)(void *p, ut64 addr); PrintfCallback oprintf; - RArchConfig *config; // + RArchConfig *config; int width; int limit; bool histblock; diff --git a/libr/io/io_plugin.c b/libr/io/io_plugin.c index 769831a1bc..d3390bce7d 100644 --- a/libr/io/io_plugin.c +++ b/libr/io/io_plugin.c @@ -38,7 +38,7 @@ R_API bool r_io_plugin_init(RIO *io) { } R_API RIOPlugin *r_io_plugin_resolve(RIO *io, const char *filename, bool many) { - // TODO: optimization + // TODO: optimization if (strstr (filename, "://")) { RIOPlugin *ret; SdbListIter *iter; diff --git a/libr/io/p/io_ihex.c b/libr/io/p/io_ihex.c index 698c1137f7..27ac341dfd 100644 --- a/libr/io/p/io_ihex.c +++ b/libr/io/p/io_ihex.c @@ -268,7 +268,7 @@ static bool ihex_parse(RBuffer *rbuf, char *str) { } cksum += byte; } - if (1) { // || + if (1) { //bool is_seq = (next_addr != addr_tmp) || ((sec_size + bc) > SEC_MAX); //previous block is not contiguous, or //section buffer is full => write a sparse chunk diff --git a/libr/io/p/io_xalz.c b/libr/io/p/io_xalz.c index 02bb8840c5..ab3890ad85 100644 --- a/libr/io/p/io_xalz.c +++ b/libr/io/p/io_xalz.c @@ -22,7 +22,7 @@ static RIODesc *__open(RIO *io, const char *pathname, int rw, int mode) { int consumed; if (data) { ut32 osz = r_read_le32 (data + 8); - // create buffer + // create buffer ut8 *obuf = r_inflate_lz4 ((const ut8*)data + 0xc, (uint32_t) sz - 0xc, &consumed, &outsize); if (obuf) { if (osz != outsize) { diff --git a/libr/magic/d/default/archive b/libr/magic/d/default/archive index 17dbed94e1..9db432bd66 100755 --- a/libr/magic/d/default/archive +++ b/libr/magic/d/default/archive @@ -139,7 +139,7 @@ # # From: Abel Cheung # # Listed here because they are basically zip files # >>30 string mimetype -# +# # # KOffice (1.2 or above) formats # >>>50 string vnd.kde. KOffice (>=1.2) # >>>>58 string karbon Karbon document @@ -150,7 +150,7 @@ # >>>>58 string kpresenter KPresenter document # >>>>58 string kspread KSpread document # >>>>58 string kword KWord document -# +# # # OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7) # >>>50 string vnd.sun.xml. OpenOffice.org 1.x # >>>>62 string writer Writer @@ -167,7 +167,7 @@ # >>>>>69 byte !0x2e presentation # >>>>>69 string .template template # >>>>62 string math Math document -# +# # # OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8) # # http://lists.oasis-open.org/archives/office/200505/msg00006.html # >>>50 string vnd.oasis.opendocument. OpenDocument diff --git a/libr/main/r2pm.c b/libr/main/r2pm.c index ba4831c7da..5c439f340d 100644 --- a/libr/main/r2pm.c +++ b/libr/main/r2pm.c @@ -403,7 +403,7 @@ static int r2pm_clone(const char *pkg) { char *url = r2pm_get (pkg, "\nR2PM_TGZ", TT_TEXTLINE); bool use_c_impl = false; if (use_c_impl) { - R_LOG_INFO ("TODO: wget tarball from '%s'", url); + R_LOG_INFO ("TODO: wget tarball from '%s'", url); } else { // TODO. run wget } diff --git a/libr/parse/c/tcc.h b/libr/parse/c/tcc.h index 7b78e257c3..24797cb3ba 100644 --- a/libr/parse/c/tcc.h +++ b/libr/parse/c/tcc.h @@ -389,7 +389,7 @@ anon_sym: anonymous symbol index int total_bytes; int tok_ident; TokenSym **table_ident; - // + // const char *global_type; const char *global_symname; diff --git a/libr/util/sys_sh.c b/libr/util/sys_sh.c index 575ab2f669..2ffee418f3 100644 --- a/libr/util/sys_sh.c +++ b/libr/util/sys_sh.c @@ -58,7 +58,7 @@ R_API int r_sys_tem_statement(const char *l) { progname = s; } else { r_strbuf_append (sb, " "); - // TODO: replace env vars + // TODO: replace env vars // s = r_str_replace (s, "$FOO", "TMP", 1); r_strbuf_append (sb, s); free (s); diff --git a/sys/lint.sh b/sys/lint.sh index 8a26895cd2..05df0e2bda 100755 --- a/sys/lint.sh +++ b/sys/lint.sh @@ -10,6 +10,7 @@ (git grep -n 'eprintf' libr | grep 'Error:') && exit 1 (git grep -n 'x ""' libr) && exit 1 (git grep -n 'x""' libr) && exit 1 +(git grep -n '\ $' libr) && exit 1 # trailing space (git grep -n '4d""' libr) && exit 1 (git grep -n 'r_core_cmd' libr | grep -v /lang/ | grep '\\n') && exit 1 (git grep -n 'r_str_startswith ("' libr ) && exit 1