lib/core: remove uses of Byte for Text
authorLucas Bajolet <lucas.bajolet@gmail.com>
Mon, 14 May 2018 18:56:51 +0000 (14:56 -0400)
committerLucas Bajolet <lucas.bajolet@gmail.com>
Fri, 8 Jun 2018 15:48:48 +0000 (11:48 -0400)
commit3635f7753b038b8952f8789038fe5c3a1000bd27
tree02d3f4538c1b05155da8f1410af135a5b2838245
parent9e2821a37cb66e1cdf0e5583d0038e102af49fbb
lib/core: remove uses of Byte for Text

Byte is convenient for automatic modular arithmetic on 8-bit values.

However, due to the way our Numeric types are handled, no automatic
conversion is done when working on primitive types, and operations like
comparison will fail when comparing two values of different type.

This is a cause of bugs as the u8 suffix is required for comparing two
bytes, and is also the cause for tedious cast operations to go
back-and-forth between Byte and Int.

We remove the uses of Byte in the Text API, and replace them with Int.
This should not have a negative impact on performance.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>
54 files changed:
contrib/brainfuck/brainfuck.nit
contrib/pep8analysis/src/parser/xss/lexer.xss
examples/leapfrog/leapfrog_curses.nit
examples/rosettacode/vignere_cipher.nit
lib/actors/examples/mandelbrot/mandelbrot.nit
lib/base64/base64.nit
lib/binary/binary.nit
lib/core/bytes.nit
lib/core/codecs/iso8859_1.nit
lib/core/codecs/utf8.nit
lib/core/file.nit
lib/core/kernel.nit
lib/core/stream.nit
lib/core/text/abstract_text.nit
lib/core/text/fixed_ints_text.nit
lib/core/text/flat.nit
lib/core/text/native.nit
lib/core/text/ropes.nit
lib/crapto/xor.nit
lib/crypto/basic_ciphers.nit
lib/crypto/xor_ciphers.nit
lib/gamnit/textures.nit
lib/json/static.nit
lib/libevent/libevent.nit
lib/msgpack/ext.nit
lib/msgpack/msgpack.nit
lib/msgpack/read.nit
lib/msgpack/serialization_common.nit
lib/msgpack/serialization_write.nit
lib/msgpack/write.nit
lib/nitcorn/token.nit
lib/sha1/sha1.nit
lib/socket/socket_c.nit
lib/websocket/websocket.nit
src/compiler/abstract_compiler.nit
src/interpreter/naive_interpreter.nit
tests/sav/error_class_glob.res
tests/sav/nitce/test_new_native.res
tests/sav/nitce/test_new_native_alt1.res
tests/sav/test_augmented.res
tests/sav/test_bytes_hexdigit.res
tests/sav/test_new_native.res
tests/sav/test_new_native_alt1.res
tests/sav/test_prefixed_chars.res
tests/sav/test_prefixed_chars_alt1.res [deleted file]
tests/sav/test_rope_bytes.res
tests/sav/test_string_bytes.res
tests/shootout_mandelbrot.nit
tests/shootout_nsieve_bytes_alt.nit
tests/test_augmented.nit
tests/test_binary.nit
tests/test_buffer_unicode.nit
tests/test_new_native.nit
tests/test_prefixed_chars.nit