diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2016-01-04 18:16:45 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2016-01-04 18:16:45 +0100 |
commit | 453f44a8ac3100bb6c1f2fd33d92ac68a1bcca92 (patch) | |
tree | 9ff6c365f5b17a8ca3b05bb70245922618a5e94f /src/parse_10deg.c | |
parent | initialise partitions (diff) | |
download | radharc-453f44a8ac3100bb6c1f2fd33d92ac68a1bcca92.tar.gz radharc-453f44a8ac3100bb6c1f2fd33d92ac68a1bcca92.tar.bz2 radharc-453f44a8ac3100bb6c1f2fd33d92ac68a1bcca92.tar.xz |
macros
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r-- | src/parse_10deg.c | 12 |
1 files changed, 4 insertions, 8 deletions
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 <http://www.gnu.org/licenses/>. */ #include "haiku.h" -#include <stdio.h> -#include <unistd.h> +#include "macros.h" #include <math.h> #include <sys/stat.h> @@ -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; |