Fix a few cppcheck warnings.
This commit is contained in:
parent
135231f289
commit
1dc90432cc
|
@ -30,12 +30,12 @@ void uli2a(unsigned long int num, unsigned int base, int uc, char *bf)
|
||||||
d *= base;
|
d *= base;
|
||||||
while (d != 0) {
|
while (d != 0) {
|
||||||
int dgt = num / d;
|
int dgt = num / d;
|
||||||
num %= d;
|
if (n || dgt > 0) {
|
||||||
d /= base;
|
|
||||||
if (n || dgt > 0 || d == 0) {
|
|
||||||
*bf++ = dgt + (dgt < 10 ? '0' : (uc ? 'A' : 'a') - 10);
|
*bf++ = dgt + (dgt < 10 ? '0' : (uc ? 'A' : 'a') - 10);
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
|
num %= d;
|
||||||
|
d /= base;
|
||||||
}
|
}
|
||||||
*bf = 0;
|
*bf = 0;
|
||||||
}
|
}
|
||||||
|
@ -59,12 +59,12 @@ void ui2a(unsigned int num, unsigned int base, int uc, char *bf)
|
||||||
d *= base;
|
d *= base;
|
||||||
while (d != 0) {
|
while (d != 0) {
|
||||||
int dgt = num / d;
|
int dgt = num / d;
|
||||||
num %= d;
|
if (n || dgt > 0) {
|
||||||
d /= base;
|
|
||||||
if (n || dgt > 0 || d == 0) {
|
|
||||||
*bf++ = dgt + (dgt < 10 ? '0' : (uc ? 'A' : 'a') - 10);
|
*bf++ = dgt + (dgt < 10 ? '0' : (uc ? 'A' : 'a') - 10);
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
|
num %= d;
|
||||||
|
d /= base;
|
||||||
}
|
}
|
||||||
*bf = 0;
|
*bf = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue