Skip to content

Commit

Permalink
Merge pull request #447 from etiennebatise/missing-breaks-at-switch-s…
Browse files Browse the repository at this point in the history
…tatements

Add break at default switch case statements fix #444
  • Loading branch information
miloyip committed Oct 15, 2015
2 parents a5d9971 + 74a0213 commit 1a4cce2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/rapidjson/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,7 @@ GenericValue<Encoding,Allocator>::GenericValue(const GenericValue<Encoding,Sourc
default: // kNumberType, kTrueType, kFalseType, kNullType
flags_ = rhs.flags_;
data_ = *reinterpret_cast<const Data*>(&rhs.data_);
break;
}
}

Expand Down
15 changes: 11 additions & 4 deletions include/rapidjson/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ class GenericReader {
if (!handler.EndObject(memberCount))
RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
return;
default: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell());
default:
RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell());
break;
}
}
}
Expand Down Expand Up @@ -592,7 +594,9 @@ class GenericReader {
if (!handler.EndArray(elementCount))
RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
return;
default: RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell());
default:
RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell());
break;
}
}
}
Expand Down Expand Up @@ -1041,7 +1045,10 @@ class GenericReader {
case '"': ParseString<parseFlags>(is, handler); break;
case '{': ParseObject<parseFlags>(is, handler); break;
case '[': ParseArray <parseFlags>(is, handler); break;
default : ParseNumber<parseFlags>(is, handler);
default :
ParseNumber<parseFlags>(is, handler);
break;

}
}

Expand Down Expand Up @@ -1443,7 +1450,7 @@ class GenericReader {
case IterativeParsingMemberKeyState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); return;
case IterativeParsingMemberValueState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); return;
case IterativeParsingElementState: RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); return;
default: RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell());
default: RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); return;
}
}

Expand Down

0 comments on commit 1a4cce2

Please sign in to comment.