1
/* Copyright (C) 2000 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
19
dcopy(char *chardest, char *charsrc, int size)
21
register int *src, *dest, intcount ;
22
int startcharcpy, intoffset, numints2cpy, i ;
24
numints2cpy = size >> 2 ;
25
startcharcpy = numints2cpy << 2 ;
26
intcount = numints2cpy & ~(IFACTOR-1) ;
27
intoffset = numints2cpy - intcount ;
29
src = (int *)(((int) charsrc) + intcount*sizeof(int*)) ;
30
dest = (int *)(((int) chardest) + intcount*sizeof(int*)) ;
36
case 0: dest[3] = src[3] ;
37
case 3: dest[2] = src[2] ;
38
case 2: dest[1] = src[1] ;
39
case 1: dest[0] = src[0] ;
43
} while (intcount >= 0) ;
45
/* copy the chars left over by the int copy at the end */
46
for(i=startcharcpy ; i<size ; i++)
47
chardest[i] = charsrc[i] ;