diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-03-20 00:46:50 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-03-20 00:46:50 +0000 |
commit | df95942b93d3ce512391b4c1e6cdfc66a897f98c (patch) | |
tree | 48d7c86903919f14071d3c1b3195e8b03ec14426 /editor | |
parent | 7c693525f2e51e7ac4089dd95f5d1210d86bfbc8 (diff) | |
download | netpbm-mirror-df95942b93d3ce512391b4c1e6cdfc66a897f98c.tar.gz netpbm-mirror-df95942b93d3ce512391b4c1e6cdfc66a897f98c.tar.xz netpbm-mirror-df95942b93d3ce512391b4c1e6cdfc66a897f98c.zip |
Remove arbitrary restriction on size of image with -hilbert
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3762 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rw-r--r-- | editor/pamditherbw.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/pamditherbw.c b/editor/pamditherbw.c index 6ec2511a..1943aa14 100644 --- a/editor/pamditherbw.c +++ b/editor/pamditherbw.c @@ -190,8 +190,6 @@ makeOutputPam(unsigned int const width, /* Hilbert curve tracer */ -#define MAXORD 18 - struct Hil { int order; int ord; @@ -200,7 +198,10 @@ struct Hil { int dy; int x; int y; - int stage[MAXORD]; + int stage[sizeof(unsigned int)*8]; + /* One entry for every bit in the height or width, each of which + is an unsigned int + */ int width; int height; }; @@ -217,8 +218,7 @@ initHilbert(int const w, hilP->height = h; big = w > h ? w : h; for (ber = 2, hilP->order = 1; ber < big; ber <<= 1, hilP->order++); - if (hilP->order > MAXORD) - pm_error("Sorry, hilbert order is too large"); + assert(hilP->order <= ARRAY_SIZE(hilP->stage)); hilP->ord = hilP->order; hilP->order--; } |