Diff for /gforth/engine/main.c between versions 1.145 and 1.146

version 1.145, 2005/01/22 16:39:59 version 1.146, 2005/01/22 21:06:03
Line 768  static char MAYBE_UNUSED superend[]={ Line 768  static char MAYBE_UNUSED superend[]={
   
 Cell npriminfos=0;  Cell npriminfos=0;
   
   Label goto_start;
   Cell goto_len;
   
 int compare_labels(const void *pa, const void *pb)  int compare_labels(const void *pa, const void *pb)
 {  {
   Label a = *(Label *)pa;    Label a = *(Label *)pa;
Line 798  void check_prims(Label symbols1[]) Line 801  void check_prims(Label symbols1[])
 {  {
   int i;    int i;
 #ifndef NO_DYNAMIC  #ifndef NO_DYNAMIC
   Label *symbols2, *symbols3, *ends1, *ends1j, *ends1jsorted;    Label *symbols2, *symbols3, *ends1, *ends1j, *ends1jsorted, *goto_p;
   int nends1j;    int nends1j;
 #endif  #endif
   
Line 825  void check_prims(Label symbols1[]) Line 828  void check_prims(Label symbols1[])
 #endif  #endif
   ends1 = symbols1+i+1;    ends1 = symbols1+i+1;
   ends1j =   ends1+i;    ends1j =   ends1+i;
     goto_p = ends1j+i+1; /* goto_p[0]==before; ...[1]==after;*/
   nends1j = i+1;    nends1j = i+1;
   ends1jsorted = (Label *)alloca(nends1j*sizeof(Label));    ends1jsorted = (Label *)alloca(nends1j*sizeof(Label));
   memcpy(ends1jsorted,ends1j,nends1j*sizeof(Label));    memcpy(ends1jsorted,ends1j,nends1j*sizeof(Label));
   qsort(ends1jsorted, nends1j, sizeof(Label), compare_labels);    qsort(ends1jsorted, nends1j, sizeof(Label), compare_labels);
   
     /* check whether the "goto *" is relocatable */
     goto_len = goto_p[1]-goto_p[0];
     debugp(stderr, "goto * %p %p len=%ld\n",
            goto_p[0],symbols2[goto_p-symbols1],goto_len);
     if (memcmp(goto_p[0],symbols2[goto_p-symbols1],goto_len)!=0) { /* unequal */
       no_dynamic=1;
       debugp(stderr,"  not relocatable, disabling dynamic code generation\n");
       return;
     }
     goto_start = goto_p[0];
       
   priminfos = calloc(i,sizeof(PrimInfo));    priminfos = calloc(i,sizeof(PrimInfo));
   for (i=0; symbols1[i]!=0; i++) {    for (i=0; symbols1[i]!=0; i++) {

Removed from v.1.145  
changed lines
  Added in v.1.146


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>