diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-06-23 17:19:16 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-06-23 17:19:16 +0000 |
commit | df1573eb5977ae1db7514ba1acb7427749a22c80 (patch) | |
tree | 50aa38c6d7b204ee09cf5804b13980a37b8f999d /lib | |
parent | b9d84ac6903458f8061c1793a011ce7e2c1ec492 (diff) | |
download | netpbm-mirror-df1573eb5977ae1db7514ba1acb7427749a22c80.tar.gz netpbm-mirror-df1573eb5977ae1db7514ba1acb7427749a22c80.tar.xz netpbm-mirror-df1573eb5977ae1db7514ba1acb7427749a22c80.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1951 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libpbm1.c | 27 | ||||
-rw-r--r-- | lib/libpgm1.c | 20 | ||||
-rw-r--r-- | lib/libppm1.c | 22 | ||||
-rw-r--r-- | lib/pmfileio.c | 4 |
4 files changed, 37 insertions, 36 deletions
diff --git a/lib/libpbm1.c b/lib/libpbm1.c index 25498bc7..c96779ed 100644 --- a/lib/libpbm1.c +++ b/lib/libpbm1.c @@ -57,27 +57,28 @@ pbm_nextimage(FILE *file, int * const eofP) { void -pbm_check(FILE * file, const enum pm_check_type check_type, - const int format, const int cols, const int rows, - enum pm_check_code * const retval_p) { +pbm_check(FILE * const fileP, + enum pm_check_type const checkType, + int const format, + int const cols, + int const rows, + enum pm_check_code * const retvalP) { if (rows < 0) pm_error("Invalid number of rows passed to pbm_check(): %d", rows); if (cols < 0) pm_error("Invalid number of columns passed to pbm_check(): %d", cols); - if (check_type != PM_CHECK_BASIC) { - if (retval_p) *retval_p = PM_CHECK_UNKNOWN_TYPE; + if (checkType != PM_CHECK_BASIC) { + if (retvalP) + *retvalP = PM_CHECK_UNKNOWN_TYPE; } else if (format != RPBM_FORMAT) { - if (retval_p) *retval_p = PM_CHECK_UNCHECKABLE; + if (retvalP) + *retvalP = PM_CHECK_UNCHECKABLE; } else { - pm_filepos const bytes_per_row = (cols+7)/8; - pm_filepos const need_raster_size = rows * bytes_per_row; -#ifdef LARGEFILEDEBUG - pm_message("pm_filepos passed to pm_check() is %u bytes", - sizeof(pm_filepos)); -#endif - pm_check(file, check_type, need_raster_size, retval_p); + pm_filepos const bytesPerRow = (cols+7)/8; + pm_filepos const needRasterSize = rows * bytesPerRow; + pm_check(fileP, checkType, needRasterSize, retvalP); } } diff --git a/lib/libpgm1.c b/lib/libpgm1.c index 5a533f49..987ee04e 100644 --- a/lib/libpgm1.c +++ b/lib/libpgm1.c @@ -338,28 +338,30 @@ pgm_readpgm(FILE * const fileP, void pgm_check(FILE * const file, - enum pm_check_type const check_type, + enum pm_check_type const checkType, int const format, int const cols, int const rows, gray const maxval, - enum pm_check_code * const retval_p) { + enum pm_check_code * const retvalP) { if (rows < 0) pm_error("Invalid number of rows passed to pgm_check(): %d", rows); if (cols < 0) pm_error("Invalid number of columns passed to pgm_check(): %d", cols); - if (check_type != PM_CHECK_BASIC) { - if (retval_p) *retval_p = PM_CHECK_UNKNOWN_TYPE; + if (checkType != PM_CHECK_BASIC) { + if (retvalP) + *retvalP = PM_CHECK_UNKNOWN_TYPE; } else if (PGM_FORMAT_TYPE(format) == PBM_TYPE) { - pbm_check(file, check_type, format, cols, rows, retval_p); + pbm_check(file, checkType, format, cols, rows, retvalP); } else if (format != RPGM_FORMAT) { - if (retval_p) *retval_p = PM_CHECK_UNCHECKABLE; + if (retvalP) + *retvalP = PM_CHECK_UNCHECKABLE; } else { - pm_filepos const bytes_per_row = cols * (maxval > 255 ? 2 : 1); - pm_filepos const need_raster_size = rows * bytes_per_row; + pm_filepos const bytesPerRow = cols * (maxval > 255 ? 2 : 1); + pm_filepos const needRasterSize = rows * bytesPerRow; - pm_check(file, check_type, need_raster_size, retval_p); + pm_check(file, checkType, needRasterSize, retvalP); } } diff --git a/lib/libppm1.c b/lib/libppm1.c index 1b417613..195aec70 100644 --- a/lib/libppm1.c +++ b/lib/libppm1.c @@ -422,30 +422,32 @@ ppm_readppm(FILE * const fileP, void ppm_check(FILE * const fileP, - enum pm_check_type const check_type, + enum pm_check_type const checkType, int const format, int const cols, int const rows, pixval const maxval, - enum pm_check_code * const retval_p) { + enum pm_check_code * const retvalP) { if (rows < 0) pm_error("Invalid number of rows passed to ppm_check(): %d", rows); if (cols < 0) pm_error("Invalid number of columns passed to ppm_check(): %d", cols); - if (check_type != PM_CHECK_BASIC) { - if (retval_p) *retval_p = PM_CHECK_UNKNOWN_TYPE; + if (checkType != PM_CHECK_BASIC) { + if (retvalP) + *retvalP = PM_CHECK_UNKNOWN_TYPE; } else if (PPM_FORMAT_TYPE(format) == PBM_TYPE) { - pbm_check(fileP, check_type, format, cols, rows, retval_p); + pbm_check(fileP, checkType, format, cols, rows, retvalP); } else if (PPM_FORMAT_TYPE(format) == PGM_TYPE) { - pgm_check(fileP, check_type, format, cols, rows, maxval, retval_p); + pgm_check(fileP, checkType, format, cols, rows, maxval, retvalP); } else if (format != RPPM_FORMAT) { - if (retval_p) *retval_p = PM_CHECK_UNCHECKABLE; + if (retvalP) + *retvalP = PM_CHECK_UNCHECKABLE; } else { - pm_filepos const bytes_per_row = cols * 3 * (maxval > 255 ? 2 : 1); - pm_filepos const need_raster_size = rows * bytes_per_row; + pm_filepos const bytesPerRow = cols * 3 * (maxval > 255 ? 2 : 1); + pm_filepos const needRasterSize = rows * bytesPerRow; - pm_check(fileP, check_type, need_raster_size, retval_p); + pm_check(fileP, checkType, needRasterSize, retvalP); } } diff --git a/lib/pmfileio.c b/lib/pmfileio.c index 82b44cdb..1263261a 100644 --- a/lib/pmfileio.c +++ b/lib/pmfileio.c @@ -919,10 +919,6 @@ pm_check(FILE * const file, pm_filepos curpos; /* Current position of file; -1 if none */ int rc; -#ifdef LARGEFILEDEBUG - pm_message("pm_filepos received by pm_check() is %u bytes.", - sizeof(pm_filepos)); -#endif /* Note: FTELLO() is either ftello() or ftell(), depending on the capabilities of the underlying C library. It is defined in pm_config.h. ftello(), in turn, may be either ftell() or |