From 453f44a8ac3100bb6c1f2fd33d92ac68a1bcca92 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 4 Jan 2016 18:16:45 +0100 Subject: macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/parse_10deg.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/parse_10deg.c') diff --git a/src/parse_10deg.c b/src/parse_10deg.c index 245814b..1ef6947 100644 --- a/src/parse_10deg.c +++ b/src/parse_10deg.c @@ -15,8 +15,7 @@ * along with this program. If not, see . */ #include "haiku.h" -#include -#include +#include "macros.h" #include #include @@ -54,13 +53,10 @@ int main(int argc, char *argv[]) while (fscanf(stdin, "%lf %lf\n", xyrgb + 0, xyrgb + 1) == 2) { ciexyy_to_srgb(xyrgb[0], xyrgb[1], 1.0, xyrgb + 2, xyrgb + 3, xyrgb + 4); - if (write(1, xyrgb, sizeof(xyrgb)) < (ssize_t)sizeof(xyrgb)) - goto fail; + xwrite(STDOUT_FILENO, xyrgb, sizeof(xyrgb)); } - if (write(1, xyrgb, sizeof(xyrgb)) < (ssize_t)sizeof(xyrgb)) /* sugar */ - goto fail; - if (fstat(1, &attr)) - goto fail; + xwrite(STDOUT_FILENO, xyrgb, sizeof(xyrgb)); /* sugar */ + t (fstat(STDOUT_FILENO, &attr)); if ((size_t)(attr.st_size) != (EXPECTED_ELEMENTS + 1) * 5 * sizeof(double)) return 1; -- cgit v1.2.3-70-g09d2