123456789101112131415161718192021222324252627282930313233343536373839 |
- extern char *__ulltostr(char *buf, unsigned long long uval, int base,
- int uppercase);
- char *__lltostr(char *buf, long long val, int base, int uppercase)
- {
- unsigned long long uval;
- char *pos;
- int negative;
- negative = 0;
- if (val < 0) {
- negative = 1;
- uval = ((unsigned long long)(-(1+val))) + 1;
- } else {
- uval = val;
- }
- pos = __ulltostr(buf, uval, base, uppercase);
- if (pos && negative) {
- *--pos = '-';
- }
- return pos;
- }
|