Skip to content

Commit 1a4dd3b

Browse files
committed
Remove trailing white-space from some 3rd party files
1 parent f3a119a commit 1a4dd3b

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

src/json.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ static void append_node(JsonNode *parent, JsonNode *child)
552552
child->parent = parent;
553553
child->prev = parent->children.tail;
554554
child->next = NULL;
555-
555+
556556
if (parent->children.tail != NULL)
557557
parent->children.tail->next = child;
558558
else
@@ -567,7 +567,7 @@ static void prepend_node(JsonNode *parent, JsonNode *child)
567567
child->parent = parent;
568568
child->prev = NULL;
569569
child->next = parent->children.head;
570-
570+
571571
if (parent->children.head != NULL)
572572
parent->children.head->prev = child;
573573
else
@@ -589,7 +589,7 @@ void json_append_element(JsonNode *array, JsonNode *element)
589589
if (array != NULL && element !=NULL) {
590590
assert(array->tag == JSON_ARRAY);
591591
assert(element->parent == NULL);
592-
592+
593593
append_node(array, element);
594594
}
595595
}
@@ -607,7 +607,7 @@ void json_append_member(JsonNode *object, const char *key, JsonNode *value)
607607
if (object != NULL && key != NULL && value != NULL) {
608608
assert(object->tag == JSON_OBJECT);
609609
assert(value->parent == NULL);
610-
610+
611611
append_member(object, json_strdup(key), value);
612612
}
613613
}
@@ -617,7 +617,7 @@ void json_prepend_member(JsonNode *object, const char *key, JsonNode *value)
617617
if (object != NULL && key != NULL && value != NULL) {
618618
assert(object->tag == JSON_OBJECT);
619619
assert(value->parent == NULL);
620-
620+
621621
value->key = json_strdup(key);
622622
prepend_node(object, value);
623623
}
@@ -627,20 +627,20 @@ void json_remove_from_parent(JsonNode *node)
627627
{
628628
if (node != NULL) {
629629
JsonNode *parent = node->parent;
630-
630+
631631
if (parent != NULL) {
632632
if (node->prev != NULL)
633633
node->prev->next = node->next;
634634
else
635635
parent->children.head = node->next;
636-
636+
637637
if (node->next != NULL)
638638
node->next->prev = node->prev;
639639
else
640640
parent->children.tail = node->prev;
641-
641+
642642
free(node->key);
643-
643+
644644
node->parent = NULL;
645645
node->prev = node->next = NULL;
646646
node->key = NULL;

src/json.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ struct JsonNode
4343
/* only if parent is an object or array (NULL otherwise) */
4444
JsonNode *parent;
4545
JsonNode *prev, *next;
46-
46+
4747
/* only if parent is an object (NULL otherwise) */
4848
char *key; /* Must be valid UTF-8. */
49-
49+
5050
JsonTag tag;
5151
union {
5252
/* JSON_BOOL */
5353
bool bool_;
54-
54+
5555
/* JSON_STRING */
5656
char *string_; /* Must be valid UTF-8. */
57-
57+
5858
/* JSON_NUMBER */
5959
double number_;
60-
60+
6161
/* JSON_ARRAY */
6262
/* JSON_OBJECT */
6363
struct {

src/utf8/unchecked.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ DEALINGS IN THE SOFTWARE.
3232

3333
namespace utf8
3434
{
35-
namespace unchecked
35+
namespace unchecked
3636
{
3737
template <typename octet_iterator>
3838
octet_iterator append(uint32_t cp, octet_iterator result)
3939
{
4040
if (cp < 0x80) // one octet
41-
*(result++) = static_cast<uint8_t>(cp);
41+
*(result++) = static_cast<uint8_t>(cp);
4242
else if (cp < 0x800) { // two octets
4343
*(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
4444
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
@@ -70,28 +70,28 @@ namespace utf8
7070
cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f);
7171
break;
7272
case 3:
73-
++it;
73+
++it;
7474
cp = ((cp << 12) & 0xffff) + ((utf8::internal::mask8(*it) << 6) & 0xfff);
7575
++it;
7676
cp += (*it) & 0x3f;
7777
break;
7878
case 4:
7979
++it;
80-
cp = ((cp << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff);
80+
cp = ((cp << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff);
8181
++it;
8282
cp += (utf8::internal::mask8(*it) << 6) & 0xfff;
8383
++it;
84-
cp += (*it) & 0x3f;
84+
cp += (*it) & 0x3f;
8585
break;
8686
}
8787
++it;
88-
return cp;
88+
return cp;
8989
}
9090

9191
template <typename octet_iterator>
9292
uint32_t peek_next(octet_iterator it)
9393
{
94-
return utf8::unchecked::next(it);
94+
return utf8::unchecked::next(it);
9595
}
9696

9797
template <typename octet_iterator>
@@ -121,14 +121,14 @@ namespace utf8
121121
distance (octet_iterator first, octet_iterator last)
122122
{
123123
typename std::iterator_traits<octet_iterator>::difference_type dist;
124-
for (dist = 0; first < last; ++dist)
124+
for (dist = 0; first < last; ++dist)
125125
utf8::unchecked::next(first);
126126
return dist;
127127
}
128128

129129
template <typename u16bit_iterator, typename octet_iterator>
130130
octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
131-
{
131+
{
132132
while (start != end) {
133133
uint32_t cp = utf8::internal::mask16(*start++);
134134
// Take care of surrogate pairs first
@@ -138,7 +138,7 @@ namespace utf8
138138
}
139139
result = utf8::unchecked::append(cp, result);
140140
}
141-
return result;
141+
return result;
142142
}
143143

144144
template <typename u16bit_iterator, typename octet_iterator>
@@ -176,7 +176,7 @@ namespace utf8
176176

177177
// The iterator class
178178
template <typename octet_iterator>
179-
class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
179+
class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
180180
octet_iterator it;
181181
public:
182182
iterator () {}
@@ -188,15 +188,15 @@ namespace utf8
188188
octet_iterator temp = it;
189189
return utf8::unchecked::next(temp);
190190
}
191-
bool operator == (const iterator& rhs) const
192-
{
191+
bool operator == (const iterator& rhs) const
192+
{
193193
return (it == rhs.it);
194194
}
195195
bool operator != (const iterator& rhs) const
196196
{
197197
return !(operator == (rhs));
198198
}
199-
iterator& operator ++ ()
199+
iterator& operator ++ ()
200200
{
201201
::std::advance(it, utf8::internal::sequence_length(it));
202202
return *this;
@@ -206,7 +206,7 @@ namespace utf8
206206
iterator temp = *this;
207207
::std::advance(it, utf8::internal::sequence_length(it));
208208
return temp;
209-
}
209+
}
210210
iterator& operator -- ()
211211
{
212212
utf8::unchecked::prior(it);
@@ -221,7 +221,7 @@ namespace utf8
221221
}; // class iterator
222222

223223
} // namespace utf8::unchecked
224-
} // namespace utf8
224+
} // namespace utf8
225225

226226

227227
#endif // header guard

0 commit comments

Comments
 (0)