X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fprint.c;h=cdb75af338292099fe928d88f46dbad8b3398ea2;hp=73f0960d9e670a0ea754e64de3b9aeb8988d110d;hb=82f6d62ee211b1d36e8f45fed3ee3edde82b6916;hpb=a40368ea9486a5da02004feb1254b9cceb857228 diff --git a/src/print.c b/src/print.c index 73f0960..cdb75af 100644 --- a/src/print.c +++ b/src/print.c @@ -935,18 +935,19 @@ float_to_string (char *buf, double data) } #endif /* LISP_FLOAT_TYPE */ -/* Print NUMBER to BUFFER. This is equivalent to sprintf(buffer, - "%ld", number), only much faster. +/* Print NUMBER to BUFFER. + This is equivalent to sprintf (buffer, "%ld", number), only much faster. BUFFER should accept 24 bytes. This should suffice for the longest numbers on 64-bit machines, including the `-' sign and the trailing - \0. */ -void + '\0'. Returns a pointer to the trailing '\0'. */ +char * long_to_string (char *buffer, long number) { #if (SIZEOF_LONG != 4) && (SIZEOF_LONG != 8) /* Huh? */ sprintf (buffer, "%ld", number); + return buffer + strlen (buffer); #else /* (SIZEOF_LONG == 4) || (SIZEOF_LONG == 8) */ char *p = buffer; int force = 0; @@ -984,6 +985,7 @@ long_to_string (char *buffer, long number) #undef FROB *p++ = number + '0'; *p = '\0'; + return p; #endif /* (SIZEOF_LONG == 4) || (SIZEOF_LONG == 8) */ } @@ -1420,6 +1422,7 @@ print_symbol (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) write_char_internal ("#", printcharfun); print_internal (XCDR (tem), printcharfun, escapeflag); write_char_internal ("#", printcharfun); + UNGCPRO; return; } else