Hello Carsten,

Thursday, May 24, 2012, 4:04:27 AM, you wrote:

CB> this is funny:
CB> In  usb_blaster_read_data:
CB> return !!(buf[0] & READ_TDO);
CB> Why !!? Perhaps already cleaned?

This is just a way to convert the expression to a "boolean". If it was
zero, it remains zero. If it was non-zero, it becomes 1.

I personally would rather write it like this:

  return (buf[0] & READ_TDO) != 0;

But I guess it's just a matter of taste. Both versions likely produce
the same assembly code.

-- 
WBR,
 Igor                            mailto:[email protected]


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to