505 |
|
if (h1 < h2) |
506 |
|
return -1; |
507 |
|
return 0; |
508 |
– |
/* |
509 |
– |
return (int)((*(const struct outdir_s *)p1).hent - |
510 |
– |
(*(const struct outdir_s *)p2).hent); |
511 |
– |
*/ |
508 |
|
} |
509 |
|
|
510 |
|
/* Create a new cumulative distribution for the given input direction */ |
726 |
|
int n = 0; |
727 |
|
|
728 |
|
while (next_token(&cp) != '}' && *cp) { |
729 |
< |
if (*cp == '{') |
730 |
< |
return -1; |
731 |
< |
while (*cp && (*cp != ',') & (*cp != '}') & !isspace(*cp)) |
736 |
< |
++cp; |
729 |
> |
while (!isspace(*cp) & (*cp != ',') & (*cp != '}')) |
730 |
> |
if (!*++cp) |
731 |
> |
break; |
732 |
|
++n; |
733 |
|
eat_token(&cp, ','); |
734 |
|
} |
773 |
|
} else { /* else load value grid */ |
774 |
|
int bsiz; |
775 |
|
n = count_values(*spp); /* see how big the grid is */ |
781 |
– |
if (n <= 0) { |
782 |
– |
strcpy(SDerrorDetail, "Bad tensor tree data"); |
783 |
– |
return NULL; |
784 |
– |
} |
776 |
|
for (bsiz = 0; bsiz < 8*sizeof(size_t)-1; bsiz += nd) |
777 |
|
if (1<<bsiz == n) |
778 |
|
break; |