diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CopyJob.cc | 1 | ||||
-rw-r--r-- | lib/Exceptions.cc | 9 | ||||
-rw-r--r-- | lib/String.cc | 14 |
3 files changed, 11 insertions, 13 deletions
diff --git a/lib/CopyJob.cc b/lib/CopyJob.cc index 3e6180d..329dd63 100644 --- a/lib/CopyJob.cc +++ b/lib/CopyJob.cc @@ -3,7 +3,6 @@ #endif #include "gettext.h" #include "CopyJob.h" -#include "General.h" CopyJob::CopyJob(Handle * as, Handle * ad, ssize_t asiz, bool ads, bool add) : s(as), d(ad), ds(ads), dd(add), siz(asiz), cursiz(0), r(0), w(0), tw(0) { s->SetNonBlock(); diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc index c46dcfc..3be7c65 100644 --- a/lib/Exceptions.cc +++ b/lib/Exceptions.cc @@ -178,14 +178,23 @@ void * Base::calloc(size_t n, size_t s) { } void * Base::operator new(size_t s) { +#ifdef DEBUG + cerr << "Operator new(s) called. Allocating memory.\n"; +#endif return xmalloc(s); } void * Base::operator new(size_t s, void * p) { +#ifdef DEBUG + printm(M_BARE, "Operator new(s, p) called with p = %p and s = %i. Erasing memory.\n", p, s); +#endif return memset(p, 0, s); } void Base::operator delete(void * p) { +#ifdef DEBUG + printm(M_BARE, "Operator delete(p) called. Freeing memory.\n"); +#endif xfree(p); } diff --git a/lib/String.cc b/lib/String.cc index 062587d..510a84e 100644 --- a/lib/String.cc +++ b/lib/String.cc @@ -10,12 +10,10 @@ char ** gruikptr; -#ifdef USE_DATE extern "C" { double dateCalc(char *, char *); int isDateArgument(char *); } -#endif char String::t[BUFSIZ + 1]; @@ -86,8 +84,7 @@ String::String(unsigned int i) { siz = ::strlen(str); } -#ifdef USE_LONG_LONG -String::String(long long l) { +String::String(int64 l) { char t[40]; sprintf(t, "%lld", l); @@ -95,14 +92,13 @@ String::String(long long l) { siz = ::strlen(str); } -String::String(unsigned long long l) { +String::String(uint64 l) { char t[40]; sprintf(t, "%llu", l); str = Base::strdup(t); siz = ::strlen(str); } -#endif String::String(double d) { char t[30]; @@ -321,12 +317,10 @@ int String::strchrcnt(char c) const { return cnt; } -#ifdef USE_DATE String String::to_sqldate(void) const { /* DD/MM/YYYY ==> YYYYMMMDD */ return (is_date() ? extract(6, 9) + extract(3, 4) + extract(0, 1) : ""); } -#endif String String::to_sqltime(void) const { /* h:m ==> h * 60 + m */ @@ -334,12 +328,10 @@ String String::to_sqltime(void) const { return (is_time() ? String(extract(0, p - 1).to_int() * 60 + extract(p + 1).to_int()) : ""); } -#ifdef USE_DATE String String::from_sqldate(void) const { /* YYYYMMDD ==> DD/MM/YYYY */ return ((strlen() == 8) && is_number() ? extract(6, 7) + '/' + extract(4, 5) + '/' + extract(0, 3) : ""); } -#endif String String::from_sqltime(void) const { /* t ==> (t / 60):(t % 60) */ @@ -347,7 +339,6 @@ String String::from_sqltime(void) const { return (is_number() ? String((int) (t / 60)) + ':' + (t % 60) : ""); } -#ifdef USE_DATE bool String::is_date(void) const { /* 'DD/MM/YYYY' 0123456789 */ @@ -372,7 +363,6 @@ double String::datedif(const String & s) const { return -1; } -#endif bool String::is_number(void) const { for (size_t i = ((str[0] == '-') ? 1 : 0); i < siz; i++) { |