summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-11-15 10:02:27 -0800
committerGitHub <noreply@github.com>2022-11-15 18:02:27 +0000
commit59cbdd818dc3397a823a37e9821fd32f4522b2fc (patch)
tree58470bfc11591d2e70f1b79645061c1a23beb75d /src/wasm-binary.h
parent236f12f7df64f10e1238bf2d66b1216f700b15df (diff)
downloadbinaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.tar.gz
binaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.tar.bz2
binaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.zip
Switch from `typedef` to `using` in C++ code. NFC (#5258)
This is more modern and (IMHO) easier to read than that old C typedef syntax.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 192466d07..acde624f7 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -110,7 +110,7 @@ template<typename T, typename MiniT> struct LEB {
byte = get();
bool last = !(byte & 128);
T payload = byte & 127;
- typedef typename std::make_unsigned<T>::type mask_type;
+ using mask_type = typename std::make_unsigned<T>::type;
auto shift_mask = 0 == shift
? ~mask_type(0)
: ((mask_type(1) << (sizeof(T) * 8 - shift)) - 1u);
@@ -147,10 +147,10 @@ template<typename T, typename MiniT> struct LEB {
}
};
-typedef LEB<uint32_t, uint8_t> U32LEB;
-typedef LEB<uint64_t, uint8_t> U64LEB;
-typedef LEB<int32_t, int8_t> S32LEB;
-typedef LEB<int64_t, int8_t> S64LEB;
+using U32LEB = LEB<uint32_t, uint8_t>;
+using U64LEB = LEB<uint64_t, uint8_t>;
+using S32LEB = LEB<int32_t, int8_t>;
+using S64LEB = LEB<int64_t, int8_t>;
//
// We mostly stream into a buffer as we create the binary format, however,