/home/fleuria/code/mruby/src/hash.c:159:1: warning: ‘mrb_hash_dp`defined but not used [-Wunused-function]
mrb_hash_dup(mrb_state *mrb, mrb_value hash)
^
this commit defines Hash#dup to take advantage of mrb_hash_dup, however
it seems that Hash#dup is not in ISO standard.
src/hash.c:
- mrb_hash_(aget|aset|dup|delete): internal linkage
- remove documentation of methods which are not implemented (in here)
- remove #assoc; unused, not in ISO spec
- remove #rassoc: same, implementation is also wrong
hash-ext mrbgem:
- remove header "mruby/khash.h"
- remove mrb_hash_values_at (move code into hash_values_at, i: long -> int)
- less whitespace in gem_init function
src/array.c:
- make various functions without declaration in the mruby headers static
- removed all uncessary int casts and two useless comments
mrb_ary_new_from_values: move to similar functions
mrb_check_array_type: fix indentation
include/mruby/array.h:
mrb_shared_array: padding (default "mrbconf.h" on an usual 64-bit system)
sizeof(mrb_int)==sizeof(int)==4 && sizeof(mrb_value*)==8
both:
mrb_ary_aget: remove declaration in header and make static
nobody uses it which is not surprising since it has 1 req arg!
mrb_assoc_new: small optimization and move to similar functions
mrb_ary_len: re-implement as static inline function (it is used by mrbgems)
programmers should directly use RARRAY_LEN instead
This is most likely only needed on Windows be-
cause __GNUC__ is not defined by both compilers.
It might fail with some unusual configurations.
If that is the case, feel free to open an issue.
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0
but I prefer a type (alias) which emphasizes boolean vars to int.
I changed 1/0 to FALSE/TRUE anyway.
- functions should have C linkage (for C++ code)
- add prefix to each_object_callback
- use more appropriate variable types / initialization
- ObjectSpace::count_objects has 1 opt. arg.
- prefer mrb_intern_lit to mrb_intern_cstr for str. lit.
- mruby/value.h is included by mruby.h
- adjust coding style
remove unused and unneeded:
- sysexit_status
- type (a global variable)
add mrb_ prefix to:
- codedump_all
- class_instance_method_list
- parser_dump
make various functions static, incl.:
- yyparse
- make_exception
mrb_data_object_alloc: unnecessary cast
mrb_lastline_get: mruby doesn't support $_, weird and unused code
mrb_exec_recursive: see 4e46abb869
mrb_block_proc: unused, doesn't really do anything (or needs to be
rewritten)
mrb_obj_to_sym: actually use id (and MSVC detected unreachable code)