/* hours and traffic */
for (i=0;i<=7;i++) {
s=tmax+i+1;
-#if !defined(__OpenBSD__)
- snprintf(matrix[15+i], 81, "%02d %'10"PRIu64" %'10"PRIu64" %02d %'10"PRIu64" %'10"PRIu64" %02d %'10"PRIu64" %'10"PRIu64"",s%24, data.hour[s%24].rx, data.hour[s%24].tx, (s+8)%24, data.hour[(s+8)%24].rx, data.hour[(s+8)%24].tx, (s+16)%24, data.hour[(s+16)%24].rx, data.hour[(s+16)%24].tx);
-#else
- snprintf(matrix[15+i], 81, "%02d %10"PRIu64" %10"PRIu64" %02d %10"PRIu64" %10"PRIu64" %02d %10"PRIu64" %10"PRIu64"",s%24, data.hour[s%24].rx, data.hour[s%24].tx, (s+8)%24, data.hour[(s+8)%24].rx, data.hour[(s+8)%24].tx, (s+16)%24, data.hour[(s+16)%24].rx, data.hour[(s+16)%24].tx);
-#endif
+ snprintf(matrix[15+i], 81, "%02d %"DECCONV"10"PRIu64" %"DECCONV"10"PRIu64" %02d %"DECCONV"10"PRIu64" %"DECCONV"10"PRIu64" %02d %"DECCONV"10"PRIu64" %"DECCONV"10"PRIu64"",s%24, data.hour[s%24].rx, data.hour[s%24].tx, (s+8)%24, data.hour[(s+8)%24].rx, data.hour[(s+8)%24].tx, (s+16)%24, data.hour[(s+16)%24].rx, data.hour[(s+16)%24].tx);
}
/* clean \0 */
if ( (type==2) && (kB==0) ){
snprintf(buffer, 64, "%*s ", len-cfg.unit, "--");
} else {
-#if !defined(__OpenBSD__) && !defined(__NetBSD__)
/* try to figure out what unit to use */
if (kB>=1048576000) { /* 1024*1024*1000 - value >=1000 GiB -> show in TiB */
- snprintf(buffer, 64, "%'*.*f %s", len, declen, kB/(float)1073741824, getunit(4)); /* 1024*1024*1024 */
+ snprintf(buffer, 64, "%"DECCONV"*.*f %s", len, declen, kB/(float)1073741824, getunit(4)); /* 1024*1024*1024 */
} else if (kB>=1024000) { /* 1024*1000 - value >=1000 MiB -> show in GiB */
- snprintf(buffer, 64, "%'*.*f %s", len, declen, kB/(float)1048576, getunit(3)); /* 1024*1024 */
+ snprintf(buffer, 64, "%"DECCONV"*.*f %s", len, declen, kB/(float)1048576, getunit(3)); /* 1024*1024 */
} else if (kB>=1000) {
if (type==2) {
declen=0;
}
- snprintf(buffer, 64, "%'*.*f %s", len, declen, kB/(float)1024, getunit(2));
+ snprintf(buffer, 64, "%"DECCONV"*.*f %s", len, declen, kB/(float)1024, getunit(2));
} else {
- snprintf(buffer, 64, "%'*"PRIu64" %s", len, kB, getunit(1));
+ snprintf(buffer, 64, "%"DECCONV"*"PRIu64" %s", len, kB, getunit(1));
}
-#else
- /* try to figure out what unit to use */
- if (kB>=1048576000) { /* 1024*1024*1000 - value >=1000 GiB -> show in TiB */
- snprintf(buffer, 64, "%*.*f %s", len, declen, kB/(float)1073741824, getunit(4)); /* 1024*1024*1024 */
- } else if (kB>=1024000) { /* 1024*1000 - value >=1000 MiB -> show in GiB */
- snprintf(buffer, 64, "%*.*f %s", len, declen, kB/(float)1048576, getunit(3)); /* 1024*1024 */
- } else if (kB>=1000) {
- if (type==2) {
- declen=0;
- }
- snprintf(buffer, 64, "%*.*f %s", len, declen, kB/(float)1024, getunit(2));
- } else {
- snprintf(buffer, 64, "%*"PRIu64" %s", len, kB, getunit(1));
- }
-#endif
}
return buffer;
len = 1;
}
-#if !defined(__OpenBSD__) && !defined(__NetBSD__)
- /* try to figure out what unit to use */
- if (rate>=limit[2]) {
- snprintf(buffer, 64, "%'*.2f %s", len, rate/(float)limit[2], getrateunit(unit, 4));
- } else if (rate>=limit[1]) {
- snprintf(buffer, 64, "%'*.2f %s", len, rate/(float)limit[1], getrateunit(unit, 3));
- } else if (rate>=limit[0]) {
- snprintf(buffer, 64, "%'*.2f %s", len, rate/(float)limit[0], getrateunit(unit, 2));
- } else {
- snprintf(buffer, 64, "%'*.*f %s", len, declen, rate, getrateunit(unit, 1));
- }
-#else
/* try to figure out what unit to use */
if (rate>=limit[2]) {
- snprintf(buffer, 64, "%*.2f %s", len, rate/(float)limit[2], getrateunit(unit, 4));
+ snprintf(buffer, 64, "%"DECCONV"*.2f %s", len, rate/(float)limit[2], getrateunit(unit, 4));
} else if (rate>=limit[1]) {
- snprintf(buffer, 64, "%*.2f %s", len, rate/(float)limit[1], getrateunit(unit, 3));
+ snprintf(buffer, 64, "%"DECCONV"*.2f %s", len, rate/(float)limit[1], getrateunit(unit, 3));
} else if (rate>=limit[0]) {
- snprintf(buffer, 64, "%*.2f %s", len, rate/(float)limit[0], getrateunit(unit, 2));
+ snprintf(buffer, 64, "%"DECCONV"*.2f %s", len, rate/(float)limit[0], getrateunit(unit, 2));
} else {
- snprintf(buffer, 64, "%*.*f %s", len, declen, rate, getrateunit(unit, 1));
+ snprintf(buffer, 64, "%"DECCONV"*.*f %s", len, declen, rate, getrateunit(unit, 1));
}
-#endif
return buffer;
}