]> git.lyx.org Git - features.git/commitdiff
cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Fri, 30 Nov 2007 22:02:33 +0000 (22:02 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 30 Nov 2007 22:02:33 +0000 (22:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21885 a592a061-630c-0410-9148-cb99ea01b6c8

src/Server.cpp
src/support/lstrings.h

index b36fdd1627487b5878eacb5122f3fa649773d425..a9233745afd1afca82edf7bea37a2109566f2088 100644 (file)
@@ -172,7 +172,7 @@ void LyXComm::closeConnection()
        }
 
        if (!ready_) {
-               lyxerr << "LyXComm: Already disconnected" << endl;
+               LYXERR0("LyXComm: Already disconnected");
                return;
        }
 
@@ -286,10 +286,9 @@ void LyXComm::read_ready()
                        return;
                }
                if (errno != 0) {
-                       lyxerr << "LyXComm: " << strerror(errno) << endl;
+                       LYXERR0("LyXComm: " << strerror(errno));
                        if (!read_buffer_.empty()) {
-                               lyxerr << "LyXComm: truncated command: "
-                                      << read_buffer_ << endl;
+                               LYXERR0("LyXComm: truncated command: " << read_buffer_);
                                read_buffer_.erase();
                        }
                        break; // reset connection
@@ -307,8 +306,7 @@ void LyXComm::read_ready()
 void LyXComm::send(string const & msg)
 {
        if (msg.empty()) {
-               lyxerr << "LyXComm: Request to send empty string. Ignoring."
-                      << endl;
+               LYXERR0("LyXComm: Request to send empty string. Ignoring.");
                return;
        }
 
@@ -317,8 +315,7 @@ void LyXComm::send(string const & msg)
        if (pipename_.empty()) return;
 
        if (!ready_) {
-               lyxerr << "LyXComm: Pipes are closed. Could not send "
-                      << msg << endl;
+               LYXERR0("LyXComm: Pipes are closed. Could not send " << msg);
        } else if (::write(outfd_, msg.c_str(), msg.length()) < 0) {
                lyxerr << "LyXComm: Error sending message: " << msg
                       << '\n' << strerror(errno)
@@ -372,6 +369,13 @@ Server::~Server()
 }
 
 
+int compare(char const * a, char const * b, unsigned int len)
+{
+       using namespace std;
+       return strncmp(a, b, len);
+}
+
+
 // Handle data gotten from communication, called by LyXComm
 void Server::callback(string const & msg)
 {
@@ -459,8 +463,7 @@ void Server::callback(string const & msg)
                                                "Server: ignoring bye messge from unregistered client" << client);
                                }
                        } else {
-                               lyxerr <<"Server: Undefined server command "
-                                      << cmd << '.' << endl;
+                               LYXERR0("Server: Undefined server command " << cmd << '.');
                        }
                        return;
                }
index cfb504f2dbe9ab762a95622ccc19e72aa766ddcc..2ebd774ff96157935f56e9d7744e6740737e271a 100644 (file)
@@ -47,17 +47,6 @@ int compare(char const * a, char const * b)
 #endif
 }
 
-///
-inline
-int compare(char const * a, char const * b, unsigned int len)
-{
-#ifndef CXX_GLOBAL_CSTD
-       return std::strncmp(a, b, len);
-#else
-       return strncmp(a, b, len);
-#endif
-}
-
 ///
 bool isStrInt(std::string const & str);