Browse Source

- fixed some warnings

tags/v0.2.0
andreas.romeyke@slub-dresden.de 4 years ago
parent
commit
1ee658fe43
2 changed files with 12 additions and 4 deletions
  1. +2
    -1
      src/tagrules/check_icc.c
  2. +10
    -3
      src/tagrules/check_tag_has_valuelist.c

+ 2
- 1
src/tagrules/check_icc.c View File

@@ -64,8 +64,9 @@ ret_t check_icc(ctiff_t * ctif ) {
unsigned long errsize = ERRSIZE;
int ret = parse_icc(icc_profile_size, icc_profile, errsize, errmessage);
if (0 != ret) {
return tif_fails_tag( TIFFTAG_ICCPROFILE, "pointing to valid ICC profile", strdup(errmessage));
return tif_fails_tag( TIFFTAG_ICCPROFILE, "pointing to valid ICC profile", errmessage);
}
free (errmessage);
ret_t res;
res.returnmsg=NULL;
res.returncode=0;


+ 10
- 3
src/tagrules/check_tag_has_valuelist.c View File

@@ -18,11 +18,16 @@
ret_t check_tag_has_valuelist(ctiff_t * ctif, tag_t tag, int count, unsigned int * values) {
//printf("check if tag %u (%s) has these %i-values", tag, TIFFTagName(tif, tag), count);
tifp_check( ctif);
if (count < 0) {
perror ("count should be positive!");
exit( EXIT_FAILURE );
}
char msg[EXPECTSTRLEN];
snprintf(msg, sizeof(msg), "has these %i-values: ", count);
unsigned int * p = values;
for (int i=0; i< count; i++) {
if (0 < i) secstrcat (msg, ", ", EXPECTSTRLEN);
if (0 < i) { secstrcat (msg, ", ", EXPECTSTRLEN);
}
secstrcat (msg, int2str(*p), EXPECTSTRLEN);
p++;
}
@@ -67,8 +72,9 @@ ret_t check_tag_has_valuelist(ctiff_t * ctif, tag_t tag, int count, unsigned int
uint32 * p = offset.data32p;
for (int i=0; i< count; i++) {
uint32 pval = *p;
if (is_byteswapped(ctif))
if (is_byteswapped(ctif)) {
TIFFSwabLong(&pval);
}
#ifdef DEBUG
printf("OFFSET: v[%i]=%u p[%i]=%u\n", i,v[i],i,pval);
#endif
@@ -107,8 +113,9 @@ ret_t check_tag_has_valuelist(ctiff_t * ctif, tag_t tag, int count, unsigned int
uint16 * p = offset.data16p;
for (int i=0; i< count; i++) {
uint16 pval = *p;
if (is_byteswapped(ctif))
if (is_byteswapped(ctif)) {
TIFFSwabShort(&pval);
}
#ifdef DEBUG
printf("OFFSET: v[%i]=%u p[%i]=%u\n", i,v[i],i,pval);
#endif


Loading…
Cancel
Save