Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1537 → Rev 1538

/uspace/trunk/libc/generic/string.c
30,6 → 30,7
#include <unistd.h>
#include <ctype.h>
#include <limits.h>
#include <align.h>
 
 
/* Dummy implementation of mem/ functions */
42,10 → 43,30
return s;
}
 
struct along {unsigned long n; } __attribute__ ((packed));
 
static void * unaligned_memcpy(void *dst, const void *src, size_t n)
{
int i, j;
struct along *adst = dst;
const struct along *asrc = src;
 
for (i = 0; i < n/sizeof(unsigned long); i++)
adst[i].n = asrc[i].n;
for (j = 0; j < n%sizeof(unsigned long); j++)
((unsigned char *)(((unsigned long *) dst) + i))[j] = ((unsigned char *)(((unsigned long *) src) + i))[j];
return (char *)src;
}
 
void * memcpy(void *dst, const void *src, size_t n)
{
int i, j;
 
if (((long)dst & (sizeof(long)-1)) || ((long)src & (sizeof(long)-1)))
return unaligned_memcpy(dst, src, n);
 
for (i = 0; i < n/sizeof(unsigned long); i++)
((unsigned long *) dst)[i] = ((unsigned long *) src)[i];
/uspace/trunk/tetris/tetris.c
344,10 → 344,10
(void)printf("Your score: %d point%s x level %d = %d\n",
score, score == 1 ? "" : "s", level, score * level);
else {
(void)printf("Your score: %d point%s x level %d x preview penalty %0.3f = %d\n",
score, score == 1 ? "" : "s", level, (double)PRE_PENALTY,
(int)(score * level * PRE_PENALTY));
score = score * PRE_PENALTY;
/* (void)printf("Your score: %d point%s x level %d x preview penalty %0.3f = %d\n", */
/* score, score == 1 ? "" : "s", level, (double)PRE_PENALTY, */
/* (int)(score * level * PRE_PENALTY)); */
/* score = score * PRE_PENALTY; */
}
savescore(level);