Changes between Version 10 and Version 11 of Hacking


Ignore:
Timestamp:
02/15/11 21:27:38 (13 years ago)
Author:
angel_il
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Hacking

    v10 v11  
    160160}}} 
    161161 
     162Use your best judgement and choose the more readable option. 
     163 
     164'''This is right:''' 
     165{{{ 
     166    bytes = read (fd, &routine.pointer, sizeof (routine)); 
     167    if (bytes == -1 || (size_t) bytes < (sizeof (routine))) 
     168}}} 
     169 
     170'''This is wrong:''' 
     171{{{ 
     172    if (bytes = read (fd, &routine.pointer, sizeof (routine)) == -1 || (size_t) bytes < (sizeof (routine))) 
     173 
     174    if (read (from_parent_fd, &i, sizeof (int)) != sizeof (int)) 
     175        return NULL; 
     176 
     177}}} 
     178 
    162179typical structure of *.c file 
    163180