research/bit_copy.c
static void copyBytes( char *dst, char *src, size_t sz, bool is_little )
{
#ifdef IS_LITTLE_ENDIAN
	if (is_little)
		while (sz-- != 0)
			*(dst++) = *(src+sz);
	else
	{
		src = src+sz-1;
		while (sz-- != 0)
			*(dst++) = *(src-sz);
	}
#else
	int i = 0;
	if (is_little)
		while (sz-- != 0)
			dst[i++] = src[sz];
	else
		while (sz-- != 0)
			dst[MXINT-1-i++] = src[sz];
#endif
}
// Copy byte by byte from one string to another. Honours endianess.
// dst is ALWAYS sizeof( long ) aka. MXINT
Copy byte by byte from one string to another. Honours endianess.
dst is ALWAYS sizeof( long ) aka. MXINT
Copy byte by byte from one string to another . Honours endianess . dst is ALWAYS sizeof ( long ) aka . MXINT
static void copyBytes( char *dst, char *src, size_t sz, bool is_little )
{
#ifdef IS_LITTLE_ENDIAN
	if (is_little)
		while (sz-- != 0)
			*(dst++) = *(src+sz);
	else
	{
		src = src+sz-1;
		while (sz-- != 0)
			*(dst++) = *(src-sz);
	}
#else
	int i = 0;
	if (is_little)
		while (sz-- != 0)
			dst[i++] = src[sz];
	else
		while (sz-- != 0)
			dst[MXINT-1-i++] = src[sz];
#endif
}
static void copyBytes ( char * dst , char * src , size_t sz , bool is_little ) { #ifdef IS_LITTLE_ENDIAN if ( is_little ) while ( sz -- != 0 ) * ( dst ++ ) = * ( src + sz ) ; else { src = src + sz - 1 ; while ( sz -- != 0 ) * ( dst ++ ) = * ( src - sz ) ; } #else int i = 0 ; if ( is_little ) while ( sz -- != 0 ) dst [ i ++ ] = src [ sz ] ; else while ( sz -- != 0 ) dst [ MXINT - 1 - i ++ ] = src [ sz ] ; #endif }
Copy byte by byte from one string to another.
Copy byte by byte from one string to another .