boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

vsnprintf-int-promo.after (1093B)


      1         /* boot2: track the `l` length modifier so %d / %c read the
      2            correct width. See printf-int-promo.after for rationale. */
      3         int long_p = 0;
      4         if (c == 'l')
      5           {
      6             long_p = 1;
      7             c = *++p;
      8           }
      9         if (c == 'l')
     10           c = *++p;
     11         if (c == 'l')
     12           c = *++p;
     13         switch (c)
     14           {
     15           case '%':
     16             {
     17               if (count < size)
     18                 *str++ = *p;
     19               count++;
     20               break;
     21             }
     22           case 'c':
     23             {
     24               c = va_arg (ap, int);
     25               if (count < size)
     26                 *str++ = c;
     27               count++;
     28               break;
     29             }
     30           case 'd':
     31           case 'i':
     32           case 'o':
     33           case 'u':
     34           case 'x':
     35           case 'X':
     36             {
     37               long d;
     38               if (long_p)
     39                 d = va_arg (ap, long);
     40               else if (c == 'd' || c == 'i' || c == 'o')
     41                 d = va_arg (ap, int);
     42               else
     43                 d = va_arg (ap, unsigned int);