xref: /csrg-svn/old/lib2648/bitcopy.c (revision 18803)
111463Sralph /*
2*18803Sdist  * Copyright (c) 1980 Regents of the University of California.
3*18803Sdist  * All rights reserved.  The Berkeley software License Agreement
4*18803Sdist  * specifies the terms and conditions for redistribution.
5*18803Sdist  */
6*18803Sdist 
7*18803Sdist #ifndef lint
8*18803Sdist static char sccsid[] = "@(#)bitcopy.c	5.1 (Berkeley) 04/26/85";
9*18803Sdist #endif not lint
10*18803Sdist 
11*18803Sdist /*
1211463Sralph  * Copy from msrc to mdest.
1311463Sralph  * This is done as it is because it would be much slower to do it
1411463Sralph  * a bit at a time.
1511463Sralph  */
1611463Sralph 
1711463Sralph #include "bit.h"
1811463Sralph 
bitcopy(mdest,msrc,rows,cols)1911463Sralph bitcopy(mdest, msrc, rows, cols)
2011463Sralph bitmat mdest, msrc;
2111463Sralph int rows, cols;
2211463Sralph {
2311463Sralph 	register int size = ((cols + 7) >> 3) * rows;
2411463Sralph 	register char *p, *q;
2511463Sralph 
2611463Sralph 	for (p = &mdest[size], q = &msrc[size]; p>=mdest; )
2711463Sralph 		*--p = *--q;
2811463Sralph }
29