Everything else in this function including its callers and callees uses `int`.
Using `unsigned int` within it was leading to MSVC C4018 warnings.
void makeTree(int depth, int nary, edgefn ef)
{
- unsigned int i, j;
- unsigned int n = (ipow(nary,depth)-1)/(nary-1); /* no. of non-leaf nodes */
- unsigned int idx = 2;
+ int n = (ipow(nary, depth) - 1) / (nary - 1); // no. of non-leaf nodes
+ int idx = 2;
- for (i = 1; i <= n; i++) {
- for (j = 0; j < nary; j++) {
+ for (int i = 1; i <= n; i++) {
+ for (int j = 0; j < nary; j++) {
ef (i, idx++);
}
}