Changeset 7f079d9 in mainline
- Timestamp:
- 2006-06-03T01:24:33Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0861786
- Parents:
- 6c46350
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/string.c
r6c46350 r7f079d9 31 31 #include <ctype.h> 32 32 #include <limits.h> 33 #include <align.h> 33 34 34 35 … … 43 44 } 44 45 46 struct along {unsigned long n; } __attribute__ ((packed)); 47 48 static void * unaligned_memcpy(void *dst, const void *src, size_t n) 49 { 50 int i, j; 51 struct along *adst = dst; 52 const struct along *asrc = src; 53 54 for (i = 0; i < n/sizeof(unsigned long); i++) 55 adst[i].n = asrc[i].n; 56 57 for (j = 0; j < n%sizeof(unsigned long); j++) 58 ((unsigned char *)(((unsigned long *) dst) + i))[j] = ((unsigned char *)(((unsigned long *) src) + i))[j]; 59 60 return (char *)src; 61 } 62 45 63 void * memcpy(void *dst, const void *src, size_t n) 46 64 { 47 65 int i, j; 66 67 if (((long)dst & (sizeof(long)-1)) || ((long)src & (sizeof(long)-1))) 68 return unaligned_memcpy(dst, src, n); 48 69 49 70 for (i = 0; i < n/sizeof(unsigned long); i++) -
tetris/tetris.c
r6c46350 r7f079d9 345 345 score, score == 1 ? "" : "s", level, score * level); 346 346 else { 347 (void)printf("Your score: %d point%s x level %d x preview penalty %0.3f = %d\n", 348 score, score == 1 ? "" : "s", level, (double)PRE_PENALTY, 349 (int)(score * level * PRE_PENALTY)); 350 score = score * PRE_PENALTY; 347 /* (void)printf("Your score: %d point%s x level %d x preview penalty %0.3f = %d\n", */ 348 /* score, score == 1 ? "" : "s", level, (double)PRE_PENALTY, */ 349 /* (int)(score * level * PRE_PENALTY)); */ 350 /* score = score * PRE_PENALTY; */ 351 351 } 352 352 savescore(level);
Note:
See TracChangeset
for help on using the changeset viewer.