]> git.lyx.org Git - lyx.git/blobdiff - src/DepTable.cpp
make frontend::Application a bit slimmer
[lyx.git] / src / DepTable.cpp
index 1cef441eb24f2aac9683a461127b6a00de66947a..1279e8cf205d2440dc13bbb21bedf0e4a006ca4a 100644 (file)
@@ -25,9 +25,6 @@
 
 #include <fstream>
 
-#ifndef CXX_GLOBAL_CSTD
-using std::time;
-#endif
 using std::endl;
 using std::flush;
 using std::getline;
@@ -57,26 +54,26 @@ void DepTable::insert(FileName const & f, bool upd)
                dep_info di;
                di.crc_prev = 0;
                if (upd) {
-                       LYXERR(Debug::DEPEND) << " CRC..." << flush;
+                       LYXERR(Debug::DEPEND, " CRC...");
                        di.crc_cur = sum(f);
-                       LYXERR(Debug::DEPEND) << "done." << endl;
+                       LYXERR(Debug::DEPEND, "done.");
                        struct stat f_info;
                        stat(f.toFilesystemEncoding().c_str(), &f_info);
-                       di.mtime_cur = f_info.st_mtime;
+                       di.mtime_cur = long(f_info.st_mtime);
                } else {
                        di.crc_cur = 0;
                        di.mtime_cur = 0;
                }
                deplist[f] = di;
        } else {
-               LYXERR(Debug::DEPEND) << " Already in DepTable" << endl;
+               LYXERR(Debug::DEPEND, " Already in DepTable");
        }
 }
 
 
 void DepTable::update()
 {
-       LYXERR(Debug::DEPEND) << "Updating DepTable..." << endl;
+       LYXERR(Debug::DEPEND, "Updating DepTable...");
        time_type const start_time = current_time();
 
        DepList::iterator itr = deplist.begin();
@@ -87,19 +84,19 @@ void DepTable::update()
                if (stat(itr->first.toFilesystemEncoding().c_str(), &f_info) == 0) {
                        if (di.mtime_cur == f_info.st_mtime) {
                                di.crc_prev = di.crc_cur;
-                               LYXERR(Debug::DEPEND) << itr->first << " same mtime" << endl;
+                               LYXERR(Debug::DEPEND, itr->first << " same mtime");
                        } else {
                                di.crc_prev = di.crc_cur;
-                               LYXERR(Debug::DEPEND) << itr->first << " CRC... " << flush;
+                               LYXERR(Debug::DEPEND, itr->first << " CRC... ");
                                di.crc_cur = sum(itr->first);
-                               LYXERR(Debug::DEPEND) << "done" << endl;
+                               LYXERR(Debug::DEPEND, "done");
                        }
                } else {
                        // file doesn't exist
                        // remove stale files - if it's re-created, it
                        // will be re-inserted by deplog.
-                       LYXERR(Debug::DEPEND) << itr->first
-                               << " doesn't exist. removing from DepTable." << endl;
+                       LYXERR(Debug::DEPEND, itr->first
+                               << " doesn't exist. removing from DepTable.");
                        DepList::iterator doomed = itr++;
                        deplist.erase(doomed);
                        continue;
@@ -113,8 +110,8 @@ void DepTable::update()
                ++itr;
        }
        time_type const time_sec = current_time() - start_time;
-       LYXERR(Debug::DEPEND) << "Finished updating DepTable ("
-               << time_sec << " sec)." << endl;
+       LYXERR(Debug::DEPEND, "Finished updating DepTable ("
+               << time_sec << " sec).");
 }
 
 
@@ -220,10 +217,10 @@ void DepTable::write(FileName const & f) const
                // Store the second (most recently calculated)
                // CRC value.
                // The older one is effectively set to 0 upon re-load.
-               LYXERR(Debug::DEPEND) << "Write dep: "
+               LYXERR(Debug::DEPEND, "Write dep: "
                       << cit->second.crc_cur << ' '
                       << cit->second.mtime_cur << ' '
-                      << cit->first << endl;
+                      << cit->first);
 
                ofs << cit->second.crc_cur << ' '
                    << cit->second.mtime_cur << ' '
@@ -243,8 +240,8 @@ bool DepTable::read(FileName const & f)
        while (ifs >> di.crc_cur >> di.mtime_cur && getline(ifs, nome)) {
                nome = ltrim(nome);
 
-               LYXERR(Debug::DEPEND) << "Read dep: "
-                      << di.crc_cur << ' ' << di.mtime_cur << ' ' << nome << endl;
+               LYXERR(Debug::DEPEND, "Read dep: "
+                      << di.crc_cur << ' ' << di.mtime_cur << ' ' << nome);
 
                deplist[FileName(nome)] = di;
        }