skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

int64_fmt_generic.c (266B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/uint64.h>
      4 
      5 size_t int64_fmt_generic (char *fmt, int64_t d, uint8_t base)
      6 {
      7   if (d >= 0) return uint64_fmt_generic(fmt, (uint64_t)d, base) ;
      8   if (fmt) *fmt++ = '-' ;
      9   return 1 + uint64_fmt_generic(fmt, -(uint64_t)d, base) ;
     10 }