/[gcl]/gcl/o/print.d
ViewVC logotype

Diff of /gcl/o/print.d

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by camm, Sat Nov 27 22:19:35 2004 UTC revision 1.22 by camm, Fri Jun 10 15:27:20 2005 UTC
# Line 293  object x; Line 293  object x;
293          int j, k;          int j, k;
294    
295          i = (long)x;          i = (long)x;
296          for (j = 8*sizeof(i)-4;  j >= 0;  j -= 4) {          for (j = CHAR_SIZE*sizeof(i)-4;  j >= 0;  j -= 4) {
297                  k = (i>>j) & 0xf;                  k = (i>>j) & 0xf;
298                  if (k < 10)                  if (k < 10)
299                          write_ch('0' + k);                          write_ch('0' + k);
# Line 711  int level; Line 711  int level;
711                  write_str("#<OBJNULL>");                  write_str("#<OBJNULL>");
712                  return;                  return;
713          }          }
714          if (x->d.m == FREE) {          if (is_free(x)) {
715                  write_str("#<FREE OBJECT ");                  write_str("#<FREE OBJECT ");
716                  write_addr(x);                  write_addr(x);
717                  write_str(">");                  write_str(">");
# Line 1414  int level; Line 1414  int level;
1414                  }                  }
1415                  break;                  break;
1416    
1417    #define FRESH_COPY(a_,b_) {(b_)->_mp_alloc=(a_)->_mp_alloc;\
1418                               (b_)->_mp_d=gcl_gmp_alloc((b_)->_mp_alloc*sizeof(*(b_)->_mp_d));\
1419                               (b_)->_mp_size=(a_)->_mp_size;\
1420                               memcpy((b_)->_mp_d,(a_)->_mp_d,(b_)->_mp_alloc*sizeof(*(b_)->_mp_d));}
1421    
1422          case t_random:          case t_random:
1423                  write_str("#$");                  write_str("#$");
1424                  y = alloc_object(t_fixnum);                  y = new_bignum();
1425                  fix(y) = x->rnd.rnd_value;                  FRESH_COPY(x->rnd.rnd_state._mp_seed,MP(y));
1426                    y=normalize_big(y);
1427                  vs_push(y);                  vs_push(y);
1428                  write_object(y, level);                  write_object(y, level);
1429                  vs_popp;                  vs_popp;
# Line 1511  int level; Line 1517  int level;
1517    
1518          case t_spice:          case t_spice:
1519                  write_str("#<\100");                  write_str("#<\100");
1520                  for (i = 8*sizeof(long)-4;  i >= 0;  i -= 4) {                  for (i = CHAR_SIZE*sizeof(long)-4;  i >= 0;  i -= 4) {
1521                          j = ((long)x >> i) & 0xf;                          j = ((long)x >> i) & 0xf;
1522                          if (j < 10)                          if (j < 10)
1523                                  write_ch('0' + j);                                  write_ch('0' + j);

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26