From 853d1761ee6b8796373a977603b31707b9c6459d Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 16 May 2015 01:53:28 +0000 Subject: Add and use pbm_cleanrowend_packed git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2488 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pbmclean.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'editor/pbmclean.c') diff --git a/editor/pbmclean.c b/editor/pbmclean.c index 6d813090..46e7dee6 100644 --- a/editor/pbmclean.c +++ b/editor/pbmclean.c @@ -361,10 +361,8 @@ setupInputBuffers(FILE * const ifP, pbm_readpbmrow_packed(ifP, nextRow, cols, format); - if (cols % 8 > 0){ - nextRow[pbm_packed_bytes(cols) -1 ] >>= (8 - cols % 8); - nextRow[pbm_packed_bytes(cols) -1 ] <<= (8 - cols % 8); - } + pbm_cleanrowend_packed(nextRow, cols); + *bufferP = buffer; *edgeRowP = edgeRow; *thisRowP = &edgeRow[1]; @@ -418,10 +416,8 @@ cleanSimple(FILE * const ifP, handling of the initial edgerow. */ pbm_readpbmrow_packed(ifP, nextRow, cols, format); - if (cols % 8 > 0){ - nextRow[pbm_packed_bytes(cols) -1 ] >>= (8 - cols % 8); - nextRow[pbm_packed_bytes(cols) -1 ] <<= (8 - cols % 8); - } + pbm_cleanrowend_packed(nextRow, cols); + } else /* Bottom of image. */ nextRow = &edgeRow[1]; -- cgit 1.4.1