[riot-notifications] [RIOT] C++11 compatibility (#193)

BytesGalore notifications at github.com
Wed Nov 27 06:34:06 CET 2013


> @@ -211,8 +211,8 @@ uint8_t transceiver_register(transceiver_type_t t, int pid)
>  {
>      uint8_t i;
>  
> -    for (i = 0; ((reg[i].pid != pid) &&
> -                (i < TRANSCEIVER_MAX_REGISTERED) &&
> +    for (i = 0; ((i < TRANSCEIVER_MAX_REGISTERED) &&
> +                (reg[i].pid != pid) &&

It changes the order of checking and accessing reg[i].pid . 
It first checks if i is inside the bound and then let you access reg[i].pid
This prevents vou accidently accessing a field in nirvana.

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/193/files#r7948711
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20131126/6404220b/attachment.html>


More information about the notifications mailing list