aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-01-15 17:40:22 +0100
committerMattias Andrée <maandree@kth.se>2017-01-15 17:40:22 +0100
commit7bd1282fba79997816521e25485ab890a0a0126d (patch)
treeba018cf7463c015a1e9b6ad69751c8c56bd8b0a3 /src
parentUse macros to write the head (diff)
downloadblind-7bd1282fba79997816521e25485ab890a0a0126d.tar.gz
blind-7bd1282fba79997816521e25485ab890a0a0126d.tar.bz2
blind-7bd1282fba79997816521e25485ab890a0a0126d.tar.xz
Fix some minor errors
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src')
-rw-r--r--src/blind-arithm.c6
-rw-r--r--src/blind-from-image.c1
-rw-r--r--src/blind-single-colour.c2
-rw-r--r--src/stream.h8
4 files changed, 10 insertions, 7 deletions
diff --git a/src/blind-arithm.c b/src/blind-arithm.c
index ce85287..015df42 100644
--- a/src/blind-arithm.c
+++ b/src/blind-arithm.c
@@ -8,7 +8,7 @@
#include <string.h>
#include <unistd.h>
-USAGE("right-hand-stream")
+USAGE("operation right-hand-stream")
/* Because the syntax for a function returning a function pointer is disgusting. */
typedef void (*process_func)(struct stream *left, struct stream *right, size_t n);
@@ -60,7 +60,7 @@ main(int argc, char *argv[])
struct stream left, right;
process_func process = NULL;
- ENOFLAGS(argc != 1);
+ ENOFLAGS(argc != 2);
left.file = "<stdin>";
left.fd = STDIN_FILENO;
@@ -75,6 +75,8 @@ main(int argc, char *argv[])
else
eprintf("pixel format %s is not supported, try xyza\n", left.pixfmt);
+ fprint_stream_head(stdout, &left);
+ efflush(stdout, "<stdout>");
process_two_streams(&left, &right, STDOUT_FILENO, "<stdout>", process);
return 0;
}
diff --git a/src/blind-from-image.c b/src/blind-from-image.c
index 0a3f767..b66d127 100644
--- a/src/blind-from-image.c
+++ b/src/blind-from-image.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#include "stream.h"
#include "util.h"
#include <arpa/inet.h>
diff --git a/src/blind-single-colour.c b/src/blind-single-colour.c
index 254ea2a..4046f3e 100644
--- a/src/blind-single-colour.c
+++ b/src/blind-single-colour.c
@@ -49,7 +49,7 @@ main(int argc, char *argv[])
if (argc < 3) {
X = D65_XYY_X / D65_XYY_Y;
Z = 1 / D65_XYY_Y - 1 - X;
- Y = etolf_arg("the Y value", argv[1]);
+ Y = etolf_arg("the Y value", argv[0]);
} else {
X = etolf_arg("the X value", argv[0]);
Y = etolf_arg("the Y value", argv[1]);
diff --git a/src/stream.h b/src/stream.h
index 53b7113..5fa3eea 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -6,15 +6,15 @@
#define SPRINTF_HEAD_ZN(BUF, FRAMES, WIDTH, HEIGHT, PIXFMT, LENP)\
sprintf(BUF, "%zu %zu %zu %s\n%cuivf%zn",\
- FRAMES, WIDTH, HEIGHT, PIXFMT, 0, LENP)
+ (size_t)(FRAMES), (size_t)(WIDTH), (size_t)(HEIGHT), PIXFMT, 0, LENP)
#define SPRINTF_HEAD(BUF, FRAMES, WIDTH, HEIGHT, PIXFMT)\
sprintf(BUF, "%zu %zu %zu %s\n%cuivf",\
- FRAMES, WIDTH, HEIGHT, PIXFMT, 0)
+ (size_t)(FRAMES), (size_t)(WIDTH), (size_t)(HEIGHT), PIXFMT, 0)
#define FPRINTF_HEAD(FP, FRAMES, WIDTH, HEIGHT, PIXFMT)\
- fprintf(fp, "%zu %zu %zu %s\n%cuivf",\
- FRAMES, WIDTH, HEIGHT, PIXFMT, 0)
+ fprintf(FP, "%zu %zu %zu %s\n%cuivf",\
+ (size_t)(FRAMES), (size_t)(WIDTH), (size_t)(HEIGHT), PIXFMT, 0)
#define einit_stream(...) eninit_stream(1, __VA_ARGS__)
#define eset_pixel_size(...) enset_pixel_size(1, __VA_ARGS__)