Skip to content

Commit dcf7b9e

Browse files
committed
fix for 32-bit
1 parent 7fb1f6e commit dcf7b9e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎muduo/base/GzipFile.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class GzipFile : boost::noncopyable
4343
int write(StringPiece buf) { return ::gzwrite(file_, buf.data(), buf.size()); }
4444

4545
// number of uncompressed bytes
46-
long tell() const { return ::gztell(file_); }
46+
off_t tell() const { return ::gztell(file_); }
4747

4848
#if ZLIB_VERNUM >= 0x1240
4949
// number of compressed bytes

‎muduo/base/tests/GzipFile_test.cc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ int main()
99
muduo::GzipFile writer = muduo::GzipFile::openForAppend(filename);
1010
if (writer.valid())
1111
{
12-
printf("tell %ld\n", writer.tell());
12+
printf("tell %ld\n", static_cast<long>(writer.tell()));
1313
printf("wrote %d\n", writer.write(data));
14-
printf("tell %ld\n", writer.tell());
14+
printf("tell %ld\n", static_cast<long>(writer.tell()));
1515
}
1616
}
1717

@@ -21,15 +21,15 @@ int main()
2121
if (reader.valid())
2222
{
2323
char buf[256];
24-
printf("tell %ld\n", reader.tell());
24+
printf("tell %ld\n", static_cast<long>(reader.tell()));
2525
int nr = reader.read(buf, sizeof buf);
2626
printf("read %d\n", nr);
2727
if (nr >= 0)
2828
{
2929
buf[nr] = '\0';
3030
printf("data %s", buf);
3131
}
32-
printf("tell %ld\n", reader.tell());
32+
printf("tell %ld\n", static_cast<long>(reader.tell()));
3333
if (strncmp(buf, data, strlen(data)) != 0)
3434
{
3535
printf("failed!!!\n");

0 commit comments

Comments
 (0)