comparison src/strcpy.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 850242ba4a81
children 697ef44129c6
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
33 33
34 #define MAGIC 0x7efefeff 34 #define MAGIC 0x7efefeff
35 #define HIGH_BIT_P(c) ((c) & hi_bit) 35 #define HIGH_BIT_P(c) ((c) & hi_bit)
36 #define HAS_ZERO(c) (((((c) + magic) ^ (c)) & not_magic) != not_magic) 36 #define HAS_ZERO(c) (((((c) + magic) ^ (c)) & not_magic) != not_magic)
37 37
38 /* CONST IS LOSING, but const is part of the interface of strcpy */
39 char * 38 char *
40 strcpy (char *to, const char *from) 39 strcpy (char *to, const char *from)
41 { 40 {
42 char *return_value = to; 41 char *return_value = to;
43 if (to == from) 42 if (to == from)
54 while ((c = *from1) != 0) 53 while ((c = *from1) != 0)
55 { 54 {
56 if (HAS_ZERO(c)) 55 if (HAS_ZERO(c))
57 { 56 {
58 to = (char *) to1; 57 to = (char *) to1;
59 from = (CONST char *) from1; 58 from = (const char *) from1;
60 goto slow_loop; 59 goto slow_loop;
61 } 60 }
62 else 61 else
63 { 62 {
64 *to1 = c; 63 *to1 = c;