1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

sprintf.c: ruby_ultoa

* sprintf.c (ruby_ultoa): prefixed to get rid of conflict with
  a MSVC library function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-04-28 05:08:44 +00:00
parent fb7c7d1e79
commit efdc6d78ac

View file

@ -24,7 +24,7 @@
#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */
static char *fmt_setup(char*,size_t,int,int,int,int);
static char *ultoa(unsigned long val, char *endp, int base, int octzero);
static char *ruby_ultoa(unsigned long val, char *endp, int base, int octzero);
static char
sign_bits(int base, const char *p)
@ -939,7 +939,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
sc = ' ';
width--;
}
s = ultoa((unsigned long)v, nbuf + sizeof(nbuf), 10, 0);
s = ruby_ultoa((unsigned long)v, nbuf + sizeof(nbuf), 10, 0);
len = (int)(nbuf + sizeof(nbuf) - s);
}
else {
@ -1200,12 +1200,12 @@ fmt_setup(char *buf, size_t size, int c, int flags, int width, int prec)
*--buf = c;
if (flags & FPREC) {
buf = ultoa(prec, buf, 10, 0);
buf = ruby_ultoa(prec, buf, 10, 0);
*--buf = '.';
}
if (flags & FWIDTH) {
buf = ultoa(width, buf, 10, 0);
buf = ruby_ultoa(width, buf, 10, 0);
}
if (flags & FSPACE) *--buf = ' ';
@ -1248,7 +1248,7 @@ fmt_setup(char *buf, size_t size, int c, int flags, int width, int prec)
#include "vsnprintf.c"
static char *
ultoa(unsigned long val, char *endp, int base, int flags)
ruby_ultoa(unsigned long val, char *endp, int base, int flags)
{
const char *xdigs = lower_hexdigits;
int octzero = flags & FSHARP;