diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-07 05:12:45 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-07 05:12:45 +0000 |
commit | 1bdb731976b708d57a322b0a103b635036041493 (patch) | |
tree | 5dde6ef6d6d4cfbc03557938fdc95c814cf24b6f /converter/pbm/pbmtoplot.c | |
parent | 0818fcd8f2e625fca9a1bb8e57fa41f3265d7534 (diff) | |
download | netpbm-mirror-1bdb731976b708d57a322b0a103b635036041493.tar.gz netpbm-mirror-1bdb731976b708d57a322b0a103b635036041493.tar.xz netpbm-mirror-1bdb731976b708d57a322b0a103b635036041493.zip |
whitespace
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4730 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/pbm/pbmtoplot.c')
-rw-r--r-- | converter/pbm/pbmtoplot.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/converter/pbm/pbmtoplot.c b/converter/pbm/pbmtoplot.c index 8c9075b2..db897bd0 100644 --- a/converter/pbm/pbmtoplot.c +++ b/converter/pbm/pbmtoplot.c @@ -30,13 +30,13 @@ main( argc, argv ) FILE* ifp; register bit** bits; register int row, col, scol; - int rows, cols; + int rows, cols; pbm_init( &argc, argv ); if ( argc > 2 ) - pm_usage( "[pbmfile]" ); + pm_usage( "[pbmfile]" ); ifp = (argc == 2) ? pm_openr( argv[1] ) : stdin; @@ -50,27 +50,30 @@ main( argc, argv ) puttwo( rows - 1 ); puttwo( cols - 1 ); for ( row = 0; row < rows; ++row ) - { - for ( col = 0; col < cols; ++col ) - { - if ( bits[row][col] == PBM_WHITE ) - continue; - scol = col; - while ( ++col < cols && bits[row][col] == PBM_BLACK ) - ; /* nothing */ - --col; - if ( col == scol ) - (void) putchar( 'p' ); - else - { - (void) putchar( 'l' ); - puttwo( scol ); - puttwo( rows - 1 - row ); - } - puttwo( col ); - puttwo( rows - 1 - row ); - } - } + { + for ( col = 0; col < cols; ++col ) + { + if ( bits[row][col] == PBM_WHITE ) + continue; + scol = col; + while ( ++col < cols && bits[row][col] == PBM_BLACK ) + ; /* nothing */ + --col; + if ( col == scol ) + (void) putchar( 'p' ); + else + { + (void) putchar( 'l' ); + puttwo( scol ); + puttwo( rows - 1 - row ); + } + puttwo( col ); + puttwo( rows - 1 - row ); + } + } exit( 0 ); } + + + |