aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2012-11-05 20:58:45 +0000
committercorvid <corvid@lavabit.com>2012-11-05 20:58:45 +0000
commit0ec42518524159380ffbd19d29dec5b6e65a153c (patch)
tree52d9fcbc7ce1ccd1969bc21cd41d40aae2b4da39
parentb8e30204a84d25b011b8a86dad18915c10accc2b (diff)
trim some spaces
-rw-r--r--dw/hyphenator.cc22
-rw-r--r--dw/hyphenator.hh2
-rw-r--r--lout/misc.hh6
-rw-r--r--src/styleengine.cc2
-rw-r--r--test/liang.cc2
-rw-r--r--test/notsosimplevector.cc6
-rw-r--r--test/trie.cc2
7 files changed, 21 insertions, 21 deletions
diff --git a/dw/hyphenator.cc b/dw/hyphenator.cc
index 61cbef0d..6774f1c8 100644
--- a/dw/hyphenator.cc
+++ b/dw/hyphenator.cc
@@ -33,7 +33,7 @@ Hyphenator::Hyphenator (core::Platform *platform,
char buf[PATH_MAX + 1];
snprintf(buf, sizeof (buf), "%s.trie", patFile);
FILE *trieF = fopen (buf, "r");
-
+
if (trieF) {
trie = new Trie ();
if (trie->load (trieF) != 0) {
@@ -42,7 +42,7 @@ Hyphenator::Hyphenator (core::Platform *platform,
}
fclose (trieF);
}
-
+
if (trie == NULL) {
TrieBuilder trieBuilder(pack);
FILE *patF = fopen (patFile, "r");
@@ -192,7 +192,7 @@ bool Hyphenator::isHyphenationCandidate (const char *word)
{
// Short words aren't hyphenated.
return (strlen (word) > 4); // TODO UTF-8?
-}
+}
/**
* Test whether the character on which "s" points (UTF-8) is an actual
@@ -214,7 +214,7 @@ bool Hyphenator::isCharPartOfActualWord (char *s)
(unsigned char)s[1] == 0xbc /* ü */ ||
(unsigned char)s[1] == 0x9f /* ß */ ));
#endif
-
+
return lout::unicode::isAlpha (lout::unicode::decodeUtf8 (s));
}
@@ -231,8 +231,8 @@ int *Hyphenator::hyphenateWord(const char *word, int *numBreaks)
char *wordLc = platform->textToLower (word, strlen (word));
// Determine "actual" word. See isCharPartOfActualWord for exact definition.
-
- // Only this actual word is used, and "startActualWord" is added to the
+
+ // Only this actual word is used, and "startActualWord" is added to the
// break positions, so that these refer to the total word.
int startActualWord = 0;
while (wordLc[startActualWord] &&
@@ -252,7 +252,7 @@ int *Hyphenator::hyphenateWord(const char *word, int *numBreaks)
endActualWord = i;
i = platform->nextGlyph (wordLc, i);
}
-
+
endActualWord = platform->nextGlyph (wordLc, endActualWord);
wordLc[endActualWord] = 0;
@@ -279,7 +279,7 @@ int *Hyphenator::hyphenateWord(const char *word, int *numBreaks)
strcpy (work, ".");
strcat (work, wordLc + startActualWord);
strcat (work, ".");
-
+
int l = strlen (work);
SimpleVector <int> points (l + 1);
points.setSize (l + 1, 0);
@@ -308,7 +308,7 @@ int *Hyphenator::hyphenateWord(const char *word, int *numBreaks)
// TODO: Characters, not bytes (as above).
points.set (points.size() - 2, 0);
points.set (points.size() - 3, 0);
-
+
// Examine the points to build the pieces list.
SimpleVector <int> breakPos (1);
@@ -402,7 +402,7 @@ int TrieBuilder::insertState (StackEntry *state, bool root)
for (int j = 1; j < 256; j++) {
Trie::TrieNode *tn = tree->getRef(i + j);
-
+
if (state->next[j] || state->data[j]) {
tn->c = j;
tn->next = state->next[j];
@@ -467,7 +467,7 @@ void TrieBuilder::insertSorted (unsigned char *s, const char *data)
int len = strlen((char*)s);
for (int i = 0; i < len; i++) {
- if (stateStack->size () > i + 1 &&
+ if (stateStack->size () > i + 1 &&
stateStack->getRef (i + 1)->c != s[i]) {
for (int j = stateStack->size () - 1; j >= i + 1; j--)
stateStackPop();
diff --git a/dw/hyphenator.hh b/dw/hyphenator.hh
index eadcf081..743a9073 100644
--- a/dw/hyphenator.hh
+++ b/dw/hyphenator.hh
@@ -97,7 +97,7 @@ class Hyphenator: public lout::object::Object
*/
core::Platform *platform;
Trie *trie;
-
+
lout::container::typed::HashTable <lout::object::ConstString,
lout::container::typed::Vector
<lout::object::Integer> > *exceptions;
diff --git a/lout/misc.hh b/lout/misc.hh
index e5413f05..b0c0b2f8 100644
--- a/lout/misc.hh
+++ b/lout/misc.hh
@@ -331,7 +331,7 @@ private:
}
}
- void consolidate ()
+ void consolidate ()
{
if (startExtra != -1) {
numMain += numExtra;
@@ -343,7 +343,7 @@ private:
numExtra = 0;
}
}
-
+
public:
inline NotSoSimpleVector (int initAlloc)
{
@@ -407,7 +407,7 @@ public:
this->numExtra = numInsert;
this->startExtra = index;
resizeExtra ();
- } else {
+ } else {
if (index < startExtra) {
consolidate ();
insert (index, numInsert);
diff --git a/src/styleengine.cc b/src/styleengine.cc
index f5994b7d..2c7b1d7a 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -70,7 +70,7 @@ void StyleEngine::stackPush () {
static const Node emptyNode = {
NULL, NULL, NULL, NULL, NULL, NULL, false, NULL
};
-
+
stack->setSize (stack->size () + 1, emptyNode);
}
diff --git a/test/liang.cc b/test/liang.cc
index 4b756a60..71ed6210 100644
--- a/test/liang.cc
+++ b/test/liang.cc
@@ -5,7 +5,7 @@
void hyphenateWord (dw::core::Platform *p, const char *word)
{
dw::Hyphenator *h = dw::Hyphenator::getHyphenator (p, "de");
-
+
int numBreaks;
int *breakPos = h->hyphenateWord (word, &numBreaks);
for (int i = 0; i < numBreaks + 1; i++) {
diff --git a/test/notsosimplevector.cc b/test/notsosimplevector.cc
index 1398c191..d41288fb 100644
--- a/test/notsosimplevector.cc
+++ b/test/notsosimplevector.cc
@@ -22,12 +22,12 @@ int main (int argc, char *argv[])
lout::misc::NotSoSimpleVector<int> v(1);
for (int i = 1; i <= 10; i++) {
- v.increase ();
+ v.increase ();
v.set(v.size () - 1, i);
}
print (&v);
-
+
v.insert (2, 4);
for (int i = 0; i < 5; i++)
v.set (2 + i, 31 + i);
@@ -45,7 +45,7 @@ int main (int argc, char *argv[])
v.set (10 + i, 531 + i);
print (&v);
-
+
v.insert (1, 4);
for (int i = 0; i < 5; i++)
v.set (1 + i, 21 + i);
diff --git a/test/trie.cc b/test/trie.cc
index 943b8045..628daabf 100644
--- a/test/trie.cc
+++ b/test/trie.cc
@@ -4,7 +4,7 @@
int main (int argc, char *argv[])
{
dw::fltk::FltkPlatform p;
-
+
if (argc < 2) {
fprintf(stderr, "Usage: trie <pattern file>\n");
exit (1);