]> git.lyx.org Git - features.git/commitdiff
cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Wed, 12 Dec 2007 22:43:37 +0000 (22:43 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 12 Dec 2007 22:43:37 +0000 (22:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22114 a592a061-630c-0410-9148-cb99ea01b6c8

src/VSpace.cpp
src/frontends/qt4/GuiToolbar.cpp
src/support/lstrings.h

index 45379fd85dce898d3fca4cdd9340d17699d4ba3f..9003951e912a514ee58e1f827d26950d6d7d98b1 100644 (file)
@@ -23,6 +23,8 @@
 #include "support/convert.h"
 #include "support/lstrings.h"
 
+#include <cstring>
+
 using namespace std;
 using namespace lyx::support;
 
@@ -32,11 +34,14 @@ namespace {
 
 /// used to return numeric values in parsing vspace
 double number[4] = { 0, 0, 0, 0 };
+
 /// used to return unit types in parsing vspace
-Length::UNIT unit[4] = { Length::UNIT_NONE,
-                           Length::UNIT_NONE,
-                           Length::UNIT_NONE,
-                           Length::UNIT_NONE };
+Length::UNIT unit[4] = {
+       Length::UNIT_NONE,
+       Length::UNIT_NONE,
+       Length::UNIT_NONE,
+       Length::UNIT_NONE
+};
 
 /// the current position in the number array
 int number_index;
@@ -44,16 +49,14 @@ int number_index;
 int unit_index;
 
 /// skip n characters of input
-inline
-void lyx_advance(string & data, string::size_type n)
+inline void lyx_advance(string & data, size_t n)
 {
        data.erase(0, n);
 }
 
 
 /// return true when the input is at the end
-inline
-bool isEndOfData(string const & data)
+inline bool isEndOfData(string const & data)
 {
        return ltrim(data).empty();
 }
@@ -98,7 +101,7 @@ char nextToken(string & data)
                return '-';
        }
 
-       string::size_type i = data.find_first_not_of("0123456789.");
+       size_t i = data.find_first_not_of("0123456789.");
 
        if (i != 0) {
                if (number_index > 3)
@@ -110,8 +113,9 @@ char nextToken(string & data)
                if (i == string::npos) {
                        buffer = data;
                        i = data.size() + 1;
-               } else
+               } else {
                        buffer = data.substr(0, i);
+               }
 
                lyx_advance(data, i);
 
@@ -134,8 +138,9 @@ char nextToken(string & data)
                if (i == string::npos) {
                        buffer = data;
                        i = data.size() + 1;
-               } else
+               } else {
                        buffer = data.substr(0, i);
+               }
 
                // possibly we have "mmplus" string or similar
                if (buffer.size() > 5 &&
@@ -256,7 +261,7 @@ bool isValidGlueLength(string const & data, GlueLength * result)
 
        // search "pattern" in "table"
        table_index = 0;
-       while (compare(pattern, table[table_index].pattern)) {
+       while (strcmp(pattern, table[table_index].pattern)) {
                ++table_index;
                if (!*table[table_index].pattern)
                        return false;
@@ -321,7 +326,7 @@ bool isValidLength(string const & data, Length * result)
        pattern[pattern_index] = '\0';
 
        // only the most basic pattern is accepted here
-       if (compare(pattern, "nu") != 0)
+       if (strcmp(pattern, "nu") != 0)
                return false;
 
        // It _was_ a correct length string.
@@ -366,7 +371,7 @@ VSpace::VSpace(string const & data)
 
        string input = rtrim(data);
 
-       string::size_type const length = input.length();
+       size_t const length = input.length();
 
        if (length > 1 && input[length - 1] == '*') {
                keep_ = true;
index ecba34a10d223bec8ba6f07ed085fbb63be15eb4..1ee1b2e9c88e76e5ceb3d57e943d7e3ce9f85c4e 100644 (file)
@@ -76,7 +76,7 @@ struct PngMap {
 
 bool operator<(PngMap const & lhs, PngMap const & rhs)
 {
-               return compare(lhs.key, rhs.key) < 0;
+               return strcmp(lhs.key, rhs.key) < 0;
 }
 
 
index 016331f27bf76ab1f3d570812a4e4e5fe1ed3da8..381e818f763336286fa3d1836ad3980a90b9d0e7 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "support/docstring.h"
 
-#include <cstring>
 #include <string>
 #include <vector>
 
@@ -36,13 +35,6 @@ int compare_ascii_no_case(std::string const & s, std::string const & s2);
 /// Compare \p s and \p s2, ignoring the case of ASCII characters only.
 int compare_ascii_no_case(docstring const & s, docstring const & s2);
 
-///
-inline int compare(char const * a, char const * b)
-{
-       using namespace std;
-       return strcmp(a, b);
-}
-
 ///
 bool isStrInt(std::string const & str);