diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2018-06-30 20:05:55 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2018-06-30 20:05:55 +0000 |
commit | 81ba0303f29b08507cccad29eecf2b30b012df63 (patch) | |
tree | 981bdae8afd0d4fac5e4834ae2c0b3b9a0462d5a /converter/other/cameratopam/camera.c | |
parent | d9c9d6a198247612248ad094ed7d40dcd4fa9031 (diff) | |
download | netpbm-mirror-81ba0303f29b08507cccad29eecf2b30b012df63.tar.gz netpbm-mirror-81ba0303f29b08507cccad29eecf2b30b012df63.tar.xz netpbm-mirror-81ba0303f29b08507cccad29eecf2b30b012df63.zip |
Promote current Development release as Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3289 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/cameratopam/camera.c')
-rw-r--r-- | converter/other/cameratopam/camera.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/converter/other/cameratopam/camera.c b/converter/other/cameratopam/camera.c index f6196777..439c9413 100644 --- a/converter/other/cameratopam/camera.c +++ b/converter/other/cameratopam/camera.c @@ -1,8 +1,6 @@ #define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */ -#define _BSD_SOURCE - /* Make sure strcasecmp is in string.h */ -#define _XOPEN_SOURCE - /* Make sure putenv is in stdlib.h */ +#define _XOPEN_SOURCE 500 + /* Make sure putenv is in stdlib.h, strcaseeq is in nstring.h */ #include <stdlib.h> #include <string.h> @@ -17,6 +15,7 @@ #include "pm.h" #include "mallocvar.h" #include "pm_c_util.h" +#include "nstring.h" #include "global_variables.h" #include "cameratopam.h" @@ -47,8 +46,8 @@ #define FORC3 for (c=0; c < 3; c++) #define FORC4 for (c=0; c < colors; c++) -static void -merror (const void *ptr, const char *where) +static void +merror (const void *ptr, const char *where) { if (ptr == NULL) pm_error ("Out of memory in %s", where); @@ -57,7 +56,7 @@ merror (const void *ptr, const char *where) -static void +static void adobeCopyPixel(Image const image, unsigned int const row, unsigned int const col, @@ -307,7 +306,7 @@ minolta_z2() void nikon_e2100_load_raw(Image const image) { - + unsigned char data[3432], *dp; unsigned short pixel[2288], *pix; int row, col; @@ -384,7 +383,7 @@ fuji_s3_load_raw(Image const image) { } } -static void +static void fuji_common_load_raw(Image const image, unsigned int const ncol, unsigned int const icol, @@ -1044,7 +1043,7 @@ static void sony_decrypt (unsigned *data, int len, int start, int key) u.bytes[1] = pad[p] >> 16; u.bytes[2] = pad[p] >> 8; u.bytes[3] = pad[p] >> 0; - + pad[p] = u.word; } } @@ -1154,9 +1153,9 @@ static void ciff_block_1030() /* Parse a CIFF file, better known as Canon CRW format. */ -void -parse_ciff(FILE * const ifp, - int const offset, +void +parse_ciff(FILE * const ifp, + int const offset, int const length) { int tboff, nrecs, i, type, len, roff, aoff, save, wbi=-1; @@ -1309,7 +1308,7 @@ parse_rollei(FILE * const ifp) void -parse_mos(FILE * const ifp, +parse_mos(FILE * const ifp, int const offset) { char data[40]; @@ -1358,7 +1357,7 @@ static double getrat() -static void +static void parse_makernote(FILE * const ifp) { unsigned base=0, offset=0, entries, tag, type, len, save; @@ -1504,7 +1503,7 @@ get_timestamp(FILE * const ifp) timestamp = ts; } -static void +static void parse_exif(FILE * const ifp, int base) { int entries, tag, len, val, save; @@ -1529,7 +1528,7 @@ parse_exif(FILE * const ifp, int base) } } -static int +static int parse_tiff_ifd(FILE * const ifp, int base, int level) { unsigned entries, tag, type, len, plen=16, save; @@ -1690,7 +1689,7 @@ guess_cfa_pc: case 50723: /* CameraCalibration1 */ case 50724: /* CameraCalibration2 */ for (i=0; i < colors; i++) - FORC4 cc[i][c] = getrat(); + FORC4 cc[i][c] = getrat(); case 50727: /* AnalogBalance */ FORC4 ab[c] = getrat(); break; @@ -1770,7 +1769,7 @@ parse_external_jpeg(const char * const ifname) strcpy (jname, ifname); jfile = jname + (file - ifname); jext = jname + (ext - ifname); - if (strcasecmp (ext, ".jpg")) { + if (!strcaseeq (ext, ".jpg")) { strcpy (jext, isupper(ext[1]) ? ".JPG":".jpg"); memcpy (jfile, file+4, 4); memcpy (jfile+4, file, 4); |