From 1d7d2b1bd273b391a7afff4469b07699846137ef Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 6 Apr 2018 22:01:29 +0200 Subject: [PATCH] Indentation fixes. --- coders/mat.c | 78 +++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/coders/mat.c b/coders/mat.c index 8cadc50f0..ac7497e09 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -1132,8 +1132,8 @@ MATLAB_KO: image->depth = 32; /* double type cell */ (void) SetImageOption(clone_info,"quantum:format","floating-point"); if (MATLAB_HDR.StructureFlag & FLAG_COMPLEX) - { /* complex float type cell */ - } + { /* complex float type cell */ + } ldblk = (ssize_t) (4 * MATLAB_HDR.SizeX); break; case miDOUBLE: @@ -1151,8 +1151,8 @@ RestoreMSCWarning ThrowReaderException(CoderError, "IncompatibleSizeOfDouble"); } if (MATLAB_HDR.StructureFlag & FLAG_COMPLEX) - { /* complex double type cell */ - } + { /* complex double type cell */ + } ldblk = (ssize_t) (8 * MATLAB_HDR.SizeX); break; default: @@ -1227,9 +1227,11 @@ RestoreMSCWarning MinVal = 0; MaxVal = 0; if (CellType==miDOUBLE || CellType==miSINGLE) /* Find Min and Max Values for floats */ - { - CalcMinMax(image2, image_info->endian, MATLAB_HDR.SizeX, MATLAB_HDR.SizeY, CellType, ldblk, BImgBuff, &quantum_info->minimum, &quantum_info->maximum); - } + { + CalcMinMax(image2,image_info->endian,MATLAB_HDR.SizeX,MATLAB_HDR.SizeY, + CellType,ldblk,BImgBuff,&quantum_info->minimum, + &quantum_info->maximum); + } /* Main loop for reading all scanlines */ if(z==1) z=0; /* read grey scanlines */ @@ -1240,45 +1242,45 @@ RestoreMSCWarning { q=GetAuthenticPixels(image,0,MATLAB_HDR.SizeY-i-1,image->columns,1,exception); if (q == (Quantum *) NULL) - { - if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), + { + if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), " MAT set image pixels returns unexpected NULL on a row %u.", (unsigned)(MATLAB_HDR.SizeY-i-1)); - goto done_reading; /* Skip image rotation, when cannot set image pixels */ - } + goto done_reading; /* Skip image rotation, when cannot set image pixels */ + } if(ReadBlob(image2,ldblk,(unsigned char *)BImgBuff) != (ssize_t) ldblk) - { - if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), - " MAT cannot read scanrow %u from a file.", (unsigned)(MATLAB_HDR.SizeY-i-1)); - goto ExitLoop; - } + { + if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), + " MAT cannot read scanrow %u from a file.", (unsigned)(MATLAB_HDR.SizeY-i-1)); + goto ExitLoop; + } if((CellType==miINT8 || CellType==miUINT8) && (MATLAB_HDR.StructureFlag & FLAG_LOGICAL)) { FixLogical((unsigned char *)BImgBuff,ldblk); if(ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,z2qtype[z],BImgBuff,exception) <= 0) - { + { ImportQuantumPixelsFailed: - if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), - " MAT failed to ImportQuantumPixels for a row %u", (unsigned)(MATLAB_HDR.SizeY-i-1)); - break; - } + if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), + " MAT failed to ImportQuantumPixels for a row %u", (unsigned)(MATLAB_HDR.SizeY-i-1)); + break; + } } else { if(ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,z2qtype[z],BImgBuff,exception) <= 0) - goto ImportQuantumPixelsFailed; + goto ImportQuantumPixelsFailed; if (z<=1 && /* fix only during a last pass z==0 || z==1 */ - (CellType==miINT8 || CellType==miINT16 || CellType==miINT32 || CellType==miINT64)) - FixSignedValues(image,q,MATLAB_HDR.SizeX); + (CellType==miINT8 || CellType==miINT16 || CellType==miINT32 || CellType==miINT64)) + FixSignedValues(image,q,MATLAB_HDR.SizeX); } if (!SyncAuthenticPixels(image,exception)) - { - if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), - " MAT failed to sync image pixels for a row %u", (unsigned)(MATLAB_HDR.SizeY-i-1)); - goto ExitLoop; - } + { + if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(), + " MAT failed to sync image pixels for a row %u", (unsigned)(MATLAB_HDR.SizeY-i-1)); + goto ExitLoop; + } } } while(z-- >= 2); ExitLoop: @@ -1297,19 +1299,19 @@ ExitLoop: if (CellType==miDOUBLE) for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++) - { + { ReadBlobDoublesXXX(image2, ldblk, (double *)BImgBuff); InsertComplexDoubleRow(image, (double *)BImgBuff, i, MinVal, MaxVal, exception); - } + } if (CellType==miSINGLE) for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++) - { + { ReadBlobFloatsXXX(image2, ldblk, (float *)BImgBuff); InsertComplexFloatRow(image,(float *)BImgBuff,i,MinVal,MaxVal, exception); - } + } } /* Image is gray when no complex flag is set and 2D Matrix AGAIN!!! */ @@ -1342,14 +1344,14 @@ done_reading: if(image2!=image) { DeleteImageFromList(&image2); - if(clone_info) - { + if(clone_info) + { if(clone_info->file) - { + { fclose(clone_info->file); clone_info->file = NULL; (void) remove_utf8(clone_info->filename); - } + } } } if (EOFBlob(image) != MagickFalse) @@ -1388,7 +1390,7 @@ done_reading: (void) remove_utf8(clone_info->filename); } } - } + } if (clone_info) clone_info=DestroyImageInfo(clone_info); -- 2.40.0