diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-29 19:47:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-29 19:47:02 +0400 |
commit | e701f9b67010279db02ceb51f7d08078cb34170a (patch) | |
tree | 22134b33527f2d3a1b05f4265422bf5d98420bbc /source/blender/imbuf/intern/bmp.c | |
parent | 038c12895f50a97607dd372cb0780c55eb38fe22 (diff) |
style cleanup: whitespace / commas
Diffstat (limited to 'source/blender/imbuf/intern/bmp.c')
-rw-r--r-- | source/blender/imbuf/intern/bmp.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index 06e1d75c5d0..bce3c70fd93 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -192,18 +192,18 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags) } /* Couple of helper functions for writing our data */ -static int putIntLSB(unsigned int ui,FILE *ofile) +static int putIntLSB(unsigned int ui, FILE *ofile) { - putc((ui>>0)&0xFF,ofile); - putc((ui>>8)&0xFF,ofile); - putc((ui>>16)&0xFF,ofile); - return putc((ui>>24)&0xFF,ofile); + putc((ui>>0)&0xFF, ofile); + putc((ui>>8)&0xFF, ofile); + putc((ui>>16)&0xFF, ofile); + return putc((ui>>24)&0xFF, ofile); } -static int putShortLSB(unsigned short us,FILE *ofile) +static int putShortLSB(unsigned short us, FILE *ofile) { - putc((us>>0)&0xFF,ofile); - return putc((us>>8)&0xFF,ofile); + putc((us>>0)&0xFF, ofile); + return putc((us>>8)&0xFF, ofile); } /* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */ @@ -220,37 +220,37 @@ int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags) bytesize = (ibuf->x * 3 + extrabytes) * ibuf->y; data = (uchar *) ibuf->rect; - ofile = BLI_fopen(name,"wb"); + ofile = BLI_fopen(name, "wb"); if (!ofile) return 0; - putShortLSB(19778,ofile); /* "BM" */ - putIntLSB(0,ofile); /* This can be 0 for BI_RGB bitmaps */ - putShortLSB(0,ofile); /* Res1 */ - putShortLSB(0,ofile); /* Res2 */ - putIntLSB(BMP_FILEHEADER_SIZE + sizeof(infoheader),ofile); - - putIntLSB(sizeof(infoheader),ofile); - putIntLSB(ibuf->x,ofile); - putIntLSB(ibuf->y,ofile); - putShortLSB(1,ofile); - putShortLSB(24,ofile); - putIntLSB(0,ofile); - putIntLSB(bytesize + BMP_FILEHEADER_SIZE + sizeof(infoheader),ofile); - putIntLSB(0,ofile); - putIntLSB(0,ofile); - putIntLSB(0,ofile); - putIntLSB(0,ofile); + putShortLSB(19778, ofile); /* "BM" */ + putIntLSB(0, ofile); /* This can be 0 for BI_RGB bitmaps */ + putShortLSB(0, ofile); /* Res1 */ + putShortLSB(0, ofile); /* Res2 */ + putIntLSB(BMP_FILEHEADER_SIZE + sizeof(infoheader), ofile); + + putIntLSB(sizeof(infoheader), ofile); + putIntLSB(ibuf->x, ofile); + putIntLSB(ibuf->y, ofile); + putShortLSB(1, ofile); + putShortLSB(24, ofile); + putIntLSB(0, ofile); + putIntLSB(bytesize + BMP_FILEHEADER_SIZE + sizeof(infoheader), ofile); + putIntLSB(0, ofile); + putIntLSB(0, ofile); + putIntLSB(0, ofile); + putIntLSB(0, ofile); /* Need to write out padded image data in bgr format */ for (y=0;y<ibuf->y;y++) { for (x=0;x<ibuf->x;x++) { ptr=(x + y * ibuf->x) * 4; - if (putc(data[ptr+2],ofile) == EOF) return 0; - if (putc(data[ptr+1],ofile) == EOF) return 0; - if (putc(data[ptr],ofile) == EOF) return 0; + if (putc(data[ptr+2], ofile) == EOF) return 0; + if (putc(data[ptr+1], ofile) == EOF) return 0; + if (putc(data[ptr], ofile) == EOF) return 0; } /* add padding here */ - for (t=0;t<extrabytes;t++) if (putc(0,ofile) == EOF) return 0; + for (t=0;t<extrabytes;t++) if (putc(0, ofile) == EOF) return 0; } if (ofile) { fflush(ofile); |