get rid of the OFFTPC nonsense and cast to long long use lld to print off_t

This commit is contained in:
Jean-Francois Dockes
2013-09-26 14:35:50 +02:00
parent d198105694
commit 9cb5371820
4 changed files with 9 additions and 17 deletions
+3 -3
View File
@@ -40,7 +40,7 @@
#include <vector>
#include <fstream>
#include <sstream>
using namespace std;
#include <sys/stat.h>
@@ -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();
+3 -3
View File
@@ -464,7 +464,7 @@ void FsIndexer::setlocalfields(const map<string, string>& 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;