Branch: Tag:

1997-03-07

1997-03-07 05:21:47 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

recursive compiling bug fixed

Rev: src/ChangeLog:1.83
Rev: src/interpret.c:1.28
Rev: src/interpret.h:1.10
Rev: src/memory.c:1.4
Rev: src/pike_types.c:1.17
Rev: src/pike_types.h:1.4
Rev: src/program.c:1.25
Rev: src/version.c:1.12

20:    return 0;   }    + void swap(char *a, char *b, INT32 size) + { +  int tmp; +  char tmpbuf[1024]; +  while(size) +  { +  tmp=MINIMUM((long)sizeof(tmpbuf), size); +  MEMCPY(tmpbuf,a,tmp); +  MEMCPY(b,a,tmp); +  MEMCPY(b,tmpbuf,tmp); +  size-=tmp; +  a+=tmp; +  b+=tmp; +  } + }    -  + void reverse(char *memory, INT32 nitems, INT32 size) + { + #define DOSIZE(X,Y) \ +  case X: \ +  { \ +  struct Y { char tt[X]; }; \ +  struct Y tmp; \ +  struct Y *start=(struct Y *) memory; \ +  struct Y *end=start+nitems-1; \ +  while(start<end){tmp=*start;*(start++)=*end;*(end--)=tmp;} \ +  break; \ +  } +  +  switch(size) +  { +  DOSIZE(1,TMP1) +  DOSIZE(2,TMP2) +  DOSIZE(4,TMP4) +  DOSIZE(8,TMP8) +  default: +  { +  char *start = (char *) memory; +  char *end=start+(nitems-1)*size; +  while(start<end) +  { +  swap(start,end,size); +  start+=size; +  end-=size; +  } +  } +  } + } +    /*    * This function may NOT change 'order'    * This function is hopefully fast enough...
30:    INT32 e;    char *tmp;    tmp=xalloc(size * nitems); -  + #undef DOSIZE   #define DOSIZE(X,Y) \    case X: \    { \