[BACK]Return to subr_prf.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / lib / libsa

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/lib/libsa/subr_prf.c between version 1.21.12.2 and 1.22

version 1.21.12.2, 2017/12/03 11:38:46 version 1.22, 2013/12/24 21:41:49
Line 79  const char hexdigits[16] = "0123456789ab
Line 79  const char hexdigits[16] = "0123456789ab
 #define ZEROPAD         0x40  #define ZEROPAD         0x40
 #define NEGATIVE        0x80  #define NEGATIVE        0x80
 #define KPRINTN(base)   kprintn(put, ul, base, lflag, width)  #define KPRINTN(base)   kprintn(put, ul, base, lflag, width)
 #define RADJUSTZEROPAD()                                        \  #define RZERO()                                                 \
 do {                                                            \  do {                                                            \
         if ((lflag & (ZEROPAD|LADJUST)) == ZEROPAD) {           \          if ((lflag & (ZEROPAD|LADJUST)) == ZEROPAD) {           \
                 while (width-- > 0)                             \                  while (width-- > 0)                             \
                         put('0');                               \                          put('0');                               \
         }                                                       \          }                                                       \
 } while (/*CONSTCOND*/0)  } while (/*CONSTCOND*/0)
 #define LADJUSTPAD()                                            \  #define RPAD()                                                  \
 do {                                                            \  do {                                                            \
         if (lflag & LADJUST) {                                  \          if (lflag & LADJUST) {                                  \
                 while (width-- > 0)                             \                  while (width-- > 0)                             \
                         put(' ');                               \                          put(' ');                               \
         }                                                       \          }                                                       \
 } while (/*CONSTCOND*/0)  } while (/*CONSTCOND*/0)
 #define RADJUSTPAD()                                            \  #define LPAD()                                                  \
 do {                                                            \  do {                                                            \
         if ((lflag & (ZEROPAD|LADJUST)) == 0) {                 \          if ((lflag & (ZEROPAD|LADJUST)) == 0) {                 \
                 while (width-- > 0)                             \                  while (width-- > 0)                             \
Line 102  do {        \
Line 102  do {        \
 } while (/*CONSTCOND*/0)  } while (/*CONSTCOND*/0)
 #else   /* LIBSA_PRINTF_WIDTH_SUPPORT */  #else   /* LIBSA_PRINTF_WIDTH_SUPPORT */
 #define KPRINTN(base)   kprintn(put, ul, base)  #define KPRINTN(base)   kprintn(put, ul, base)
 #define RADJUSTZEROPAD()        /**/  #define RZERO()         /**/
 #define LADJUSTPAD()            /**/  #define RPAD()          /**/
 #define RADJUSTPAD()            /**/  #define LPAD()          /**/
 #endif  /* LIBSA_PRINTF_WIDTH_SUPPORT */  #endif  /* LIBSA_PRINTF_WIDTH_SUPPORT */
   
 #ifdef LIBSA_PRINTF_LONGLONG_SUPPORT  #ifdef LIBSA_PRINTF_LONGLONG_SUPPORT
Line 214  reswitch:
Line 214  reswitch:
                                 lflag |= LONG;                                  lflag |= LONG;
                         goto reswitch;                          goto reswitch;
                 case 'j':                  case 'j':
 #ifdef LIBSA_PRINTF_LONGLONG_SUPPORT  
                         if (sizeof(intmax_t) == sizeof(long long))  
                                 lflag |= LLONG;  
                         else  
 #endif  
                         if (sizeof(intmax_t) == sizeof(long))                          if (sizeof(intmax_t) == sizeof(long))
                                 lflag |= LONG;                                  lflag |= LONG;
                         goto reswitch;                          goto reswitch;
Line 235  reswitch:
Line 230  reswitch:
 #ifdef LIBSA_PRINTF_WIDTH_SUPPORT  #ifdef LIBSA_PRINTF_WIDTH_SUPPORT
                         --width;                          --width;
 #endif  #endif
                         RADJUSTPAD();                          RPAD();
                         put(ch & 0xFF);                          put(ch & 0xFF);
                         LADJUSTPAD();                          LPAD();
                         break;                          break;
                 case 's':                  case 's':
                         p = va_arg(ap, char *);                          p = va_arg(ap, char *);
Line 246  reswitch:
Line 241  reswitch:
                                 continue;                                  continue;
                         width -= q - p;                          width -= q - p;
 #endif  #endif
                         RADJUSTPAD();                          RPAD();
                         while ((ch = (unsigned char)*p++))                          while ((ch = (unsigned char)*p++))
                                 put(ch);                                  put(ch);
                         LADJUSTPAD();                          LPAD();
                         break;                          break;
                 case 'd':                  case 'd':
                         ul =                          ul =
Line 327  kprintn(void (*put)(int), UINTMAX_T ul, 
Line 322  kprintn(void (*put)(int), UINTMAX_T ul, 
         else if (lflag & SPACE)          else if (lflag & SPACE)
                 *p++ = ' ';                  *p++ = ' ';
         width -= p - buf;          width -= p - buf;
         if (lflag & ZEROPAD) {          if ((lflag & LADJUST) == 0) {
                 while (p > q)                  while (p > q)
                         put(*--p);                          put(*--p);
         }          }
 #endif  #endif
         RADJUSTPAD();          RPAD();
         RADJUSTZEROPAD();          RZERO();
         do {          do {
                 put(*--p);                  put(*--p);
         } while (p > buf);          } while (p > buf);
         LADJUSTPAD();          LPAD();
 }  }

Legend:
Removed from v.1.21.12.2  
changed lines
  Added in v.1.22

CVSweb <webmaster@jp.NetBSD.org>