Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

whats the purpose of this C function

Name: Anonymous 2007-09-12 5:22 ID:wfxixJ2g

Excuse my newfagedry

Consider the C code function below:
void qwerty(int *x, int *y, int size)
{
 int k=0;
 while ( k < size ) {
    *(x + k) = *(y + k);
    k++;
 }
}

i) What best describes the purpose of the function qwerty?

Name: Anonymous 2007-09-13 14:23 ID:381I8pvJ

void qwerty(int *x, int *y, size_t s){
 size_t t, l = sizeof(uint64_t)/sizeof(int), size_t m = l - 1;
 if((y | x) & m){
  if((y ^ x) & m || s < l)
   t = s;
  else
   t = l - (y & m);
  s -= t;
  do{
   *x++ = *y++;
  }while(--t);
  t = s / l;
  if(t)
   do{
    *(uint64_t*)x = *(uint64_t*)y; x += l; y += l;
   }while(--t);
  t = s & m;
  if(t)
   do{
    *x++ = *y++;
   }while(--t);
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List