… | |
… | |
345 | } smooth_key; |
345 | } smooth_key; |
346 | |
346 | |
347 | static void |
347 | static void |
348 | smooth_or_bits (HV *hv, smooth_key *key, IV bits) |
348 | smooth_or_bits (HV *hv, smooth_key *key, IV bits) |
349 | { |
349 | { |
350 | SV **sv = hv_fetch (hv, (char *)key, sizeof (key), 1); |
350 | SV **sv = hv_fetch (hv, (char *)key, sizeof (*key), 1); |
351 | |
351 | |
352 | if (SvIOK (*sv)) |
352 | if (SvIOK (*sv)) |
353 | SvIV_set (*sv, SvIVX (*sv) | bits); |
353 | SvIV_set (*sv, SvIVX (*sv) | bits); |
354 | else |
354 | else |
355 | sv_setiv (*sv, bits); |
355 | sv_setiv (*sv, bits); |
… | |
… | |
1712 | } |
1712 | } |
1713 | } |
1713 | } |
1714 | } |
1714 | } |
1715 | } |
1715 | } |
1716 | |
1716 | |
1717 | // go through all smoothlevels, lowest to highest, then draw |
1717 | // go through all smoothlevels, lowest to highest, then draw. |
1718 | // this is basically counting sort |
1718 | // this is basically counting sort |
1719 | { |
1719 | { |
1720 | int w, b; |
1720 | int w, b; |
1721 | |
1721 | |
1722 | for (w = 0; w < 256 / 32; ++w) |
1722 | for (w = 0; w < 256 / 32; ++w) |