aboutsummaryrefslogtreecommitdiffstats
path: root/src/blind-to-portable.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-07-15 17:08:02 +0200
committerMattias Andrée <maandree@kth.se>2017-07-15 17:08:02 +0200
commit3569a10c97d41913dbf7cf3114cb4d2d5f17dc7f (patch)
treee8b08fe9b0cdc208f66582309377bc3c1817fe1f /src/blind-to-portable.c
parentGenerate USING_BINARY{32,64} (diff)
downloadblind-3569a10c97d41913dbf7cf3114cb4d2d5f17dc7f.tar.gz
blind-3569a10c97d41913dbf7cf3114cb4d2d5f17dc7f.tar.bz2
blind-3569a10c97d41913dbf7cf3114cb4d2d5f17dc7f.tar.xz
Some improvements and fixes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-to-portable.c')
-rw-r--r--src/blind-to-portable.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/blind-to-portable.c b/src/blind-to-portable.c
index 39e3d58..651c756 100644
--- a/src/blind-to-portable.c
+++ b/src/blind-to-portable.c
@@ -89,10 +89,10 @@ USAGE("[-s]")
} while (0)
static uint64_t conv_double(double host) {CONV(double, uint64_t, int64_t, 11, 1023, 52);}
-static uint32_t conv_float (float host) {CONV(float, uint32_t, int32_t, 8, 127, 23);}
+static uint32_t conv_float (float host) {CONV(float, uint32_t, int32_t, 8, 127, 23);}
-static void process_xyza (struct stream *stream, int strict) {PROCESS(double, uint64_t, 64);}
-static void process_xyzaf(struct stream *stream, int strict) {PROCESS(float, uint32_t, 32);}
+static void process_lf(struct stream *stream, int strict) {PROCESS(double, uint64_t, 64);}
+static void process_f (struct stream *stream, int strict) {PROCESS(float, uint32_t, 32);}
int
main(int argc, char *argv[])
@@ -113,10 +113,10 @@ main(int argc, char *argv[])
eopen_stream(&stream, NULL);
- if (!strcmp(stream.pixfmt, "xyza"))
- process = process_xyza;
- else if (!strcmp(stream.pixfmt, "xyza f"))
- process = process_xyzaf;
+ if (stream.encoding == DOUBLE)
+ process = process_lf;
+ else if (stream.encoding == FLOAT)
+ process = process_f;
else
eprintf("pixel format %s is not supported\n", stream.pixfmt);