/* includes */ #include "FastCopy.h" void FastCopy (FAST char* Destination, FAST char* Source, FAST int nbytes) { FAST int i = 0; /* do the 64 bit as far as possible */ for (i = 0 ; i < nbytes/8 ; i++) { *((double*)Destination+i)=*((double*)Source+i); } /* do the 32 bit left over if neccessary */ if (nbytes-i*8 == 4) { i *= 2; *((UINT32*)(Destination)+i)=*((UINT32*)(Source)+i); } else { if (nbytes-i*8 != 0) { printf ("ERROR: FastCopy Error ?! \n"); } } } void FastCopyWords (FAST UINT32* Destination, FAST UINT32* Source, FAST int words) { FAST int i = 0; /* do the 64 bit as far as possible */ for (i = 0 ; i < words/2 ; i++) { *((double*)Destination+i)=*((double*)Source+i); } /* do the 32 bit left over if neccessary */ if (words-i*2 == 1) { i *= 2; *(Destination+i)=*(Source+i); } else { if (words-i*2 != 0) { printf ("ERROR: FastCopy Error ?! \n"); } } }