diff --git a/src/common/autoconfig.h.in b/src/common/autoconfig.h.in index eb3dd173..e4ef3e00 100644 --- a/src/common/autoconfig.h.in +++ b/src/common/autoconfig.h.in @@ -111,11 +111,3 @@ #undef _FILE_OFFSET_BITS #undef _LARGE_FILES - -/* The __FreeBSD_kernel__ thing is for debian/kfreebsd. */ -#if _FILE_OFFSET_BITS == 64 || defined(__APPLE__) || defined(__OpenBSD__) ||\ - defined(__FreeBSD_kernel__) || (defined(__FreeBSD__) && __FreeBSD__ >= 9) -#define OFFTPC "%lld" -#else -#define OFFTPC "%ld" -#endif diff --git a/src/index/beaglequeue.cpp b/src/index/beaglequeue.cpp index 6e148e7f..9d0faf56 100644 --- a/src/index/beaglequeue.cpp +++ b/src/index/beaglequeue.cpp @@ -40,7 +40,7 @@ #include #include -#include + using namespace std; #include @@ -410,7 +410,7 @@ BeagleQueueIndexer::processone(const string &path, dotdoc.fmtime = ascdate; char cbuf[100]; - sprintf(cbuf, OFFTPC, stp->st_size); + sprintf(cbuf, "%lld", (long long)stp->st_size); dotdoc.pcbytes = cbuf; // Document signature for up to date checks: none. @@ -457,7 +457,7 @@ BeagleQueueIndexer::processone(const string &path, doc.fmtime = ascdate; char cbuf[100]; - sprintf(cbuf, OFFTPC, stp->st_size); + sprintf(cbuf, "%lld", (long long)stp->st_size); doc.pcbytes = cbuf; // Document signature for up to date checks: none. doc.sig.clear(); diff --git a/src/index/fsindexer.cpp b/src/index/fsindexer.cpp index 109ab060..14d8dd27 100644 --- a/src/index/fsindexer.cpp +++ b/src/index/fsindexer.cpp @@ -464,7 +464,7 @@ void FsIndexer::setlocalfields(const map& fields, Rcl::Doc& doc) void FsIndexer::makesig(const struct stat *stp, string& out) { char cbuf[100]; - sprintf(cbuf, OFFTPC "%ld", stp->st_size, (long)stp->RCL_STTIME); + sprintf(cbuf, "%lld" "%ld", (long long)stp->st_size, (long)stp->RCL_STTIME); out = cbuf; } @@ -703,7 +703,7 @@ FsIndexer::processonefile(RclConfig *config, doc.meta[Rcl::Doc::keyfn] = utf8fn; char cbuf[100]; - sprintf(cbuf, OFFTPC, stp->st_size); + sprintf(cbuf, "%lld", (long long)stp->st_size); doc.pcbytes = cbuf; // Document signature for up to date checks. All subdocs inherit the // file's. @@ -782,7 +782,7 @@ FsIndexer::processonefile(RclConfig *config, if (m_havelocalfields) setlocalfields(localfields, fileDoc); char cbuf[100]; - sprintf(cbuf, OFFTPC, stp->st_size); + sprintf(cbuf, "%lld", (long long)stp->st_size); fileDoc.pcbytes = cbuf; fileDoc.sig = sig; diff --git a/src/utils/smallut.cpp b/src/utils/smallut.cpp index 03a9d931..945fe6a8 100644 --- a/src/utils/smallut.cpp +++ b/src/utils/smallut.cpp @@ -619,7 +619,7 @@ string displayableBytes(off_t size) roundable = double(size) / 1E9; } size = round(roundable); - sprintf(sizebuf, OFFTPC "%s", size, unit); + sprintf(sizebuf, "%lld" "%s", (long long)size, unit); return string(sizebuf); } @@ -1250,7 +1250,7 @@ int main(int argc, char **argv) { thisprog = *argv++;argc--; -#if 0 +#if 1 if (argc <=0 ) { cerr << "Usage: smallut " << endl; exit(1); @@ -1346,7 +1346,7 @@ int main(int argc, char **argv) in = "a: %a title: %(title) pcpc: %% %"; pcSubst(in, out, substs); cout << "After map clear: " << in << " => " << out << endl; -#elif 1 +#elif 0 list tokens; tokens.push_back(""); tokens.push_back("a,b");