comparison src/c/urweb.c @ 284:77a28e7430bf

intToString
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 10:13:02 -0400
parents c0e4ac23522d
children e89076c41c39
comparison
equal deleted inserted replaced
283:c0e4ac23522d 284:77a28e7430bf
668 if (b == lw_Basis_False) 668 if (b == lw_Basis_False)
669 return (char *)&false; 669 return (char *)&false;
670 else 670 else
671 return (char *)&true; 671 return (char *)&true;
672 } 672 }
673
674 lw_Basis_string lw_Basis_intToString(lw_context ctx, lw_Basis_int n) {
675 int len;
676 char *r;
677
678 lw_check_heap(ctx, INTS_MAX);
679 r = ctx->heap_front;
680 sprintf(r, "%lld%n", n, &len);
681 ctx->heap_front += len+1;
682 return r;
683 }