aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/jpg
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2020-01-10 14:44:21 +0000
committerDan Cross <cross@gajendra.net>2020-01-10 14:54:30 +0000
commitfa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch)
tree81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/jpg
parent77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff)
downloadplan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
Diffstat (limited to 'src/cmd/jpg')
-rw-r--r--src/cmd/jpg/jpegdump.c10
-rw-r--r--src/cmd/jpg/jpg.c2
-rw-r--r--src/cmd/jpg/onechan.c2
-rw-r--r--src/cmd/jpg/readbmp.c8
-rw-r--r--src/cmd/jpg/readgif.c2
-rw-r--r--src/cmd/jpg/readjpg.c4
-rw-r--r--src/cmd/jpg/readpng.c14
-rw-r--r--src/cmd/jpg/readppm.c4
-rw-r--r--src/cmd/jpg/readyuv.c4
-rw-r--r--src/cmd/jpg/writegif.c4
-rw-r--r--src/cmd/jpg/writepng.c10
-rw-r--r--src/cmd/jpg/writeppm.c2
12 files changed, 31 insertions, 35 deletions
diff --git a/src/cmd/jpg/jpegdump.c b/src/cmd/jpg/jpegdump.c
index 6a0a7a00..5ecfc20a 100644
--- a/src/cmd/jpg/jpegdump.c
+++ b/src/cmd/jpg/jpegdump.c
@@ -134,7 +134,7 @@ void get_sof (int kind) {
tab = get1();
printf ("\tcomponent %d: %d hsample, %d vsample, quantization table %d\n",
id, sf >> 4, sf & 0xf, tab);
- }
+ }
}
void get_com (int kind) {
@@ -301,10 +301,10 @@ marker:
case 0xd8:
printf ("SOI\n");
break;
- case 0xe0: case 0xe1: case 0xe2: case 0xe3:
- case 0xe4: case 0xe5: case 0xe6: case 0xe7:
- case 0xe8: case 0xe9: case 0xea: case 0xeb:
- case 0xec: case 0xed: case 0xee: case 0xef:
+ case 0xe0: case 0xe1: case 0xe2: case 0xe3:
+ case 0xe4: case 0xe5: case 0xe6: case 0xe7:
+ case 0xe8: case 0xe9: case 0xea: case 0xeb:
+ case 0xec: case 0xed: case 0xee: case 0xef:
get_app(c);
break;
case 0xda:
diff --git a/src/cmd/jpg/jpg.c b/src/cmd/jpg/jpg.c
index f74da4c5..7618c605 100644
--- a/src/cmd/jpg/jpg.c
+++ b/src/cmd/jpg/jpg.c
@@ -225,7 +225,7 @@ vidmerge(Rawimage **aa1, Rawimage **aa2)
free(a2->cmap);
free(a1);
free(a2);
- }
+ }
if (aa2[i] != nil)
fprint(2, "jpg: vidmerge: unequal lengths\n");
free(aa1);
diff --git a/src/cmd/jpg/onechan.c b/src/cmd/jpg/onechan.c
index ea1c489b..9baf366c 100644
--- a/src/cmd/jpg/onechan.c
+++ b/src/cmd/jpg/onechan.c
@@ -63,7 +63,7 @@ load(Image *image, Memimage *memimage)
dx = Dx(r);
dy = Dy(r);
- /*
+ /*
* Read image data into memory
* potentially one extra byte on each end of each scan line.
*/
diff --git a/src/cmd/jpg/readbmp.c b/src/cmd/jpg/readbmp.c
index 154cb48d..586f63cd 100644
--- a/src/cmd/jpg/readbmp.c
+++ b/src/cmd/jpg/readbmp.c
@@ -185,7 +185,7 @@ load_4C(Biobuf *b, long width, long height, Rgb* buf, Rgb* clut)
p = &buf[ix + iy * width];
if((1 == (val & 3)) || (2 == (val & 3)))
skip = 1;
- else
+ else
skip = 0;
while(val--) {
@@ -273,7 +273,7 @@ load_8C(Biobuf *b, long width, long height, Rgb* buf, Rgb* clut)
p = &buf[ix + iy * width];
if(val & 1)
skip = 1;
- else
+ else
skip = 0;
while(val--) {
@@ -488,7 +488,7 @@ ReadBMP(Biobuf *b, int *width, int *height)
num_coltab = 3;
if(num_coltab) {
- int i;
+ int i;
Bseek(b, bmih.size + sizeof(Infohdr), 0);
for(i = 0; i < num_coltab; i++) {
@@ -622,5 +622,3 @@ readbmp(int fd, int colorspace)
Bterm(&b);
return a;
}
-
-
diff --git a/src/cmd/jpg/readgif.c b/src/cmd/jpg/readgif.c
index 22365669..092faf07 100644
--- a/src/cmd/jpg/readgif.c
+++ b/src/cmd/jpg/readgif.c
@@ -166,7 +166,7 @@ readarray(Header *h)
nimages = 0;
array[0] = nil;
h->array = array;
-
+
for(;;){
switch(c = Bgetc(h->fd)){
case Beof:
diff --git a/src/cmd/jpg/readjpg.c b/src/cmd/jpg/readjpg.c
index f3ad802e..c69d0438 100644
--- a/src/cmd/jpg/readjpg.c
+++ b/src/cmd/jpg/readjpg.c
@@ -78,7 +78,7 @@ struct Header
Huffman acht[4];
int **data[3];
int ndata[3];
-
+
uchar *sf; /* start of frame; do better later */
uchar *ss; /* start of scan; do better later */
int ri; /* restart interval */
@@ -1484,7 +1484,7 @@ receiveEOB(Header *h, int s)
return v;
}
-/*
+/*
* return next bit of input
*/
static
diff --git a/src/cmd/jpg/readpng.c b/src/cmd/jpg/readpng.c
index 5fdbc1db..e327a572 100644
--- a/src/cmd/jpg/readpng.c
+++ b/src/cmd/jpg/readpng.c
@@ -11,9 +11,9 @@ int debug;
enum{ IDATSIZE=1000000,
/* filtering algorithms, supposedly increase compression */
FilterNone = 0, /* new[x][y] = buf[x][y] */
- FilterSub = 1, /* new[x][y] = buf[x][y] + new[x-1][y] */
- FilterUp = 2, /* new[x][y] = buf[x][y] + new[x][y-1] */
- FilterAvg = 3, /* new[x][y] = buf[x][y] + (new[x-1][y]+new[x][y-1])/2 */
+ FilterSub = 1, /* new[x][y] = buf[x][y] + new[x-1][y] */
+ FilterUp = 2, /* new[x][y] = buf[x][y] + new[x][y-1] */
+ FilterAvg = 3, /* new[x][y] = buf[x][y] + (new[x-1][y]+new[x][y-1])/2 */
FilterPaeth= 4, /* new[x][y] = buf[x][y] + paeth(new[x-1][y],new[x][y-1],new[x-1][y-1]) */
FilterLast = 5,
PropertyBit = 1<<5
@@ -141,11 +141,11 @@ refill_buffer:
return *z->b++;
}
-static uchar
+static uchar
paeth(uchar a, uchar b, uchar c)
{
int p, pa, pb, pc;
-
+
p = (int)a + (int)b - (int)c;
pa = abs(p - (int)a);
pb = abs(p - (int)b);
@@ -218,7 +218,7 @@ convertpix(ZlibW *z, uchar *pixel, uchar *r, uchar *g, uchar *b)
break;
default:
sysfatal("bad number of channels: %d", z->nchan);
- }
+ }
}
static void
@@ -234,7 +234,7 @@ scan(ZlibW *z)
unfilter(p[0], p+1, z->pscan+1, z->scanl-1, (nch*z->bpp+7)/8);
/*
- * Adam7 interlace order.
+ * Adam7 interlace order.
* 1 6 4 6 2 6 4 6
* 7 7 7 7 7 7 7 7
* 5 6 5 6 5 6 5 6
diff --git a/src/cmd/jpg/readppm.c b/src/cmd/jpg/readppm.c
index 073f4436..7067fc15 100644
--- a/src/cmd/jpg/readppm.c
+++ b/src/cmd/jpg/readppm.c
@@ -21,7 +21,7 @@ Bgetch(Biobuf *b)
while((c = Bgetc(b)) != Beof && c != '\n')
;
}
- return c;
+ return c;
}
/*
@@ -40,7 +40,7 @@ Bgetint(Biobuf *b)
return -1;
i = 0;
- do {
+ do {
i = i*10 + (c-'0');
} while((c = Bgetch(b)) != Beof && isdigit(c));
diff --git a/src/cmd/jpg/readyuv.c b/src/cmd/jpg/readyuv.c
index f90bc237..5194d544 100644
--- a/src/cmd/jpg/readyuv.c
+++ b/src/cmd/jpg/readyuv.c
@@ -29,7 +29,7 @@ enum {
static int lsbtab[] = { 6, 4, 2, 0};
-static int
+static int
clip(int x)
{
x >>= 18;
@@ -186,5 +186,3 @@ readyuv(int fd, int colorspace)
Bterm(&b);
return a;
}
-
-
diff --git a/src/cmd/jpg/writegif.c b/src/cmd/jpg/writegif.c
index 08fc4801..780bf7a5 100644
--- a/src/cmd/jpg/writegif.c
+++ b/src/cmd/jpg/writegif.c
@@ -281,7 +281,7 @@ writegraphiccontrol(Biobuf *fd, int dt, int trans)
Bputc(fd, 0x01);
else
Bputc(fd, 0x00);
-
+
/* Delay time, in centisec (argument is millisec for sanity) */
if(dt < 0)
dt = 0;
@@ -345,7 +345,7 @@ writedata(Biobuf *fd, Image *image, Memimage *memimage)
else
Bputc(fd, depth);
- /*
+ /*
* Read image data into memory
* potentially one extra byte on each end of each scan line
*/
diff --git a/src/cmd/jpg/writepng.c b/src/cmd/jpg/writepng.c
index 24a61a36..d0baf122 100644
--- a/src/cmd/jpg/writepng.c
+++ b/src/cmd/jpg/writepng.c
@@ -70,7 +70,7 @@ zread(void *va, void *buf, int n)
uchar *b = buf, *e = b+n, *img;
int pixels; /* number of pixels in row that can be sent now */
int i, a, pixwid;
-
+
pixwid = z->pixwid;
while(b+pixwid <= e){ /* loop over image rows */
if(z->row >= nrow)
@@ -103,7 +103,7 @@ zread(void *va, void *buf, int n)
b[2] = (b[2]*255)/a;
}
}
- }else
+ }else
b += pixwid*pixels;
z->col += pixels;
@@ -148,7 +148,7 @@ memRGBA(Memimage *i)
Memimage *ni;
char buf[32];
ulong dst;
-
+
/*
* [A]BGR because we want R,G,B,[A] in big-endian order. Sigh.
*/
@@ -157,7 +157,7 @@ memRGBA(Memimage *i)
dst = ABGR32;
else
dst = BGR24;
-
+
if(i->chan == dst)
return i;
@@ -211,7 +211,7 @@ memwritepng(Biobuf *bo, Memimage *r, ImageInfo *II)
*h++ = tm->min;
*h++ = tm->sec;
chunk(bo, "tIME", buf, h-buf);
-
+
if(II->fields_set & II_GAMMA){
vgamma = II->gamma*100000;
put4(buf, vgamma);
diff --git a/src/cmd/jpg/writeppm.c b/src/cmd/jpg/writeppm.c
index c8378652..da528a44 100644
--- a/src/cmd/jpg/writeppm.c
+++ b/src/cmd/jpg/writeppm.c
@@ -30,7 +30,7 @@ writedata(Biobuf *fd, Image *image, Memimage *memimage)
chan = image->chan;
}
- /*
+ /*
* Read image data into memory
* potentially one extra byte on each end of each scan line
*/