tests/: reformat a few files to be modified

This commit is contained in:
Even Rouault 2021-10-21 13:12:05 +02:00
parent 714c63efee
commit 3835f37084
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D
2 changed files with 195 additions and 196 deletions

View File

@ -36,17 +36,20 @@ void error_callback(const char *msg, void *v);
void warning_callback(const char *msg, void *v);
void info_callback(const char *msg, void *v);
void error_callback(const char *msg, void *v) {
void error_callback(const char *msg, void *v)
{
(void)msg;
(void)v;
puts(msg);
}
void warning_callback(const char *msg, void *v) {
void warning_callback(const char *msg, void *v)
{
(void)msg;
(void)v;
puts(msg);
}
void info_callback(const char *msg, void *v) {
void info_callback(const char *msg, void *v)
{
(void)msg;
(void)v;
puts(msg);
@ -89,11 +92,9 @@ int main(int argc, char *argv[])
image = opj_image_create(numcomps, &cmptparm, color_space);
assert(image);
for (i = 0; i < image_width * image_height; i++)
{
for (i = 0; i < image_width * image_height; i++) {
unsigned int compno;
for(compno = 0; compno < numcomps; compno++)
{
for (compno = 0; compno < numcomps; compno++) {
image->comps[compno].data[i] = 0;
}
}
@ -113,8 +114,7 @@ int main(int argc, char *argv[])
l_stream = opj_stream_create_default_file_stream("testempty1.j2k", OPJ_FALSE);
assert(l_stream);
bSuccess = opj_start_compress(l_codec, image, l_stream);
if( !bSuccess )
{
if (!bSuccess) {
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(image);

View File

@ -37,17 +37,20 @@ void error_callback(const char *msg, void *v);
void warning_callback(const char *msg, void *v);
void info_callback(const char *msg, void *v);
void error_callback(const char *msg, void *v) {
void error_callback(const char *msg, void *v)
{
(void)msg;
(void)v;
puts(msg);
}
void warning_callback(const char *msg, void *v) {
void warning_callback(const char *msg, void *v)
{
(void)msg;
(void)v;
puts(msg);
}
void info_callback(const char *msg, void *v) {
void info_callback(const char *msg, void *v)
{
(void)msg;
(void)v;
puts(msg);
@ -94,11 +97,9 @@ int main(int argc, char *argv[])
image = opj_image_create(numcomps, &cmptparm, color_space);
assert(image);
for (i = 0; i < image_width * image_height; i++)
{
for (i = 0; i < image_width * image_height; i++) {
unsigned int compno;
for(compno = 0; compno < numcomps; compno++)
{
for (compno = 0; compno < numcomps; compno++) {
image->comps[compno].data[i] = 0;
}
}
@ -116,8 +117,7 @@ int main(int argc, char *argv[])
opj_setup_encoder(l_codec, &parameters, image);
l_stream = opj_stream_create_default_file_stream(parameters.outfile, OPJ_FALSE);
if( !l_stream )
{
if (!l_stream) {
fprintf(stderr, "Something went wrong during creation of stream\n");
opj_destroy_codec(l_codec);
opj_image_destroy(image);
@ -126,8 +126,7 @@ int main(int argc, char *argv[])
}
assert(l_stream);
bSuccess = opj_start_compress(l_codec, image, l_stream);
if( !bSuccess )
{
if (!bSuccess) {
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(image);