Clean up comparisons of different types
Clean up code indentation
1.5 1 Aug 2018 Clean up code style and formatting
Clean up comparisons of different types
Clean up code indentation
1.5 1 Aug 2018 Clean up code style and formatting
-#define INDEX(i,j,k) (((size_t)((i-1)>>1)*((i-2)>>1)+(j>>1)-1)*(g.max-1)+k-1)
+local inline size_t map(int i, int j, int k) {
+ return k - 1 + ((size_t)((i - 1) >> 1) * ((i - 2) >> 1) + (j >> 1) - 1) *
+ (g.max - 1);
+}
// Free allocated space. Uses globals code, num, and done.
local void cleanup(void) {
// Free allocated space. Uses globals code, num, and done.
local void cleanup(void) {
char *vector; // new or enlarged bit vector
// point to vector for (syms,left,len), bit in vector for (mem,rem)
char *vector; // new or enlarged bit vector
// point to vector for (syms,left,len), bit in vector for (mem,rem)
for (left = 2; left < n; left += 2) {
// look at all reachable (root + 1) bit nodes, and the
// resulting codes (complete at root + 2 or more)
for (left = 2; left < n; left += 2) {
// look at all reachable (root + 1) bit nodes, and the
// resulting codes (complete at root + 2 or more)
if (g.root + 1 < g.max && g.num[index]) // reachable node
examine(n, g.root + 1, left, 1 << g.root, 0);
if (g.root + 1 < g.max && g.num[index]) // reachable node
examine(n, g.root + 1, left, 1 << g.root, 0);