This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] arm-tdep.c: Refactor arm_decode_media


Simon Marchi <simon.marchi@ericsson.com> writes:

> -  switch (bits (insn, 20, 24))
> +  uint8_t op1 = bits (insn, 20, 24);
> +  uint8_t rd = bits (insn, 12, 15);
> +  uint8_t op2 = bits (insn, 5, 7);
> +  uint8_t rn = bits (insn, 0, 3);
> +
> +  switch (op1)

op1 is only used once, I prefer using bits (insn, 20, 24) rather than
defining a new variable.

Other variables, like rd and rn, can be defined where they are used.

-- 
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]