### Diff for /gforth/prim between versions 1.195 and 1.197

version 1.195, 2006/06/09 15:51:24 version 1.197, 2006/10/21 22:13:48
Line 809  n = n1*n2; Line 809  n = n1*n2;

/       ( n1 n2 -- n )          core    slash  /       ( n1 n2 -- n )          core    slash
n = n1/n2;  n = n1/n2;
if(FLOORED_DIV && ((n1^n2) < 0) && (n1%n2 != 0)) n--;  if (CHECK_DIVISION && (n2 == 0))
throw(-10);
if (CHECK_DIVISION && n2 == -1 && n1 == CELL_MIN)
throw(-11);
if (FLOORED_DIV && ((n1^n2) < 0) && (n1%n2 != 0))
n--;
:  :
/mod nip ;   /mod nip ;

mod     ( n1 n2 -- n )          core  mod     ( n1 n2 -- n )          core
n = n1%n2;  n = n1%n2;
if (CHECK_DIVISION && (n2 == 0))
throw(-10);
if (CHECK_DIVISION && n2 == -1 && n1 == CELL_MIN)
throw(-11);
if(FLOORED_DIV && ((n1^n2) < 0) && n!=0) n += n2;  if(FLOORED_DIV && ((n1^n2) < 0) && n!=0) n += n2;
:  :
/mod drop ;   /mod drop ;
Line 822  if(FLOORED_DIV && ((n1^n2) < 0) && n!=0) Line 831  if(FLOORED_DIV && ((n1^n2) < 0) && n!=0)
/mod    ( n1 n2 -- n3 n4 )              core            slash_mod  /mod    ( n1 n2 -- n3 n4 )              core            slash_mod
n4 = n1/n2;  n4 = n1/n2;
n3 = n1%n2; /* !! is this correct? look into C standard! */  n3 = n1%n2; /* !! is this correct? look into C standard! */
if (CHECK_DIVISION && (n2 == 0))
throw(-10);
if (CHECK_DIVISION && n2 == -1 && n1 == CELL_MIN)
throw(-11);
if (FLOORED_DIV && ((n1^n2) < 0) && n3!=0) {  if (FLOORED_DIV && ((n1^n2) < 0) && n3!=0) {
n4--;    n4--;
n3+=n2;    n3+=n2;
Line 2766  ffi-ret-dlong ( d -- ) gforth ffi_ret_dl Line 2779  ffi-ret-dlong ( d -- ) gforth ffi_ret_dl
return 0;  return 0;

ffi-ret-long ( n -- )   gforth ffi_ret_long  ffi-ret-long ( n -- )   gforth ffi_ret_long
#ifdef BUGGY_LONG_LONG
*(Cell*)(gforth_ritem) = DLO(n);
#else
*(Cell*)(gforth_ritem) = n;  *(Cell*)(gforth_ritem) = n;
#endif
return 0;  return 0;

ffi-ret-ptr ( c_addr -- )       gforth ffi_ret_ptr  ffi-ret-ptr ( c_addr -- )       gforth ffi_ret_ptr

 Removed from v.1.195 changed lines Added in v.1.197

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