diff options
| author | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2014-03-07 12:06:00 +0000 |
|---|---|---|
| committer | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2014-03-07 12:06:00 +0000 |
| commit | 956b1a7697ac1210a0d6df934399691ea8055583 (patch) | |
| tree | bba1db2462f03bf3cd27fa42b57d7ec0b65722e5 /src | |
| parent | 472ce191832f429ca652d04c4b5f80af0b0c4f89 (diff) | |
[trunk] Another round of fixes for sign conversion warnings.
Update issue 256
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/jp2/opj_compress.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/bin/jp2/opj_compress.c b/src/bin/jp2/opj_compress.c index 0f1b9580..e42e88df 100644 --- a/src/bin/jp2/opj_compress.c +++ b/src/bin/jp2/opj_compress.c @@ -623,8 +623,8 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param if (numlayers > 9) s++; - parameters->tcp_numlayers = numlayers; - numresolution = parameters->numresolution; + parameters->tcp_numlayers = (int)numlayers; + numresolution = (OPJ_UINT32)parameters->numresolution; matrix_width = numresolution * 3; parameters->cp_matrice = (int *) malloc(numlayers * matrix_width * sizeof(int)); s = s + 2; @@ -799,7 +799,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param } s++; } - parameters->numpocs = numpocs; + parameters->numpocs = (OPJ_UINT32)numpocs; } break; @@ -935,7 +935,8 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param float *lCurrentDoublePtr; float *lSpace; int *l_int_ptr; - int lNbComp = 0, lTotalComp, lMctComp, i; long int lStrLen, lStrFread; + int lNbComp = 0, lTotalComp, lMctComp, i; + size_t lStrLen, lStrFread; /* Open file */ FILE * lFile = fopen(lFilename,"r"); @@ -945,7 +946,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param /* Set size of file and read its content*/ fseek(lFile,0,SEEK_END); - lStrLen = ftell(lFile); + lStrLen = (size_t)ftell(lFile); fseek(lFile,0,SEEK_SET); lMatrix = (char *) malloc(lStrLen + 1); lStrFread = fread(lMatrix, 1, lStrLen, lFile); @@ -969,7 +970,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param lNbComp = (int) (sqrt(4*lNbComp + 1)/2. - 0.5); lMctComp = lNbComp * lNbComp; lTotalComp = lMctComp + lNbComp; - lSpace = (float *) malloc(lTotalComp * sizeof(float)); + lSpace = (float *) malloc((size_t)lTotalComp * sizeof(float)); lCurrentDoublePtr = lSpace; for (i=0;i<lMctComp;++i) { lStrLen = strlen(lCurrentPtr) + 1; @@ -985,7 +986,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param } /* TODO should not be here ! */ - opj_set_MCT(parameters, lSpace, (int *)(lSpace + lMctComp), lNbComp); + opj_set_MCT(parameters, lSpace, (int *)(lSpace + lMctComp), (OPJ_UINT32)lNbComp); /* Free memory*/ free(lSpace); @@ -1501,7 +1502,7 @@ int main(int argc, char **argv) { fprintf(stderr,"\n"); if(img_fol.set_imgdir==1){ - if (get_next_file(imageno, dirptr,&img_fol, ¶meters)) { + if (get_next_file((int)imageno, dirptr,&img_fol, ¶meters)) { fprintf(stderr,"skipping file...\n"); continue; } |
