From ba28fb9e80f8a862397fc69b6e352ea1bce77b31 Mon Sep 17 00:00:00 2001 From: tth Date: Thu, 11 Jun 2020 15:57:12 +0200 Subject: [PATCH] debug function added --- floatimg.h | 3 ++- lib/fimg-core.c | 6 ++++++ lib/t.c | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/floatimg.h b/floatimg.h index 334ce97..19b52be 100644 --- a/floatimg.h +++ b/floatimg.h @@ -3,7 +3,7 @@ * ugly code from tTh */ -#define FIMG_VERSION 100 +#define FIMG_VERSION 101 /* * in memory descriptor @@ -58,6 +58,7 @@ int fimg_type_is_valid(int type); int fimg_print_version(int k); +void fimg_print_sizeof(void); void fimg_printhead(FloatImg *h); int fimg_describe(FloatImg *head, char *txt); char *fimg_str_type(int type); diff --git a/lib/fimg-core.c b/lib/fimg-core.c index 412ef8c..a8b606c 100644 --- a/lib/fimg-core.c +++ b/lib/fimg-core.c @@ -48,6 +48,12 @@ if (51 == k) { return 0; } /* --------------------------------------------------------------------- */ +void fimg_print_sizeof(void) +{ +fprintf(stderr, " sz FloatImg = %lu\n", sizeof(FloatImg)); +fprintf(stderr, " sz filehead = %lu\n", sizeof(FimgFileHead)); +} +/* --------------------------------------------------------------------- */ void fimg_printhead(FloatImg *h) { printf("%5d %5d %2d %p %p %p %p\n", h->width, h->height, h->type, diff --git a/lib/t.c b/lib/t.c index 9b9e4d7..8b387fa 100644 --- a/lib/t.c +++ b/lib/t.c @@ -266,7 +266,10 @@ while ((opt = getopt(argc, argv, "gn:v")) != -1) { } } -if (verbosity) fimg_print_version(0); +if (verbosity) { + fimg_print_version(1); + fimg_print_sizeof(); + } // foo = essai_normalize(); // fprintf(stderr, "retour essai normalize -> %d\n", foo);