Merge pull request #269 from rgacogne/fix-misleading-indentation

Fix -Wmisleading-indentation warnings
pull/3/head
Christian Beier 6 years ago committed by GitHub
commit 19b695e9f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -468,7 +468,8 @@ static tjhandle _tjInitCompress(tjinstance *this)
if(setjmp(this->jerr.setjmp_buffer)) if(setjmp(this->jerr.setjmp_buffer))
{ {
/* If we get here, the JPEG code has signaled an error. */ /* If we get here, the JPEG code has signaled an error. */
if(this) free(this); return NULL; if(this) free(this);
return NULL;
} }
jpeg_create_compress(&this->cinfo); jpeg_create_compress(&this->cinfo);
@ -652,7 +653,8 @@ static tjhandle _tjInitDecompress(tjinstance *this)
if(setjmp(this->jerr.setjmp_buffer)) if(setjmp(this->jerr.setjmp_buffer))
{ {
/* If we get here, the JPEG code has signaled an error. */ /* If we get here, the JPEG code has signaled an error. */
if(this) free(this); return NULL; if(this) free(this);
return NULL;
} }
jpeg_create_decompress(&this->dinfo); jpeg_create_decompress(&this->dinfo);

@ -207,8 +207,9 @@ rfbEncryptBytes2(unsigned char *where, const int length, unsigned char *key) {
where[i] ^= key[i]; where[i] ^= key[i];
rfbDes(where, where); rfbDes(where, where);
for (i = 8; i < length; i += 8) { for (i = 8; i < length; i += 8) {
for (j = 0; j < 8; j++) for (j = 0; j < 8; j++) {
where[i + j] ^= where[i + j - 8]; where[i + j] ^= where[i + j - 8];
}
rfbDes(where + i, where + i); rfbDes(where + i, where + i);
} }
} }

@ -147,8 +147,9 @@ rfbInitOneRGBTable24 (uint8_t *table, int inMax, int outMax, int outShift,
for (i = 0; i < nEntries; i++) { for (i = 0; i < nEntries; i++) {
outValue = ((i * outMax + inMax / 2) / inMax) << outShift; outValue = ((i * outMax + inMax / 2) / inMax) << outShift;
*(uint32_t *)&table[3*i] = outValue; *(uint32_t *)&table[3*i] = outValue;
if(!rfbEndianTest) if(!rfbEndianTest) {
memmove(table+3*i,table+3*i+1,3); memmove(table+3*i,table+3*i+1,3);
}
if (swap) { if (swap) {
c = table[3*i]; table[3*i] = table[3*i+2]; c = table[3*i]; table[3*i] = table[3*i+2];
table[3*i+2] = c; table[3*i+2] = c;

@ -198,10 +198,13 @@ webSocketsHandshake(rfbClientPtr cl, char *scheme)
if ((n < 0) && (errno == ETIMEDOUT)) { if ((n < 0) && (errno == ETIMEDOUT)) {
break; break;
} }
if (n == 0) if (n == 0) {
rfbLog("webSocketsHandshake: client gone\n"); rfbLog("webSocketsHandshake: client gone\n");
else }
else {
rfbLogPerror("webSocketsHandshake: read"); rfbLogPerror("webSocketsHandshake: read");
}
free(response); free(response);
free(buf); free(buf);
return FALSE; return FALSE;

@ -178,7 +178,8 @@ int decomptest(unsigned char *srcbuf, unsigned char **jpegbuf,
int y=(int)((double)srcbuf[rindex]*0.299 int y=(int)((double)srcbuf[rindex]*0.299
+ (double)srcbuf[gindex]*0.587 + (double)srcbuf[gindex]*0.587
+ (double)srcbuf[bindex]*0.114 + 0.5); + (double)srcbuf[bindex]*0.114 + 0.5);
if(y>255) y=255; if(y<0) y=0; if(y>255) y=255;
if(y<0) y=0;
dstbuf[rindex]=abs(dstbuf[rindex]-y); dstbuf[rindex]=abs(dstbuf[rindex]-y);
dstbuf[gindex]=abs(dstbuf[gindex]-y); dstbuf[gindex]=abs(dstbuf[gindex]-y);
dstbuf[bindex]=abs(dstbuf[bindex]-y); dstbuf[bindex]=abs(dstbuf[bindex]-y);
@ -226,7 +227,8 @@ void dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
for(tilew=dotile? 8:w, tileh=dotile? 8:h; ; tilew*=2, tileh*=2) for(tilew=dotile? 8:w, tileh=dotile? 8:h; ; tilew*=2, tileh*=2)
{ {
if(tilew>w) tilew=w; if(tileh>h) tileh=h; if(tilew>w) tilew=w;
if(tileh>h) tileh=h;
ntilesw=(w+tilew-1)/tilew; ntilesh=(h+tileh-1)/tileh; ntilesw=(w+tilew-1)/tilew; ntilesh=(h+tileh-1)/tileh;
if((jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *) if((jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *)
@ -323,7 +325,7 @@ void dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
for(i=0; i<ntilesw*ntilesh; i++) for(i=0; i<ntilesw*ntilesh; i++)
{ {
if(jpegbuf[i]) free(jpegbuf[i]); jpegbuf[i]=NULL; if(jpegbuf[i]) {free(jpegbuf[i]); jpegbuf[i]=NULL;}
} }
free(jpegbuf); jpegbuf=NULL; free(jpegbuf); jpegbuf=NULL;
free(jpegsize); jpegsize=NULL; free(jpegsize); jpegsize=NULL;
@ -337,7 +339,7 @@ void dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
{ {
for(i=0; i<ntilesw*ntilesh; i++) for(i=0; i<ntilesw*ntilesh; i++)
{ {
if(jpegbuf[i]) free(jpegbuf[i]); jpegbuf[i]=NULL; if(jpegbuf[i]) {free(jpegbuf[i]); jpegbuf[i]=NULL;}
} }
free(jpegbuf); jpegbuf=NULL; free(jpegbuf); jpegbuf=NULL;
} }
@ -392,7 +394,8 @@ void dodecomptest(char *filename)
for(tilew=dotile? 16:w, tileh=dotile? 16:h; ; tilew*=2, tileh*=2) for(tilew=dotile? 16:w, tileh=dotile? 16:h; ; tilew*=2, tileh*=2)
{ {
if(tilew>w) tilew=w; if(tileh>h) tileh=h; if(tilew>w) tilew=w;
if(tileh>h) tileh=h;
ntilesw=(w+tilew-1)/tilew; ntilesh=(h+tileh-1)/tileh; ntilesw=(w+tilew-1)/tilew; ntilesh=(h+tileh-1)/tileh;
if((jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *) if((jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *)
@ -455,7 +458,7 @@ void dodecomptest(char *filename)
{ {
for(i=0; i<ntilesw*ntilesh; i++) for(i=0; i<ntilesw*ntilesh; i++)
{ {
if(jpegbuf[i]) free(jpegbuf[i]); jpegbuf[i]=NULL; if(jpegbuf[i]) {free(jpegbuf[i]); jpegbuf[i]=NULL;}
} }
free(jpegbuf); jpegbuf=NULL; free(jpegbuf); jpegbuf=NULL;
} }

Loading…
Cancel
Save