[BACK]Return to sndioctl.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndioctl

Diff for /src/usr.bin/sndioctl/sndioctl.c between version 1.5 and 1.6

version 1.5, 2020/04/16 12:57:14 version 1.6, 2020/04/27 21:44:47
Line 374 
Line 374 
         switch (p->desc.type) {          switch (p->desc.type) {
         case SIOCTL_NUM:          case SIOCTL_NUM:
         case SIOCTL_SW:          case SIOCTL_SW:
                 printf("%.2g", p->curval / (float)p->desc.maxval);                  if (p->desc.maxval == 1)
                           printf("%d", p->curval);
                   else
                           /*
                            * For now, maxval is always 127 or 255,
                            * so three decimals is always ideal.
                            */
                           printf("%.3f", p->curval / (float)p->desc.maxval);
                 break;                  break;
         case SIOCTL_VEC:          case SIOCTL_VEC:
         case SIOCTL_LIST:          case SIOCTL_LIST:
Line 389 
Line 396 
                         if (more)                          if (more)
                                 printf(",");                                  printf(",");
                         print_node(&e->desc.node1, mono);                          print_node(&e->desc.node1, mono);
                         printf(":%.2g", e->curval / (float)e->desc.maxval);                          if (e->desc.maxval == 1)
                                   printf(":%d", e->curval);
                           else
                                   printf(":%.3f",
                                       e->curval / (float)e->desc.maxval);
                         more = 1;                          more = 1;
                 }                  }
         }          }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6