Skip to content

Commit

Permalink
Enabled PointerBindsToType in clang-format options.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsa committed Sep 15, 2014
1 parent 30b07c0 commit 11086dd
Show file tree
Hide file tree
Showing 14 changed files with 540 additions and 540 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerBindsToType: false
PointerBindsToType: true
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: false
Standard: Cpp03
Expand Down
4 changes: 2 additions & 2 deletions include/json/assertions.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
// afterward in order to tell the compiler that this macro doesn't return.
#define JSON_FAIL_MESSAGE(message) \
{ \
assert(false &&message); \
strcpy(reinterpret_cast<char *>(666), message); \
assert(false&& message); \
strcpy(reinterpret_cast<char*>(666), message); \
exit(123); \
}

Expand Down
64 changes: 32 additions & 32 deletions include/json/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Json {
class JSON_API Reader {
public:
typedef char Char;
typedef const Char *Location;
typedef const Char* Location;

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

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

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

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

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

typedef std::deque<ErrorInfo> Errors;

bool expectToken(TokenType type, Token &token, const char *message);
bool readToken(Token &token);
bool expectToken(TokenType type, Token& token, const char* message);
bool readToken(Token& token);
void skipSpaces();
bool match(Location pattern, int patternLength);
bool readComment();
Expand All @@ -174,45 +174,45 @@ class JSON_API Reader {
bool readString();
void readNumber();
bool readValue();
bool readObject(Token &token);
bool readArray(Token &token);
bool decodeNumber(Token &token);
bool decodeNumber(Token &token, Value &decoded);
bool decodeString(Token &token);
bool decodeString(Token &token, std::string &decoded);
bool decodeDouble(Token &token);
bool decodeDouble(Token &token, Value &decoded);
bool decodeUnicodeCodePoint(Token &token,
Location &current,
bool readObject(Token& token);
bool readArray(Token& token);
bool decodeNumber(Token& token);
bool decodeNumber(Token& token, Value& decoded);
bool decodeString(Token& token);
bool decodeString(Token& token, std::string& decoded);
bool decodeDouble(Token& token);
bool decodeDouble(Token& token, Value& decoded);
bool decodeUnicodeCodePoint(Token& token,
Location& current,
Location end,
unsigned int &unicode);
bool decodeUnicodeEscapeSequence(Token &token,
Location &current,
unsigned int& unicode);
bool decodeUnicodeEscapeSequence(Token& token,
Location& current,
Location end,
unsigned int &unicode);
bool addError(const std::string &message, Token &token, Location extra = 0);
unsigned int& unicode);
bool addError(const std::string& message, Token& token, Location extra = 0);
bool recoverFromError(TokenType skipUntilToken);
bool addErrorAndRecover(const std::string &message,
Token &token,
bool addErrorAndRecover(const std::string& message,
Token& token,
TokenType skipUntilToken);
void skipUntilSpace();
Value &currentValue();
Value& currentValue();
Char getNextChar();
void
getLocationLineAndColumn(Location location, int &line, int &column) const;
getLocationLineAndColumn(Location location, int& line, int& column) const;
std::string getLocationLineAndColumn(Location location) const;
void addComment(Location begin, Location end, CommentPlacement placement);
void skipCommentTokens(Token &token);
void skipCommentTokens(Token& token);

typedef std::stack<Value *> Nodes;
typedef std::stack<Value*> Nodes;
Nodes nodes_;
Errors errors_;
std::string document_;
Location begin_;
Location end_;
Location current_;
Location lastValueEnd_;
Value *lastValue_;
Value* lastValue_;
std::string commentsBefore_;
Features features_;
bool collectComments_;
Expand Down Expand Up @@ -242,7 +242,7 @@ class JSON_API Reader {
\throw std::exception on parse error.
\see Json::operator<<()
*/
JSON_API std::istream &operator>>(std::istream &, Value &);
JSON_API std::istream& operator>>(std::istream&, Value&);

} // namespace Json

Expand Down
Loading

0 comments on commit 11086dd

Please sign in to comment.