i had to update a program i wrote in 1977 bc the c compiler on my desktop machine no longer recognizes that dialect
@codehappy.bsky.social mostly complications in the compar function for qsort
1977 #clean
compar(c1, c2)
struct count *c1, *c2;
{ int i;
if ((i = c2->cnt - c1->cnt) != 0)
return i;
return c1->chr - c2->chr;
}
today #garbled
int compar(const void *c1, const void *c2)
{ int i;
if ((i = (((struct count *)c2)->cnt - ((struct count *)c1)->cnt)) != 0)
return i;
return ((struct count *)c1)->chr - ((struct count *)c2)->chr;
}