mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1277106 - Part 3: Expand MOZ_UTF16() characters to u'' char16_t literals. r=luke
This commit is contained in:
parent
b175c9fdd5
commit
224290062c
@ -49,7 +49,7 @@ class AstName
|
||||
public:
|
||||
template <size_t Length>
|
||||
explicit AstName(const char16_t (&str)[Length]) : begin_(str), end_(str + Length - 1) {
|
||||
MOZ_ASSERT(str[Length - 1] == MOZ_UTF16('\0'));
|
||||
MOZ_ASSERT(str[Length - 1] == u'\0');
|
||||
}
|
||||
|
||||
AstName(const char16_t* begin, size_t length) : begin_(begin), end_(begin + length) {}
|
||||
|
@ -133,14 +133,14 @@ AstDecodeGenerateName(AstDecodeContext& c, const AstName& prefix, uint32_t index
|
||||
}
|
||||
|
||||
AstVector<char16_t> result(c.lifo);
|
||||
if (!result.append(MOZ_UTF16('$')))
|
||||
if (!result.append(u'$'))
|
||||
return false;
|
||||
if (!result.append(prefix.begin(), prefix.length()))
|
||||
return false;
|
||||
|
||||
uint32_t tmp = index;
|
||||
do {
|
||||
if (!result.append(MOZ_UTF16('0')))
|
||||
if (!result.append(u'0'))
|
||||
return false;
|
||||
tmp /= 10;
|
||||
} while (tmp);
|
||||
@ -148,7 +148,7 @@ AstDecodeGenerateName(AstDecodeContext& c, const AstName& prefix, uint32_t index
|
||||
if (index) {
|
||||
char16_t* p = result.end();
|
||||
for (tmp = index; tmp; tmp /= 10)
|
||||
*(--p) = MOZ_UTF16('0' + (tmp % 10));
|
||||
*(--p) = u'0' + (tmp % 10);
|
||||
}
|
||||
|
||||
size_t length = result.length();
|
||||
|
@ -205,7 +205,7 @@ PrintInt64(WasmPrintContext& c, int64_t num)
|
||||
|
||||
n = abs;
|
||||
while (pow) {
|
||||
if (!c.buffer.append((char16_t)(MOZ_UTF16('0') + n / pow)))
|
||||
if (!c.buffer.append((char16_t)(u'0' + n / pow)))
|
||||
return false;
|
||||
n -= (n / pow) * pow;
|
||||
pow /= 10;
|
||||
|
Loading…
Reference in New Issue
Block a user