File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 " );
You can’t perform that action at this time.
0 commit comments