Use substitution instead of memset in structure initialization.

This commit is contained in:
Masaki Muranaka
2012-10-24 17:00:54 +09:00
parent f5b6f03c9e
commit f3090c3000
8 changed files with 30 additions and 14 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ struct RData *mrb_data_object_alloc(mrb_state *mrb, struct RClass* klass, void *
#define Data_Make_Struct(mrb,klass,strct,type,sval) (\
sval = mrb_malloc(mrb, sizeof(strct)),\
memset(sval, 0, sizeof(strct)),\
{ static const strct zero = { 0 }; *sval = zero},\
Data_Wrap_Struct(mrb,klass,type,sval)\
)