Main Page   Compound List   File List   Compound Members   File Members  

rr_libs/mips_swap.h File Reference

Implementation of swap function. More...

#include "general.h"

Go to the source code of this file.

Defines

#define SWAPFIELD(x)
#define SWAPHALF(x)
#define SWAPWORD(x)
#define SWAPDOUBLE(x)
#define ALWAYS_SWAPFIELD(x)
#define ALWAYS_SWAPHALF(x)
#define ALWAYS_SWAPWORD(x)
#define ALWAYS_SWAPDOUBLE(x)


Detailed Description

Implementation of swap function.

Definition in file mips_swap.h.


Define Documentation

#define ALWAYS_SWAPDOUBLE  
 

Value:

{char tmp_byte;                            \
                               tmp_byte = *((char*)(x)+0); \
                        *((char*)(x)+0) = *((char*)(x)+7); \
                        *((char*)(x)+7) = tmp_byte;        \
                               tmp_byte = *((char*)(x)+1); \
                        *((char*)(x)+1) = *((char*)(x)+6); \
                        *((char*)(x)+6) = tmp_byte;        \
                               tmp_byte = *((char*)(x)+2); \
                        *((char*)(x)+2) = *((char*)(x)+5); \
                        *((char*)(x)+5) = tmp_byte;        \
                               tmp_byte = *((char*)(x)+3); \
                        *((char*)(x)+3) = *((char*)(x)+4); \
                        *((char*)(x)+4) = tmp_byte;        \
                    }

Definition at line 106 of file mips_swap.h.

#define ALWAYS_SWAPFIELD  
 

Value:

{\
                      if      (sizeof(*(x))==sizeof(short)) {SWAPHALF((x))}  \
                      else if (sizeof(*(x))==sizeof(int))   {SWAPWORD((x))}  \
                      else if (sizeof(*(x))==sizeof(double)){SWAPDOUBLE((x))}\
                     }

Definition at line 86 of file mips_swap.h.

#define ALWAYS_SWAPHALF  
 

Value:

{char tmp_byte;                            \
                               tmp_byte = *((char*)(x)+0); \
                        *((char*)(x)+0) = *((char*)(x)+1); \
                        *((char*)(x)+1) = tmp_byte;        \
                    }

Definition at line 92 of file mips_swap.h.

#define ALWAYS_SWAPWORD  
 

Value:

{char tmp_byte;                            \
                               tmp_byte = *((char*)(x)+0); \
                        *((char*)(x)+0) = *((char*)(x)+3); \
                        *((char*)(x)+3) = tmp_byte;        \
                               tmp_byte = *((char*)(x)+1); \
                        *((char*)(x)+1) = *((char*)(x)+2); \
                        *((char*)(x)+2) = tmp_byte;        \
                    }

Definition at line 97 of file mips_swap.h.

#define SWAPDOUBLE  
 

Definition at line 81 of file mips_swap.h.

Referenced by rr_fread(), and rr_fwrite().

#define SWAPFIELD  
 

Definition at line 78 of file mips_swap.h.

#define SWAPHALF  
 

Definition at line 79 of file mips_swap.h.

Referenced by rr_fread(), rr_fwrite(), and write_bin_lm().

#define SWAPWORD  
 

Definition at line 80 of file mips_swap.h.

Referenced by rr_fread(), rr_fwrite(), and write_bin_lm().


Generated on Tue Dec 21 13:54:47 2004 by doxygen1.2.18