diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-09-20 19:13:17 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-09-20 19:13:17 +0900 |
| commit | d6dd6f0e7bb8977ed97a032256d34033ac15905a (patch) | |
| tree | f07699b3752fd8738b9a8dce9e1511663a3c9d64 /src | |
| parent | 8be78dbf9d41a7cbe5c6228ec872a787de0f5adc (diff) | |
| download | mruby-d6dd6f0e7bb8977ed97a032256d34033ac15905a.tar.gz mruby-d6dd6f0e7bb8977ed97a032256d34033ac15905a.zip | |
Update `struct` initializer to work with relatively older `C++`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/class.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/class.c b/src/class.c index 402a70f6a..fdf63794b 100644 --- a/src/class.c +++ b/src/class.c @@ -1698,8 +1698,10 @@ mrb_define_module_function(mrb_state *mrb, struct RClass *c, const char *name, m static void mc_clear(mrb_state *mrb) { + static const struct mrb_cache_entry ce_zero ={0}; + for (int i=0; i<MRB_METHOD_CACHE_SIZE; i++) { - mrb->cache[i] = (struct mrb_cache_entry){0}; + mrb->cache[i] = ce_zero; } } |
