qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 4/9] disas: Support the Capstone disassembler


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v4 4/9] disas: Support the Capstone disassembler library
Date: Mon, 2 Oct 2017 14:31:35 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 10/02/2017 10:40 AM, Alex Bennée wrote:
>> +    if (cap_insn == NULL) {
>> +        cap_insn = cs_malloc(*handle);
>> +        if (cap_insn == NULL) {
> 
> if (!cap_insn)?

Eh.  Depends on your philosophy, I suppose.  I'm not especially keen on !
except on boolean expressions.  Though of course both expressions are identical.

>> +        /* If the target memory is not consumed, go back for more... */
>> +        if (size != 0) {
>> +            /* ... taking care to move any remaining fractional insn
>> +               to the beginning of the buffer.  */
>> +            if (csize != 0) {
> 
> Given we are moving stuff and both size/csize are of size_t wouldn't if
> (size > 0) be clearer here?

*shrug* I dunno, would it?  For me, not obviously so.  Of course the two
expressions compile to the same code.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]