/[dynamips]/upstream/dynamips-0.2.7-RC2/utils.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.7-RC2/utils.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.7-RC1/utils.c revision 7 by dpavlin, Sat Oct 6 16:23:47 2007 UTC upstream/dynamips-0.2.7-RC2/utils.c revision 8 by dpavlin, Sat Oct 6 16:24:54 2007 UTC
# Line 452  void mem_bswap32(void *ptr,size_t len) Line 452  void mem_bswap32(void *ptr,size_t len)
452     for(i=0;i<count;i++,p++)     for(i=0;i<count;i++,p++)
453        *p = swap32(*p);        *p = swap32(*p);
454  }  }
455    
456    /* Reverse a byte */
457    m_uint8_t m_reverse_u8(m_uint8_t val)
458    {
459       m_uint8_t res = 0;
460       int i;
461    
462       for(i=0;i<8;i++)
463          if (val & (1 << i))
464             res |= 1 << (7 - i);
465      
466       return(res);
467    }

Legend:
Removed from v.7  
changed lines
  Added in v.8

  ViewVC Help
Powered by ViewVC 1.1.26