Back to index

radiance  4R0+20100331
Functions | Variables
byteswap.c File Reference
#include "copyright.h"
#include "rtio.h"

Go to the source code of this file.

Functions

void swap16 (register char *wp, int n)
void swap32 (register char *wp, int n)
void swap64 (register char *wp, int n)

Variables

static const char RCSid [] = "$Id: byteswap.c,v 3.1 2006/12/23 17:27:45 greg Exp $"

Function Documentation

void swap16 ( register char *  wp,
int  n 
)

Definition at line 14 of file byteswap.c.

{
       register int  t;

       while (n-- > 0) {
              t = wp[0]; wp[0] = wp[1]; wp[1] = t;
              wp += 2;
       }
}

Here is the caller graph for this function:

void swap32 ( register char *  wp,
int  n 
)

Definition at line 29 of file byteswap.c.

{
       register int  t;

       while (n-- > 0) {
              t = wp[0]; wp[0] = wp[3]; wp[3] = t;
              t = wp[1]; wp[1] = wp[2]; wp[2] = t;
              wp += 4;
       }
}

Here is the caller graph for this function:

void swap64 ( register char *  wp,
int  n 
)

Definition at line 45 of file byteswap.c.

{
       register int  t;

       while (n-- > 0) {
              t = wp[0]; wp[0] = wp[7]; wp[7] = t;
              t = wp[1]; wp[1] = wp[6]; wp[6] = t;
              t = wp[2]; wp[2] = wp[5]; wp[5] = t;
              t = wp[3]; wp[3] = wp[4]; wp[4] = t;
              wp += 8;
       }
}

Here is the caller graph for this function:


Variable Documentation

const char RCSid[] = "$Id: byteswap.c,v 3.1 2006/12/23 17:27:45 greg Exp $" [static]

Definition at line 2 of file byteswap.c.