Browse Source

- fixed warning in tifp_check

pull/6/head
Andreas Romeyke 4 years ago
parent
commit
37547653fe
  1. 21
      src/helper/check_print.c

21
src/helper/check_print.c

@ -25,6 +25,7 @@ static inline char *strndup(const char *s, size_t n)
}
#endif
/*
ret_t tif_fails(const char* fail_message) {
ret_t res;
char * str =malloc( sizeof(char) *MAXSTRLEN );
@ -157,13 +158,6 @@ ret_t tif_files(const char *msg) {
return res;
}
void tifp_check( ctiff_t * ctif) {
if (NULL == ctif) { tif_fails("ctif_t pointer is empty\n"); };
if (0 > ctif->fd) { tif_fails("TIFF FD pointer is empty\n"); };
if (NULL == ctif->streamp) { tif_fails("TIFF stream pointer is empty\n"); };
}
/* TODO: add tif_returns specialized for types */
ret_t tif_returns(tag_t tag, const char* expected, const char* value) {
ret_t res;
@ -215,19 +209,22 @@ ret_t tif_fails_by_returns( ret_t ret ) {
ret_t _empty_result() {
ret_t t;
t.returncode=0;
t.returncode=is_valid;
t.returnmsg=NULL;
t.count=1;
t.returnmsg = malloc( sizeof( retmsg_t) * t.count );
retmsg_t * p = t.returnmsg;
if (NULL==t.returnmsg) {
fprintf(stderr, "could not allocate memory for _empty_result\n");
exit(EXIT_FAILURE);
};
// header
p->rm_type=rm_default;
p->rm_msg = "ok";
return t;
}
*/
returncode_t tifp_check( ctiff_t * ctif) {
if (NULL == ctif) { return code_error_ctif_empty; };
if (0 > ctif->fd) { return code_error_filedescriptor_empty; };
if (NULL == ctif->streamp) { return code_error_streampointer_empty; };
return should_not_occure;
}
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 smarttab expandtab :*/
Loading…
Cancel
Save