]> git.lyx.org Git - features.git/blobdiff - src/support/lyxsum.cpp
reduce line noise
[features.git] / src / support / lyxsum.cpp
index 23c0109f466acab0413d3490c7ab0c0920c6ac4c..e1be53ee9300174676427d822b26de37008d5556 100644 (file)
@@ -53,8 +53,7 @@ namespace support {
 
 unsigned long sum(FileName const & file)
 {
-       LYXERR(Debug::FILES) << "lyx::sum() using mmap (lightning fast)"
-                            << endl;
+       LYXERR(Debug::FILES, "lyx::sum() using mmap (lightning fast)");
 
        int fd = open(file.toFilesystemEncoding().c_str(), O_RDONLY);
        if (!fd)
@@ -116,14 +115,13 @@ using std::istreambuf_iterator;
 
 unsigned long sum(FileName const & file)
 {
-       LYXERR(Debug::FILES) << "lyx::sum() using istreambuf_iterator (fast)"
-                            << endl;
+       LYXERR(Debug::FILES, "lyx::sum() using istreambuf_iterator (fast)");
 
        // a directory may be passed here so we need to test it. (bug 3622)
        if (file.isDirectory())
                return 0;
        string filename = file.toFilesystemEncoding();
-       ifstream ifs(filename.c_str());
+       ifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary);
        if (!ifs)
                return 0;
 
@@ -139,16 +137,14 @@ using std::ios;
 
 unsigned long sum(FileName const & file)
 {
-       LYXERR(Debug::FILES)
-               << "lyx::sum() using istream_iterator (slow as a snail)"
-               << endl;
+       LYXERR(Debug::FILES, "lyx::sum() using istream_iterator (slow as a snail)");
 
        // a directory may be passed here so we need to test it. (bug 3622)
        if (file.isDirectory())
                return 0;
 
        string filename = file.toFilesystemEncoding();
-       ifstream ifs(filename.c_str());
+       ifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary);
        if (!ifs)
                return 0;