summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-pack
AgeCommit message (Collapse)Author
2021-12-23pack.c: check integer overflow in unpacking BER; fix #5611Yukihiro "Matz" Matsumoto
2021-09-07object.c: rename `mrb_to_int` to `mrb_to_integer`.Yukihiro "Matz" Matsumoto
Consistent naming: `integer` to represent integer packed in `mrb_value` instead of `int`.
2021-08-17pack.c: rename pack/unpack functions for readability.Yukihiro "Matz" Matsumoto
2021-08-17fixup! pack.c: reduce dispatch in `pack_unpack()`.Yukihiro "Matz" Matsumoto
2021-08-17pack.c: reduce dispatch in `pack_unpack()`.Yukihiro "Matz" Matsumoto
2021-08-16pack.c: fix `M` packing bug.Yukihiro "Matz" Matsumoto
2021-08-14pack.c: fixed a overwriting bug in `pack_w` and `pack_M`.Yukihiro "Matz" Matsumoto
2021-08-07Fixed compilation error of "mruby-pack" with `MRB_NO_STDIO`dearblue
2021-07-25pack.c: fixed sign comparison warning.Yukihiro "Matz" Matsumoto
2021-07-08pack.c: fix integer signedness mixture.Yukihiro "Matz" Matsumoto
2021-06-22Enable markdownlint rules MD003,MD005,MD007John Bampton
Lint Markdown https://github.com/DavidAnson/markdownlint#rules--aliases
2021-06-14pack.c: support `w' directive (BER integer compression).Yukihiro "Matz" Matsumoto
2021-06-13pack.c: `count` should not be negative for directives `xX@`.Yukihiro "Matz" Matsumoto
2021-06-13pack.c: raise error for unsupported `w` directive.Yukihiro "Matz" Matsumoto
2021-06-12pack.c: support `@' directive (absolute position).Yukihiro "Matz" Matsumoto
2021-06-12pack.c: refactor pack/unpack 'X'.Yukihiro "Matz" Matsumoto
2021-06-12pack.c: add `X` directive (back up byte).Yukihiro "Matz" Matsumoto
2021-06-12pack.c: `count` should be always positive. no check needed.Yukihiro "Matz" Matsumoto
2021-06-12pack.c: fix `long/int` mixtures.Yukihiro "Matz" Matsumoto
2021-06-12pack.c: remove unused arguments from static functions.Yukihiro "Matz" Matsumoto
2021-06-12pack.c: wrong position after count read.Yukihiro "Matz" Matsumoto
2021-06-11readint.c: add new function `mrb_int_read`.Yukihiro "Matz" Matsumoto
Difference from `strtoul(3)`: * reads `mrb_int` based on configuration * specifies the end of the string * no sign interpretation * base 10 only
2021-06-07pack.c: fix 'void*` to `char*` assignment.Yukihiro "Matz" Matsumoto
2021-06-07pack.c: add `default` to `switch` statement to silence warnings.Yukihiro "Matz" Matsumoto
2021-06-07pack.c: support `M` specifier (quoted-printable).Yukihiro "Matz" Matsumoto
2021-06-07test/pack.c: reorganize test suits.Yukihiro "Matz" Matsumoto
2021-06-07pack.c: raise exception for unsupported specifiers.Yukihiro "Matz" Matsumoto
2021-06-06pack.c: check overflow before calling `pack_x`.Yukihiro "Matz" Matsumoto
2021-06-06pack.c: check overflow before reading count.Yukihiro "Matz" Matsumoto
2021-06-06pack.c: failed to detect overflow when `ch` is zero in `read_tmpl`.Yukihiro "Matz" Matsumoto
2021-06-05pack.c: hold `enum` values in `enum` variables not `int`.Yukihiro "Matz" Matsumoto
2021-05-17Global renaming regarding `integer` and `float`.Yukihiro "Matz" Matsumoto
Consistent number conversion function names: * `mrb_value` to immediate (C) value * `mrb_int()` -> `mrb_as_int()` * `mrb_to_flo()` -> `mrb_as_float()` * `mrb_value` to `mrb_value` (converted) * `mrb_to_int()' * `mrb_Integer()` - removed * `mrb_Float()` -> `mrb_to_float` Consistent function name (avoid `_flo` suffix): * `mrb_div_flo()` -> `mrb_div_float`
2021-05-05Extend the tab with 8 whitespacedearblue
This work was done as follows: - check: `git grep $'\011' -- :^oss-fuzz` - convert: `ruby -pi -e 'nil while $_.sub!(/^(.*?)\t/) { $1 + " " * (8 - $1.size % 8) }'` The `doc/guide/{compile,mrbgems}.md` file adds and removes whitespace to make the directory tree look the same. In `mrbgems/mruby-socket/src/socket.c`, there is a part where the indent is changed from 4 to 2 at the same time as the tab is changed.
2021-05-03Fix documents for `mruby-io`dearblue
2021-04-24Skip tests that use `Float` inside; ref #5421Yukihiro "Matz" Matsumoto
2021-02-27pack.c: add more checks for `pack_pack()`.Yukihiro "Matz" Matsumoto
2021-01-29Remove unnecessary range confirmationdearblue
This is a correction based on the review by @matz. https://github.com/mruby/mruby/pull/5306#pullrequestreview-578378401
2021-01-29Fixed `String#unpack` to handle the highest range of integer valuesdearblue
Previously, problems occurred when the `fixnum` was exceeded. - 32-bit cpu mode with `MRB_WORD_BOXING` and `MRB_INT32`: ```console % bin/mruby -e 'p [0x7fffffff].pack("N").unpack("N")' trace (most recent call last): -e:1: cannot unpack to Integer: 2147483647 (RangeError) ``` - 64-bit cpu mode with `MRB_WORD_BOXING` and `MRB_INT64`: ```console % bin/mruby -e 'p [0x7fffffff_ffffffff].pack("q").unpack("q")' trace (most recent call last): -e:1: cannot unpack to Integer: 9223372036854775807 (RangeError) ```
2020-12-19feat(CI): add a GitHub Action to lint the MarkdownJohn Bampton
Run on pull request only Using https://www.npmjs.com/package/markdownlint-cli Lint Markdown for rules: - MD009/no-trailing-spaces - MD012/no-multiple-blanks - MD022/blanks-around-headings - MD031/blanks-around-fences - MD032/blanks-around-lists
2020-11-21Rename `MRB_{ENABLE,DISABLE}_` to `MRB_{USE,NO}_`; close #5163KOBAYASHI Shuji
| Previous Name | New Name | |------------------------------|-------------------------| | MRB_ENABLE_ALL_SYMBOLS | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_SYMBOLL_ALL | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_CXX_ABI | MRB_USE_CXX_ABI | | MRB_ENABLE_CXX_EXCEPTION | MRB_USE_CXX_EXCEPTION | | MRB_ENABLE_DEBUG_HOOK | MRB_USE_DEBUG_HOOK | | MRB_DISABLE_DIRECT_THREADING | MRB_NO_DIRECT_THREADING | | MRB_DISABLE_STDIO | MRB_NO_STDIO | | ENABLE_LINENOISE | MRB_USE_LINENOISE | | ENABLE_READLINE | MRB_USE_READLINE | | DISABLE_MIRB_UNDERSCORE | MRB_NO_MIRB_UNDERSCORE | | DISABLE_GEMS | MRB_NO_GEMS | * `MRB_ENABLE_SYMBOLL_ALL` seems to be a typo, so it is fixed. * `MRB_` prefix is added to those without. * The previous names can also be used for compatibility.
2020-10-29Move `build_config.rb` -> `build_config/default.rb`; ref #5098Yukihiro "Matz" Matsumoto
In addition, update the documents referring `build_config.rb` which is no longer used. The new `build_config.rb` describes the new configuration structure in the comment.
2020-10-12Change float representation in `mrb` binary files.Yukihiro "Matz" Matsumoto
From human readable (ASCII) string representation to binary dump of IEEE754 in little endian.
2020-10-12Reorganize `Integer` system.Yukihiro "Matz" Matsumoto
- Integrate `Fixnum` and `Integer` - Remove `Integral` - `int / int -> int` - Replace `mrb_fixnum()` to `mrb_int()` - Replace `mrb_fixnum_value()` to `mrb_int_value()`. - Use `mrb_integer_p()` instead of `mrb_fixnum_p()`
2020-10-12Integrate `Fixnum` class into `Integer` classdearblue
* The `Fixnum` constant is now an alias for the `Integer` class. * Remove `struct mrb_state::fixnum_class` member. If necessary, use `struct mrb_state::integer_class` instead.
2020-10-12Rename float configuration option names.Yukihiro "Matz" Matsumoto
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general.
2020-08-11Fix `mrb_int` and `size_t` combination warnings.Yukihiro "Matz" Matsumoto
2020-08-04Fix wrong condition for `PACK_DIR_HEX`; ref #5057Yukihiro "Matz" Matsumoto
2020-08-03Should not decrement `count` when `PACK_FLAG_COUNT2`; fix #5057Yukihiro "Matz" Matsumoto
2020-04-11Support `MRB_DISABLE_STDIO` for mruby-pack; ref #4954dearblue
2020-03-08Add configuration guard for `MRB_DISABLE_STDIO`dearblue
ref #4576 and ref #4947 * Need MRBAPI functions without `MRB_DISABLE_STDIO`: * mrbgems/mruby-bin-debugger * mrbgems/mruby-bin-mirb * mrbgems/mruby-bin-mrbc * mrbgems/mruby-bin-mruby * mrbgems/mruby-bin-strip * Need `stdio.h`: * mrbgems/mruby-io * mrbgems/mruby-print * Need `snprintf()` in `stdio.h`: * mrbgems/mruby-pack * mrbgems/mruby-sprintf