]> git.lyx.org Git - features.git/commitdiff
whitespace cleanup
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 5 Apr 2006 23:39:11 +0000 (23:39 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 5 Apr 2006 23:39:11 +0000 (23:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13563 a592a061-630c-0410-9148-cb99ea01b6c8

13 files changed:
src/support/RandomAccessList.h
src/support/filename.C
src/support/filetools.C
src/support/filetools.h
src/support/forkedcall.C
src/support/forkedcallqueue.h
src/support/fs_extras.C
src/support/gzstream.C
src/support/gzstream.h
src/support/mkdir.C
src/support/os_win32.C
src/support/strerror.c
src/support/tempname.C

index 2e419bd7001491cdf87cf52fdd3069dc1a6d3200..c26d64668bdb0619111a862fe473de3e184e2075 100644 (file)
@@ -31,7 +31,7 @@ keeps the std::list::iterator interface. A typical use would be:
 
        typedef RandomAccessList<some_class> MyContainer;
 
-Then you can use MyContainer as if it was a standard 
+Then you can use MyContainer as if it was a standard
 std::vector<some_class> for operator[] access and as if it was a
 standard std::list for iterator access. The main difference with
 std::vector is that insertion of elements is much less costly. Compared
index e46b5105848adea02246763fe1bf515b6b745788..67dde87f724b340d9919ee89f736943a347a0fe2 100644 (file)
@@ -99,7 +99,7 @@ string const FileName::mangledFilename(std::string const & dir) const
        s << counter++ << mname;
        mname = s.str();
 
-       // MiKTeX's YAP (version 2.4.1803) crashes if the file name 
+       // MiKTeX's YAP (version 2.4.1803) crashes if the file name
        // is longer than about 160 characters. MiKTeX's pdflatex
        // is even pickier. A maximum length of 100 has been proven to work.
        // If dir.size() > max length, all bets are off for YAP. We truncate
index 9c51d2aff9a3e85edfec5b1312be984d5b34cf68..ff8c46b4da1cd095373c1a3efc152fd92b5967dc 100644 (file)
@@ -607,7 +607,7 @@ string const NormalizePath(string const & path)
 
        if (!npath.is_complete())
                return "./" + npath.string() + '/';
-       
+
        return npath.string() + '/';
 }
 
index 7c0262cf2654faf93de72eed8ce4fbc9f24fdb19..423c4d4743443a7f08d694f89c0a82a227823a16 100644 (file)
@@ -180,7 +180,7 @@ std::string const unzippedFileName(std::string const & zipped_file);
   Will overwrite an already existing unzipped file without warning.
  */
 std::string const unzipFile(std::string const & zipped_file,
-                            std::string const & unzipped_file = std::string());
+                           std::string const & unzipped_file = std::string());
 
 /// Returns true is path is absolute
 bool AbsolutePath(std::string const & path);
index 66bb45d2212348d098f87ccee614fc95433577f7..4d4c1ac315a87f7d10db6257bcfbe6c1e4e879f5 100644 (file)
@@ -365,7 +365,7 @@ int Forkedcall::generateChild()
        pid_t const cpid = spawnvp(P_SESSION|P_DEFAULT|P_MINIMIZE|P_BACKGROUND,
                                   argv[0], &*argv.begin());
 #elif defined (_WIN32)
-       pid_t const cpid = spawnvp(_P_NOWAIT, argv[0], &*argv.begin());
+       pid_t const cpid = spawnvp(_P_NOWAIT, argv[0], &*argv.begin());
 #else // POSIX
        pid_t const cpid = ::fork();
        if (cpid == 0) {
index 20b939791bd81432f643dcd00794306161774012..be9953a8819ff44ae230c9086237b5c09bb917fb 100644 (file)
@@ -31,13 +31,13 @@ class ForkedCallQueue {
 public:
        /// A process in the queue
        typedef std::pair<std::string, Forkedcall::SignalTypePtr> Process;
-        /** Add a process to the queue. Processes are forked sequentially
-        *  only one is running at a time.
-         *  Connect to the returned signal and you'll be informed when
-         *  the process has ended.
-         */
+       /** Add a process to the queue. Processes are forked sequentially
+        *  only one is running at a time.
+        *  Connect to the returned signal and you'll be informed when
+        *  the process has ended.
+        */
        Forkedcall::SignalTypePtr add(std::string const & process);
-       /// Query whether the queue is running a forked process now.
+       /// Query whether the queue is running a forked process now.
        bool running() const;
        /// Get the and only instance of the class
        static ForkedCallQueue & get();
index 23f794761d3299645d496265be2aade151ad6afa..0be6a708113cd3c6f39dfa0100d767d06a8422b9 100644 (file)
@@ -83,8 +83,8 @@ bool is_readonly(path const & ph)
 #endif
 #ifdef BOOST_WINDOWS
        DWORD const attr = ::GetFileAttributes(ph.string().c_str());
-        return (attr != INVALID_FILE_ATTRIBUTES
-                && (attr & FILE_ATTRIBUTE_READONLY));
+       return (attr != INVALID_FILE_ATTRIBUTES
+               && (attr & FILE_ATTRIBUTE_READONLY));
 #endif
 }
 
@@ -94,7 +94,7 @@ void copy_file(path const & source, path const & target, bool noclobber)
 
 #ifdef BOOST_POSIX
        int const infile = ::open(source.string().c_str(), O_RDONLY);
-        if (infile == -1) {
+       if (infile == -1) {
                boost::throw_exception(
                        filesystem_error(
                                "boost::filesystem::copy_file",
@@ -102,52 +102,52 @@ void copy_file(path const & source, path const & target, bool noclobber)
                                fs::detail::system_error_code()));
        }
 
-        struct stat source_stat;
-        int const ret = ::fstat(infile, &source_stat);
-        if (ret == -1) {
-                ::close(infile);
+       struct stat source_stat;
+       int const ret = ::fstat(infile, &source_stat);
+       if (ret == -1) {
+               ::close(infile);
                boost::throw_exception(
                        filesystem_error(
                                "boost::filesystem::copy_file",
                                source, target,
                                fs::detail::system_error_code()));
-        }
+       }
 
-        int const flags = O_WRONLY | O_CREAT | (noclobber ? O_EXCL : O_TRUNC);
+       int const flags = O_WRONLY | O_CREAT | (noclobber ? O_EXCL : O_TRUNC);
 
-        int const outfile = ::open(target.string().c_str(), flags, source_stat.st_mode);
-        if (outfile == -1) {
-                ::close(infile);
+       int const outfile = ::open(target.string().c_str(), flags, source_stat.st_mode);
+       if (outfile == -1) {
+               ::close(infile);
                boost::throw_exception(
                        filesystem_error(
                                "boost::filesystem::copy_file",
                                source, target,
                                fs::detail::system_error_code()));
-        }
-
-        std::size_t const buf_sz = 32768;
-        char buf[buf_sz];
-        ssize_t in = -1;
-        ssize_t out = -1;
-
-        while (true) {
-                in = ::read(infile, buf, buf_sz);
-                if (in == -1) {
-                        break;
-                } else if (in == 0) {
-                        break;
-                } else {
-                        out = ::write(outfile, buf, in);
-                        if (out == -1) {
-                                break;
-                        }
-                }
-        }
-
-        ::close(infile);
-        ::close(outfile);
-
-        if (in == -1 || out == -1)
+       }
+
+       std::size_t const buf_sz = 32768;
+       char buf[buf_sz];
+       ssize_t in = -1;
+       ssize_t out = -1;
+
+       while (true) {
+               in = ::read(infile, buf, buf_sz);
+               if (in == -1) {
+                       break;
+               } else if (in == 0) {
+                       break;
+               } else {
+                       out = ::write(outfile, buf, in);
+                       if (out == -1) {
+                               break;
+                       }
+               }
+       }
+
+       ::close(infile);
+       ::close(outfile);
+
+       if (in == -1 || out == -1)
                boost::throw_exception(
                        filesystem_error(
                                "boost::filesystem::copy_file",
index 13013abdc0d9fc8ec0edab4c10fc9581818ecebc..e1fcf5a442ee5ce08c28311c51c0a9d843f6d206 100644 (file)
@@ -48,57 +48,57 @@ namespace GZSTREAM_NAMESPACE {
 
 gzstreambuf* gzstreambuf::open( const char* name, int open_mode) {
     if ( is_open())
-        return (gzstreambuf*)0;
+       return (gzstreambuf*)0;
     mode = open_mode;
     // no append nor read/write mode
     if ((mode & std::ios::ate) || (mode & std::ios::app)
-        || ((mode & std::ios::in) && (mode & std::ios::out)))
-        return (gzstreambuf*)0;
+       || ((mode & std::ios::in) && (mode & std::ios::out)))
+       return (gzstreambuf*)0;
     char  fmode[10];
     char* fmodeptr = fmode;
     if ( mode & std::ios::in)
-        *fmodeptr++ = 'r';
+       *fmodeptr++ = 'r';
     else if ( mode & std::ios::out)
-        *fmodeptr++ = 'w';
+       *fmodeptr++ = 'w';
     *fmodeptr++ = 'b';
     *fmodeptr = '\0';
     file = gzopen( name, fmode);
     if (file == 0)
-        return (gzstreambuf*)0;
+       return (gzstreambuf*)0;
     opened = 1;
     return this;
 }
 
 gzstreambuf * gzstreambuf::close() {
     if ( is_open()) {
-        sync();
-        opened = 0;
-        if ( gzclose( file) == Z_OK)
-            return this;
+       sync();
+       opened = 0;
+       if ( gzclose( file) == Z_OK)
+           return this;
     }
     return (gzstreambuf*)0;
 }
 
 int gzstreambuf::underflow() { // used for input buffer only
     if ( gptr() && ( gptr() < egptr()))
-        return * reinterpret_cast<unsigned char *>( gptr());
+       return * reinterpret_cast<unsigned char *>( gptr());
 
     if ( ! (mode & std::ios::in) || ! opened)
-        return EOF;
+       return EOF;
     // Josuttis' implementation of inbuf
     int n_putback = gptr() - eback();
     if ( n_putback > 4)
-        n_putback = 4;
+       n_putback = 4;
     memcpy( buffer + (4 - n_putback), gptr() - n_putback, n_putback);
 
     int num = gzread( file, buffer+4, bufferSize-4);
     if (num <= 0) // ERROR or EOF
-        return EOF;
+       return EOF;
 
     // reset buffer pointers
     setg( buffer + (4 - n_putback),   // beginning of putback area
-          buffer + 4,                 // read position
-          buffer + 4 + num);          // end of buffer
+         buffer + 4,                 // read position
+         buffer + 4 + num);          // end of buffer
 
     // return next character
     return * reinterpret_cast<unsigned char *>( gptr());
@@ -109,20 +109,20 @@ int gzstreambuf::flush_buffer() {
     // sync() operation.
     int w = pptr() - pbase();
     if ( gzwrite( file, pbase(), w) != w)
-        return EOF;
+       return EOF;
     pbump( -w);
     return w;
 }
 
 int gzstreambuf::overflow( int c) { // used for output buffer only
     if ( ! ( mode & std::ios::out) || ! opened)
-        return EOF;
+       return EOF;
     if (c != EOF) {
-        *pptr() = c;
-        pbump(1);
+       *pptr() = c;
+       pbump(1);
     }
     if ( flush_buffer() == EOF)
-        return EOF;
+       return EOF;
     return c;
 }
 
@@ -131,8 +131,8 @@ int gzstreambuf::sync() {
     // which caused improper behavior with std::endl and flush(),
     // bug reported by Vincent Ricard.
     if ( pptr() && pptr() > pbase()) {
-        if ( flush_buffer() == EOF)
-            return -1;
+       if ( flush_buffer() == EOF)
+           return -1;
     }
     return 0;
 }
@@ -152,13 +152,13 @@ gzstreambase::~gzstreambase() {
 
 void gzstreambase::open( const char* name, int open_mode) {
     if ( ! buf.open( name, open_mode))
-        clear( rdstate() | std::ios::badbit);
+       clear( rdstate() | std::ios::badbit);
 }
 
 void gzstreambase::close() {
     if ( buf.is_open())
-        if ( ! buf.close())
-            clear( rdstate() | std::ios::badbit);
+       if ( ! buf.close())
+           clear( rdstate() | std::ios::badbit);
 }
 
 #ifdef GZSTREAM_NAMESPACE
index 0adeb62a99b89f4ab89e562da744d7a896ac07c0..3c4568d6847dd94dc504c3cca8b959458b050606 100644 (file)
@@ -60,11 +60,11 @@ private:
     int flush_buffer();
 public:
     gzstreambuf() : opened(0) {
-        setp( buffer, buffer + (bufferSize-1));
-        setg( buffer + 4,     // beginning of putback area
-              buffer + 4,     // read position
-              buffer + 4);    // end position
-        // ASSERT: both input & output capabilities will not be used together
+       setp( buffer, buffer + (bufferSize-1));
+       setg( buffer + 4,     // beginning of putback area
+             buffer + 4,     // read position
+             buffer + 4);    // end position
+       // ASSERT: both input & output capabilities will not be used together
     }
     int is_open() { return opened; }
     gzstreambuf* open( const char* name, int open_mode);
@@ -98,10 +98,10 @@ class igzstream : public gzstreambase, public std::istream {
 public:
     igzstream() : std::istream( &buf) {}
     igzstream( const char* name, int open_mode = std::ios::in)
-        : gzstreambase( name, open_mode), std::istream( &buf) {}
+       : gzstreambase( name, open_mode), std::istream( &buf) {}
     gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); }
     void open( const char* name, int open_mode = std::ios::in) {
-        gzstreambase::open( name, open_mode);
+       gzstreambase::open( name, open_mode);
     }
 };
 
@@ -109,10 +109,10 @@ class ogzstream : public gzstreambase, public std::ostream {
 public:
     ogzstream() : std::ostream( &buf) {}
     ogzstream( const char* name, int mode = std::ios::out)
-        : gzstreambase( name, mode), std::ostream( &buf) {}
+       : gzstreambase( name, mode), std::ostream( &buf) {}
     gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); }
     void open( const char* name, int open_mode = std::ios::out) {
-        gzstreambase::open( name, open_mode);
+       gzstreambase::open( name, open_mode);
     }
 };
 
index 4a068b42bb6aec8e9a576b1f1366f9fceef329da..5d91b713bb8998e3b4b7225a8479321f321ad9ee 100644 (file)
@@ -41,7 +41,7 @@ int lyx::support::mkdir(std::string const & pathname, unsigned long int mode)
        // plain Windows 32
        return CreateDirectory(pathname.c_str(), 0) != 0 ? 0 : -1;
 #elif HAVE__MKDIR
-       return ::_mkdir(pathname.c_str());
+       return ::_mkdir(pathname.c_str());
 #else
 #   error "Don't know how to create a directory on this system."
 #endif
index 71d2ff5d5642894574091eaee927647bf900baa8..8fad6344d30610b71d2101146cdecf0763397aa3 100644 (file)
@@ -310,7 +310,7 @@ GetFolderPath::GetFolderPath()
        folder_path_func_ = reinterpret_cast<function_pointer>(::GetProcAddress(folder_module_, "SHGetFolderPathA"));
        if (folder_path_func_ == 0) {
                lyxerr << "Unable to find SHGetFolderPathA in shfolder.dll\n"
-                         "Don't know how to proceed. Sorry."
+                         "Don't know how to proceed. Sorry."
                       << std::endl;
                bail_out();
        }
index adf217865f0ebc34c4803a39b3006147fa028fd2..b678ddadcce14682d7e18dfde03106dc1e1ef3e2 100644 (file)
@@ -5,13 +5,13 @@
 
 #include <config.h>
 
-/*     $Id: strerror.c,v 1.3 2000/08/04 13:12:30 lasgouttes Exp $      */
+/*     $Id: strerror.c,v 1.3 2000/08/04 13:12:30 lasgouttes Exp $      */
 
 #if !defined(lint) && !defined(WITH_WARNINGS)
 static char vcid[] = "$Id: strerror.c,v 1.3 2000/08/04 13:12:30 lasgouttes Exp $";
 #endif /* lint */
 
-extern int     sys_nerr ;
+extern int     sys_nerr ;
 extern char *  sys_errlist [] ;
 
 char * strerror (int errnum)
index afad6dedcfa1853e510b1f208c2fbaa869fa3bd4..601e21b30f2a38aceda307f1e292299d6f1eefce 100644 (file)
@@ -57,8 +57,8 @@ int make_tempfile(char * templ)
        return ::open(templ, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
 # elif defined (HAVE__OPEN)
        return ::_open(templ,
-                      _O_RDWR | _O_CREAT | _O_EXCL,
-                      _S_IREAD | _S_IWRITE);
+                      _O_RDWR | _O_CREAT | _O_EXCL,
+                      _S_IREAD | _S_IWRITE);
 # else
 #  error No open() function.
 # endif