Diff for /gforth/engine/main.c between versions 1.252 and 1.253

version 1.252, 2012/07/19 23:32:25 version 1.253, 2012/07/20 00:09:03
Line 68  PER_THREAD Address gforth_UP=NULL; Line 68  PER_THREAD Address gforth_UP=NULL;
 PER_THREAD Cell *gforth_RP;  PER_THREAD Cell *gforth_RP;
 PER_THREAD Address gforth_LP;  PER_THREAD Address gforth_LP;
   
   void gforth_push(Cell n)
   {
     *--gforth_SP=n;
   }
   
   Cell gforth_pop()
   {
     return *gforth_SP++;
   }
   
   void gforth_fpush(Float r)
   {
     *--gforth_FP=r;
   }
   
   Float gforth_fpop()
   {
     return *gforth_FP++;
   }
   
 #ifdef HAS_FFCALL  #ifdef HAS_FFCALL
   
 #include <callback.h>  #include <callback.h>
Line 1960  Address gforth_loader(FILE *imagefile, c Line 1980  Address gforth_loader(FILE *imagefile, c
                           dictsize, data_offset);                            dictsize, data_offset);
   imp=image+preamblesize;    imp=image+preamblesize;
   
   alloc_stacks((ImageHeader *)imp);  
   if (clear_dictionary)    if (clear_dictionary)
     memset(imp+header.image_size, 0, dictsize-header.image_size-preamblesize);      memset(imp+header.image_size, 0, dictsize-header.image_size-preamblesize);
   if(header.base==0 || header.base  == (Address)0x100) {    if(header.base==0 || header.base  == (Address)0x100) {
Line 2334  void* gforth_pointers(Cell n) Line 2353  void* gforth_pointers(Cell n)
   }    }
 }  }
   
 int gforth_main(int argc, char **argv, char **env)  void gforth_init(int argc, char **argv, char **env, char ** path, char ** imagename)
 {  {
 #ifdef HAS_OS  
   char *path = getenv("GFORTHPATH") ? : DEFAULTPATH;  
 #else  
   char *path = DEFAULTPATH;  
 #endif  
 #ifndef INCLUDE_IMAGE  
   char *imagename="gforth.fi";  
   FILE *image_file;  
   Address image;  
 #endif  
   int retvalue;  
 #if 0 && defined(__i386)  #if 0 && defined(__i386)
   /* disabled because the drawbacks may be worse than the benefits */    /* disabled because the drawbacks may be worse than the benefits */
   /* set 387 precision control to use 53-bit mantissae to avoid most    /* set 387 precision control to use 53-bit mantissae to avoid most
Line 2375  int gforth_main(int argc, char **argv, c Line 2383  int gforth_main(int argc, char **argv, c
   prep_terminal();    prep_terminal();
 #endif  #endif
   
   progname = argv[0];  
   
 #ifndef STANDALONE  #ifndef STANDALONE
 #ifdef HAVE_LIBLTDL  #ifdef HAVE_LIBLTDL
   if (lt_dlinit()!=0) {    if (lt_dlinit()!=0) {
Line 2384  int gforth_main(int argc, char **argv, c Line 2390  int gforth_main(int argc, char **argv, c
     exit(1);      exit(1);
   }    }
 #endif  #endif
       
 #ifdef HAS_OS  #ifdef HAS_OS
   gforth_args(argc, argv, &path, &imagename);    gforth_args(argc, argv, path, imagename);
 #ifndef NO_DYNAMIC  #ifndef NO_DYNAMIC
   init_ss_cost();    init_ss_cost();
 #endif /* !defined(NO_DYNAMIC) */  #endif /* !defined(NO_DYNAMIC) */
 #endif /* defined(HAS_OS) */  #endif /* defined(HAS_OS) */
 #endif  #endif
   }
   
   int gforth_main(int argc, char **argv, char **env)
   {
   #ifdef HAS_OS
     char *path = getenv("GFORTHPATH") ? : DEFAULTPATH;
   #else
     char *path = DEFAULTPATH;
   #endif
     int retvalue;
     Address image;
     char *imagename="gforth.fi";
     FILE *image_file;
   
     progname = argv[0];
   
     gforth_init(argc, argv, env, &path, &imagename);
   
   code_here = ((void *)0)+code_area_size;    code_here = ((void *)0)+code_area_size;
 #ifdef STANDALONE  #ifdef STANDALONE
   image = gforth_engine(0, 0, 0, 0, 0 sr_call);    image = gforth_engine(0, 0, 0, 0, 0 sr_call);
   alloc_stacks((ImageHeader *)image);  
 #else  #else
   image_file = open_image_file(imagename, path);    image_file = open_image_file(imagename, path);
   image = gforth_loader(image_file, imagename);    image = gforth_loader(image_file, imagename);
 #endif  #endif
     alloc_stacks((ImageHeader *)image);
   gforth_header=(ImageHeader *)image; /* used in SIGSEGV handler */    gforth_header=(ImageHeader *)image; /* used in SIGSEGV handler */
   
   if (diag)    if (diag)

Removed from v.1.252  
changed lines
  Added in v.1.253


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