fix gcc build

This commit is contained in:
caesar 2020-04-19 15:46:46 +08:00
parent a0ce21b06c
commit 06fb629e7e
2 changed files with 7 additions and 4 deletions

3
.gitignore vendored
View File

@ -16,3 +16,6 @@ scripts/opjstyle*
# Ignore directories made by `make`.
/bin/
/DG02File.j2k
/cmake-build-*
/.idea

View File

@ -2672,7 +2672,7 @@ int imagetoraw_c_vector(opj_image_t *image, c_vector *outfile,
curr = -128;
}
uc = (unsigned char) (curr & mask);
res = c_vector_push_back(outfile, &uc, 0, 1);
res = c_vector_push_back(outfile, &uc, 0, 1)==0?0:1;
if (res != 0) {
fprintf(stderr, "failed to write 1 byte\n");
goto fin;
@ -2692,7 +2692,7 @@ int imagetoraw_c_vector(opj_image_t *image, c_vector *outfile,
curr = 0;
}
uc = (unsigned char) (curr & mask);
res = c_vector_push_back(outfile, &uc, 0, 1);
res = c_vector_push_back(outfile, &uc, 0, 1)==0?0:1;
if (res != 0) {
fprintf(stderr, "failed to write 1 byte\n");
goto fin;
@ -2718,7 +2718,7 @@ int imagetoraw_c_vector(opj_image_t *image, c_vector *outfile,
curr = -32768;
}
uc16.val = (signed short) (curr & mask);
res = c_vector_push_back(outfile, uc16.vals, 0, 2);
res = c_vector_push_back(outfile, uc16.vals, 0, 2)==0?0:1;
if (res != 0) {
fprintf(stderr, "failed to write 2 byte\n");
goto fin;
@ -2742,7 +2742,7 @@ int imagetoraw_c_vector(opj_image_t *image, c_vector *outfile,
curr = 0;
}
uc16.val = (unsigned short) (curr & mask);
res = c_vector_push_back(outfile, uc16.vals, 0, 2);
res = c_vector_push_back(outfile, uc16.vals, 0, 2)==0?0:1;
if (res != 0) {
fprintf(stderr, "failed to write 2 byte\n");
goto fin;