Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-29 19:47:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-29 19:47:02 +0400
commite701f9b67010279db02ceb51f7d08078cb34170a (patch)
tree22134b33527f2d3a1b05f4265422bf5d98420bbc /source/blender/imbuf/intern/targa.c
parent038c12895f50a97607dd372cb0780c55eb38fe22 (diff)
style cleanup: whitespace / commas
Diffstat (limited to 'source/blender/imbuf/intern/targa.c')
-rw-r--r--source/blender/imbuf/intern/targa.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index 0ed9b99d0ee..1a05dd93229 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -73,7 +73,7 @@ static int tga_out1(unsigned int data, FILE *file)
uchar *p;
p = (uchar *) & data;
- if (putc(p[0],file) == EOF) return(EOF);
+ if (putc(p[0], file) == EOF) return(EOF);
return (~EOF);
}
@@ -82,8 +82,8 @@ static int tga_out2(unsigned int data, FILE * file)
uchar *p;
p = (uchar *) & data;
- if (putc(p[0],file) == EOF) return(EOF);
- if (putc(p[1],file) == EOF) return(EOF);
+ if (putc(p[0], file) == EOF) return(EOF);
+ if (putc(p[1], file) == EOF) return(EOF);
return (~EOF);
}
@@ -93,9 +93,9 @@ static int tga_out3(unsigned int data, FILE * file)
uchar *p;
p = (uchar *) & data;
- if (putc(p[2],file) == EOF) return(EOF);
- if (putc(p[1],file) == EOF) return(EOF);
- if (putc(p[0],file) == EOF) return(EOF);
+ if (putc(p[2], file) == EOF) return(EOF);
+ if (putc(p[1], file) == EOF) return(EOF);
+ if (putc(p[0], file) == EOF) return(EOF);
return (~EOF);
}
@@ -106,16 +106,16 @@ static int tga_out4(unsigned int data, FILE * file)
p = (uchar *) & data;
/* order = bgra */
- if (putc(p[2],file) == EOF) return(EOF);
- if (putc(p[1],file) == EOF) return(EOF);
- if (putc(p[0],file) == EOF) return(EOF);
- if (putc(p[3],file) == EOF) return(EOF);
+ if (putc(p[2], file) == EOF) return(EOF);
+ if (putc(p[1], file) == EOF) return(EOF);
+ if (putc(p[0], file) == EOF) return(EOF);
+ if (putc(p[3], file) == EOF) return(EOF);
return (~EOF);
}
static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FILE*))
{
- register int last,this;
+ register int last, this;
register int copy, bytes;
register unsigned int *rect, *rectstart, *temp;
int y;
@@ -150,9 +150,9 @@ static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FI
last = copy;
if (copy>=128) last = 128;
copy -= last;
- if (fputc(last-1,file) == EOF) return(0);
+ if (fputc(last-1, file) == EOF) return(0);
do {
- if (out(*rect++,file) == EOF) return(0);
+ if (out(*rect++, file) == EOF) return(0);
} while (--last != 0);
}
rectstart = rect;
@@ -173,17 +173,17 @@ static short makebody_tga(ImBuf * ibuf, FILE * file, int (*out)(unsigned int, FI
while (copy) {
if (copy>128) {
- if (fputc(255,file) == EOF) return(0);
+ if (fputc(255, file) == EOF) return(0);
copy -= 128;
}
else {
if (copy == 1) {
- if (fputc(0,file) == EOF) return(0);
+ if (fputc(0, file) == EOF) return(0);
}
- else if (fputc(127 + copy,file) == EOF) return(0);
+ else if (fputc(127 + copy, file) == EOF) return(0);
copy = 0;
}
- if (out(last,file) == EOF) return(0);
+ if (out(last, file) == EOF) return(0);
}
copy=TRUE;
}
@@ -276,10 +276,10 @@ int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags)
if (ibuf->planes==32) {
buf[17] |= 0x08;
}
- fildes = BLI_fopen(name,"wb");
+ fildes = BLI_fopen(name, "wb");
if (!fildes) return 0;
- if (fwrite(buf, 1, 18,fildes) != 18) {
+ if (fwrite(buf, 1, 18, fildes) != 18) {
fclose(fildes);
return (0);
}
@@ -485,10 +485,10 @@ partial_load:
complete_partial_load(ibuf, rect);
}
-static void ldtarga(struct ImBuf * ibuf,unsigned char * mem, size_t mem_size, int psize)
+static void ldtarga(struct ImBuf * ibuf, unsigned char * mem, size_t mem_size, int psize)
{
unsigned char *mem_end = mem+mem_size;
- int col,size;
+ int col, size;
unsigned int *rect;
uchar * cp = (uchar *) &col;
@@ -553,10 +553,10 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
unsigned int *rect, *cmap= NULL /*, mincol= 0*/, maxcol= 0;
uchar * cp = (uchar *) &col;
- if (checktarga(&tga,mem) == 0) return(NULL);
+ if (checktarga(&tga, mem) == 0) return(NULL);
- if (flags & IB_test) ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,tga.pixsize, 0);
- else ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,(tga.pixsize + 0x7) & ~0x7, IB_rect);
+ if (flags & IB_test) ibuf = IMB_allocImBuf(tga.xsize, tga.ysize, tga.pixsize, 0);
+ else ibuf = IMB_allocImBuf(tga.xsize, tga.ysize, (tga.pixsize + 0x7) & ~0x7, IB_rect);
if (ibuf == NULL) return(NULL);
ibuf->ftype = TGA;
@@ -621,18 +621,18 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
case 1:
case 2:
case 3:
- if (tga.pixsize <= 8) ldtarga(ibuf,mem,mem_size,0);
- else if (tga.pixsize <= 16) ldtarga(ibuf,mem,mem_size,1);
- else if (tga.pixsize <= 24) ldtarga(ibuf,mem,mem_size,2);
- else if (tga.pixsize <= 32) ldtarga(ibuf,mem,mem_size,3);
+ if (tga.pixsize <= 8) ldtarga(ibuf, mem, mem_size, 0);
+ else if (tga.pixsize <= 16) ldtarga(ibuf, mem, mem_size, 1);
+ else if (tga.pixsize <= 24) ldtarga(ibuf, mem, mem_size, 2);
+ else if (tga.pixsize <= 32) ldtarga(ibuf, mem, mem_size, 3);
break;
case 9:
case 10:
case 11:
- if (tga.pixsize <= 8) decodetarga(ibuf,mem,mem_size,0);
- else if (tga.pixsize <= 16) decodetarga(ibuf,mem,mem_size,1);
- else if (tga.pixsize <= 24) decodetarga(ibuf,mem,mem_size,2);
- else if (tga.pixsize <= 32) decodetarga(ibuf,mem,mem_size,3);
+ if (tga.pixsize <= 8) decodetarga(ibuf, mem, mem_size, 0);
+ else if (tga.pixsize <= 16) decodetarga(ibuf, mem, mem_size, 1);
+ else if (tga.pixsize <= 24) decodetarga(ibuf, mem, mem_size, 2);
+ else if (tga.pixsize <= 32) decodetarga(ibuf, mem, mem_size, 3);
break;
}