Skip to content

Commit 11086dd

Browse files
committed
Enabled PointerBindsToType in clang-format options.
1 parent 30b07c0 commit 11086dd

File tree

14 files changed

+540
-540
lines changed

14 files changed

+540
-540
lines changed

Diff for: .clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PenaltyBreakString: 1000
2727
PenaltyBreakFirstLessLess: 120
2828
PenaltyExcessCharacter: 1000000
2929
PenaltyReturnTypeOnItsOwnLine: 60
30-
PointerBindsToType: false
30+
PointerBindsToType: true
3131
SpacesBeforeTrailingComments: 1
3232
Cpp11BracedListStyle: false
3333
Standard: Cpp03

Diff for: include/json/assertions.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
// afterward in order to tell the compiler that this macro doesn't return.
2727
#define JSON_FAIL_MESSAGE(message) \
2828
{ \
29-
assert(false &&message); \
30-
strcpy(reinterpret_cast<char *>(666), message); \
29+
assert(false&& message); \
30+
strcpy(reinterpret_cast<char*>(666), message); \
3131
exit(123); \
3232
}
3333

Diff for: include/json/reader.h

+32-32
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace Json {
3131
class JSON_API Reader {
3232
public:
3333
typedef char Char;
34-
typedef const Char *Location;
34+
typedef const Char* Location;
3535

3636
/** \brief An error tagged with where in the JSON text it was encountered.
3737
*
@@ -53,7 +53,7 @@ class JSON_API Reader {
5353
/** \brief Constructs a Reader allowing the specified feature set
5454
* for parsing.
5555
*/
56-
Reader(const Features &features);
56+
Reader(const Features& features);
5757

5858
/** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
5959
* document.
@@ -70,7 +70,7 @@ class JSON_API Reader {
7070
* error occurred.
7171
*/
7272
bool
73-
parse(const std::string &document, Value &root, bool collectComments = true);
73+
parse(const std::string& document, Value& root, bool collectComments = true);
7474

7575
/** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
7676
document.
@@ -90,14 +90,14 @@ class JSON_API Reader {
9090
* \return \c true if the document was successfully parsed, \c false if an
9191
error occurred.
9292
*/
93-
bool parse(const char *beginDoc,
94-
const char *endDoc,
95-
Value &root,
93+
bool parse(const char* beginDoc,
94+
const char* endDoc,
95+
Value& root,
9696
bool collectComments = true);
9797

9898
/// \brief Parse from input stream.
9999
/// \see Json::operator>>(std::istream&, Json::Value&).
100-
bool parse(std::istream &is, Value &root, bool collectComments = true);
100+
bool parse(std::istream& is, Value& root, bool collectComments = true);
101101

102102
/** \brief Returns a user friendly string that list errors in the parsed
103103
* document.
@@ -164,8 +164,8 @@ class JSON_API Reader {
164164

165165
typedef std::deque<ErrorInfo> Errors;
166166

167-
bool expectToken(TokenType type, Token &token, const char *message);
168-
bool readToken(Token &token);
167+
bool expectToken(TokenType type, Token& token, const char* message);
168+
bool readToken(Token& token);
169169
void skipSpaces();
170170
bool match(Location pattern, int patternLength);
171171
bool readComment();
@@ -174,45 +174,45 @@ class JSON_API Reader {
174174
bool readString();
175175
void readNumber();
176176
bool readValue();
177-
bool readObject(Token &token);
178-
bool readArray(Token &token);
179-
bool decodeNumber(Token &token);
180-
bool decodeNumber(Token &token, Value &decoded);
181-
bool decodeString(Token &token);
182-
bool decodeString(Token &token, std::string &decoded);
183-
bool decodeDouble(Token &token);
184-
bool decodeDouble(Token &token, Value &decoded);
185-
bool decodeUnicodeCodePoint(Token &token,
186-
Location &current,
177+
bool readObject(Token& token);
178+
bool readArray(Token& token);
179+
bool decodeNumber(Token& token);
180+
bool decodeNumber(Token& token, Value& decoded);
181+
bool decodeString(Token& token);
182+
bool decodeString(Token& token, std::string& decoded);
183+
bool decodeDouble(Token& token);
184+
bool decodeDouble(Token& token, Value& decoded);
185+
bool decodeUnicodeCodePoint(Token& token,
186+
Location& current,
187187
Location end,
188-
unsigned int &unicode);
189-
bool decodeUnicodeEscapeSequence(Token &token,
190-
Location &current,
188+
unsigned int& unicode);
189+
bool decodeUnicodeEscapeSequence(Token& token,
190+
Location& current,
191191
Location end,
192-
unsigned int &unicode);
193-
bool addError(const std::string &message, Token &token, Location extra = 0);
192+
unsigned int& unicode);
193+
bool addError(const std::string& message, Token& token, Location extra = 0);
194194
bool recoverFromError(TokenType skipUntilToken);
195-
bool addErrorAndRecover(const std::string &message,
196-
Token &token,
195+
bool addErrorAndRecover(const std::string& message,
196+
Token& token,
197197
TokenType skipUntilToken);
198198
void skipUntilSpace();
199-
Value &currentValue();
199+
Value& currentValue();
200200
Char getNextChar();
201201
void
202-
getLocationLineAndColumn(Location location, int &line, int &column) const;
202+
getLocationLineAndColumn(Location location, int& line, int& column) const;
203203
std::string getLocationLineAndColumn(Location location) const;
204204
void addComment(Location begin, Location end, CommentPlacement placement);
205-
void skipCommentTokens(Token &token);
205+
void skipCommentTokens(Token& token);
206206

207-
typedef std::stack<Value *> Nodes;
207+
typedef std::stack<Value*> Nodes;
208208
Nodes nodes_;
209209
Errors errors_;
210210
std::string document_;
211211
Location begin_;
212212
Location end_;
213213
Location current_;
214214
Location lastValueEnd_;
215-
Value *lastValue_;
215+
Value* lastValue_;
216216
std::string commentsBefore_;
217217
Features features_;
218218
bool collectComments_;
@@ -242,7 +242,7 @@ class JSON_API Reader {
242242
\throw std::exception on parse error.
243243
\see Json::operator<<()
244244
*/
245-
JSON_API std::istream &operator>>(std::istream &, Value &);
245+
JSON_API std::istream& operator>>(std::istream&, Value&);
246246

247247
} // namespace Json
248248

0 commit comments

Comments
 (0)