OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
3 * Copyright (C) 2011 Apple, Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple, Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 static unsigned checkLocus(size_t locus) { | 96 static unsigned checkLocus(size_t locus) { |
97 // Clamp to fit in the number of bits available. If the character index | 97 // Clamp to fit in the number of bits available. If the character index |
98 // encoded by the locus does not fit in the number of bits allocated | 98 // encoded by the locus does not fit in the number of bits allocated |
99 // for it, the locus will be disabled (set to kNoLocus). This means | 99 // for it, the locus will be disabled (set to kNoLocus). This means |
100 // that very long values will be output in their entirety. That should | 100 // that very long values will be output in their entirety. That should |
101 // however be rather uncommon. | 101 // however be rather uncommon. |
102 return clampTo<unsigned>(locus, 0, kNoLocus); | 102 return clampTo<unsigned>(locus, 0, kNoLocus); |
103 } | 103 } |
104 | 104 |
105 unsigned m_status : 8; | 105 unsigned m_status : 8; |
106 unsigned m_locus | 106 unsigned m_locus : kLocusBits; // The locus (character index) of the error |
107 : kLocusBits; // The locus (character index) of the error within the pars
ed string. | 107 // within the parsed string. |
108 }; | 108 }; |
109 | 109 |
110 inline bool operator==(const SVGParsingError& error, SVGParseStatus status) { | 110 inline bool operator==(const SVGParsingError& error, SVGParseStatus status) { |
111 return error.status() == status; | 111 return error.status() == status; |
112 } | 112 } |
113 inline bool operator!=(const SVGParsingError& error, SVGParseStatus status) { | 113 inline bool operator!=(const SVGParsingError& error, SVGParseStatus status) { |
114 return !(error == status); | 114 return !(error == status); |
115 } | 115 } |
116 | 116 |
117 } // namespace blink | 117 } // namespace blink |
118 | 118 |
119 #endif // SVGParsingError_h | 119 #endif // SVGParsingError_h |
OLD | NEW |