From 97bb82ebcdf8f1391b9d93b5a8d7b1dfc4e88e52 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 4 Oct 2021 14:15:51 -0400 Subject: Removing exceptions from core/compiler-core (#1953) * #include an absolute path didn't work - because paths were taken to always be relative. * Refactor Stream. Working on all tests. * Split out CharEncode. * Make method names lower camel. m_prefix in Writer/Reader * Tidy up around CharEncode interface. * Small improvements around encode/decode. * Better use of types. * Remove readLine from TextReader. * Remove exceptions from Stream/Text handling. * Fix some typos. * Fix tabbing. * Fix missing override. * Remove remaining exception throw/catch via using signal mechanism. * Remove exceptions that are not used anymore. * Document the Stream interface. * Remove index for decoding 'get byte' function. * Fix CharReader -> ByteReader. --- source/slang/slang-serialize.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'source/slang/slang-serialize.cpp') diff --git a/source/slang/slang-serialize.cpp b/source/slang/slang-serialize.cpp index 4f8fdc546..a7074df1c 100644 --- a/source/slang/slang-serialize.cpp +++ b/source/slang/slang-serialize.cpp @@ -506,20 +506,13 @@ SlangResult SerialWriter::write(Stream* stream) // MAX_ALIGNMENT, and so < MAX_ALIGNMENT is the most extra bytes we can write SLANG_ASSERT( alignmentFixSize < SerialInfo::MAX_ALIGNMENT); - try + SLANG_RETURN_ON_FAIL(stream->write(entry, entrySize)); + // If we needed to fix so that subsequent alignment is right, write out extra bytes here + if (alignmentFixSize) { - stream->write(entry, entrySize); - // If we needed to fix so that subsequent alignment is right, write out extra bytes here - if (alignmentFixSize) - { - stream->write(s_fixBuffer, alignmentFixSize); - } + SLANG_RETURN_ON_FAIL(stream->write(s_fixBuffer, alignmentFixSize)); } - catch (const IOException&) - { - return SLANG_FAIL; - } - + // Onto next offset = nextOffset; entry = next; -- cgit v1.2.3