U64
DivPow10(U64 a, S64 index)
{
ASSERT(index >= 0 && index < 19);
// Generated using libdivide's reference implementation adapted to 64-bit unsigned integers.
static const struct { U64 mul; U32 shr1; U32 shr2; } kPow10Magics[19] = {
{ 0xcccccccccccccccd, 0, 3 }, // 10^1
{ 0x28f5c28f5c28f5c3, 2, 2 }, // 10^2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Add extension flags to the bitfield that 'flags_out' points to. 'table' | |
| * stores extension names and flags to check for and 'extensions' is the list | |
| * usually returned by the EGL or GL implementation. New flags are stored using | |
| * a binary OR in order to keep flags set from a previous call. Caller must | |
| * ensure the bitfield is set to 0 at first call. | |
| */ | |
| void | |
| gl_extensions_add(const struct gl_extension_table *table, | |
| const char *extensions, | |
| uint64_t *flags_out) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os | |
| import sys | |
| from typing import Tuple, List, Iterator, IO, Callable, Any | |
| # Terminal ECMA-48 SGR escape sequences. | |
| ECMA48_BOLD: str = '\x1b[01m' | |
| ECMA48_RESET: str = '\x1b[00m' |
typedef struct {
U32 elements;
S32 position;
} Cache;
void
CacheInit(Cache* cache)
{
ASSERT(cache);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/binary-writer.cc b/src/binary-writer.cc | |
| index 3155c206..7ffc2c6d 100644 | |
| --- a/src/binary-writer.cc | |
| +++ b/src/binary-writer.cc | |
| @@ -809,13 +809,17 @@ void BinaryWriter::WriteLinkingSection() { | |
| } | |
| } | |
| stream_->WriteU8Enum(sym.type, "symbol type"); | |
| - WriteU32Leb128(stream_, is_defined ? 0 : WABT_SYMBOL_FLAG_UNDEFINED, | |
| + WriteU32Leb128(stream_, is_defined ? |