diff --git a/src/cb/source/d4open.c b/src/cb/source/d4open.c index 36dcc7760..94a0d1f33 100755 --- a/src/cb/source/d4open.c +++ b/src/cb/source/d4open.c @@ -1162,7 +1162,9 @@ DATA4FILE *dfile4open( CODE4 *c4, DATA4 *data, const char *name, char **info ) return 0 ; } } - d4 = (DATA4FILE *)mem4alloc( c4->data4fileMemory ) ; + + + d4 = (DATA4FILE *)mem4alloc( c4->data4fileMemory ) ; if ( d4 == 0 ) { error4( c4, e4memory, E91102 ) ; diff --git a/src/cg/cg3100.cpp b/src/cg/cg3100.cpp index 23e4e6d32..93cbb523d 100755 --- a/src/cg/cg3100.cpp +++ b/src/cg/cg3100.cpp @@ -440,33 +440,6 @@ HIDDEN int tipo_registro(const char* cod, int anno) return atoi(tipo_reg); } -static bool between(const TString& code, const TString& mini, const TString& maxi) -{ - if (mini.full() && code < mini) - return false; - if (maxi.full() && code > maxi) - return false; - return true; -} - -static bool between(const TDate& code, const TDate& mini, const TDate& maxi) -{ - if (mini.ok() && code < mini) - return false; - if (maxi.ok() && code > maxi) - return false; - return true; -} - -static bool between(long code, long mini, long maxi) -{ - if (mini > 0 && code < mini) - return false; - if (maxi > 0 && code > maxi) - return false; - return true; -} - bool TListaMov_application::rmoviva_filter(const TRectype& rmoviva) const { const TString& codiva = rmoviva.get(RMI_CODIVA); diff --git a/src/include/utility.h b/src/include/utility.h index 0c2d526cb..8a202a53c 100755 --- a/src/include/utility.h +++ b/src/include/utility.h @@ -124,6 +124,9 @@ void split_IBAN(const char * iban, TString & iso, TString & icin, void set_test_mail(const TString & email); bool send_mail(TToken_string & to, TToken_string & cc, TToken_string & ccn, const char * subj, const char * text, TToken_string & attachment, bool ui, bool receipt); + +inline bool between(const TString& val, const TString& a, const TString& b) { return ((a.blank() || val >= a) && (b.blank() || val <= b)); } +inline bool between(const TDate& val, const TDate& a, const TDate& b) { return ((!a.ok() || val >= a) && (!b.ok() || val <= b)); } inline bool between(const long val, const long a, const long b) { return ((a == 0 ||val >= a) && (b == 0 || val <= b)); } #endif /* __UTILITY_H */