Diff for /gforth/prim between versions 1.37 and 1.40

version 1.37, 1999/08/07 21:40:35 version 1.40, 1999/11/08 22:01:09
Line 488  the first string is smaller, @i{n} is -1 Line 488  the first string is smaller, @i{n} is -1
 is 1. Currently this is based on the machine's character  is 1. Currently this is based on the machine's character
 comparison. In the future, this may change to consider the current  comparison. In the future, this may change to consider the current
 locale and its collation order.""  locale and its collation order.""
 #ifdef MEMCMP_AS_SUBROUTINE  
 n = gforth_memcmp(c_addr1, c_addr2, u1<u2 ? u1 : u2);  
 #else  
 n = memcmp(c_addr1, c_addr2, u1<u2 ? u1 : u2);  n = memcmp(c_addr1, c_addr2, u1<u2 ? u1 : u2);
 #endif  
 if (n==0)  if (n==0)
   n = u1-u2;    n = u1-u2;
 if (n<0)  if (n<0)
Line 509  else if (n>0) Line 505  else if (n>0)
  THEN ;   THEN ;
   
 -text           c_addr1 u c_addr2 -- n  new     dash_text  -text           c_addr1 u c_addr2 -- n  new     dash_text
 #ifdef MEMCMP_AS_SUBROUTINE  
 n = gforth_memcmp(c_addr1, c_addr2, u);  
 #else  
 n = memcmp(c_addr1, c_addr2, u);  n = memcmp(c_addr1, c_addr2, u);
 #endif  
 if (n<0)  if (n<0)
   n = -1;    n = -1;
 else if (n>0)  else if (n>0)
Line 1274  while(a_addr != NULL) Line 1266  while(a_addr != NULL)
    f83name1=(struct F83Name *)(a_addr[1]);     f83name1=(struct F83Name *)(a_addr[1]);
    a_addr=(Cell *)(a_addr[0]);     a_addr=(Cell *)(a_addr[0]);
    if ((UCell)F83NAME_COUNT(f83name1)==u &&     if ((UCell)F83NAME_COUNT(f83name1)==u &&
 #ifdef MEMCMP_AS_SUBROUTINE  
        gforth_memcmp(c_addr, f83name1->name, u)== 0 /* or inline? */)  
 #else  
        memcmp(c_addr, f83name1->name, u)== 0 /* or inline? */)         memcmp(c_addr, f83name1->name, u)== 0 /* or inline? */)
 #endif  
      {       {
         f83name2=f83name1;          f83name2=f83name1;
         break;          break;
Line 1361  f_addr = (Float *)((((Cell)c_addr)+(size Line 1349  f_addr = (Float *)((((Cell)c_addr)+(size
  [ 1 floats 1- ] Literal + [ -1 floats ] Literal and ;   [ 1 floats 1- ] Literal + [ -1 floats ] Literal and ;
   
 >body           xt -- a_addr    core    to_body  >body           xt -- a_addr    core    to_body
   "" Get the address of the body of the word represented by @i{xt} (the address
   of the word's data field).""
 a_addr = PFA(xt);  a_addr = PFA(xt);
 :  :
     2 cells + ;      2 cells + ;
Line 1675  else { Line 1665  else {
 }  }
   
 \+  \+
 \+file  
   
 write-file      c_addr u1 wfileid -- wior       file    write_file  write-file      c_addr u1 wfileid -- wior       file    write_file
 /* !! fwrite does not guarantee enough */  /* !! fwrite does not guarantee enough */
   #ifdef HAS_FILE
 {  {
   UCell u2 = fwrite(c_addr, sizeof(Char), u1, (FILE *)wfileid);    UCell u2 = fwrite(c_addr, sizeof(Char), u1, (FILE *)wfileid);
   wior = FILEIO(u2<u1 && ferror((FILE *)wfileid));    wior = FILEIO(u2<u1 && ferror((FILE *)wfileid));
   if (wior)    if (wior)
     clearerr((FILE *)wfileid);      clearerr((FILE *)wfileid);
 }  }
   #else
 \+  TYPE(c_addr, u1);
   #endif
   
 emit-file       c wfileid -- wior       gforth  emit_file  emit-file       c wfileid -- wior       gforth  emit_file
 #ifdef HAS_FILE  #ifdef HAS_FILE
Line 1873  internal floating-point representation. Line 1864  internal floating-point representation.
 represents a valid floating-point number @i{r} is placed  represents a valid floating-point number @i{r} is placed
 on the floating-point stack and @i{flag} is true. Otherwise,  on the floating-point stack and @i{flag} is true. Otherwise,
 @i{flag} is false. A string of blanks is a special case  @i{flag} is false. A string of blanks is a special case
 and represents the flotaing-point number 0.""  and represents the floating-point number 0.""
 /* real signature: c_addr u -- r t / f */  /* real signature: c_addr u -- r t / f */
 Float r;  Float r;
 char *number=cstr(c_addr, u, 1);  char *number=cstr(c_addr, u, 1);

Removed from v.1.37  
changed lines
  Added in v.1.40


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