# HG changeset patch # User anatofuz # Date 1575339172 -32400 # Node ID 7ce72e373d9bfe6993d3545610881efe5a83a9b4 # Parent 46d792f9215678f57f38b89fb01bbbfdc319588c fix initialize data gears diff -r 46d792f92156 -r 7ce72e373d9b src/gearsTools/trans_impl.pl --- a/src/gearsTools/trans_impl.pl Tue Dec 03 10:45:46 2019 +0900 +++ b/src/gearsTools/trans_impl.pl Tue Dec 03 11:12:52 2019 +0900 @@ -82,6 +82,16 @@ if ($datum =~ /\w+ \w+ (\w+)/) { print $out " ${instance_impl}->$1 = 0;\n"; } + + if ($datum =~ /\w+(\*)? (\w+)/) { + my $is_pointer = $1; + my $var_name = $2; + if ($1) { + print $out " ${instance_impl}->$var_name = NULL;\n"; + } else { + print $out " ${instance_impl}->$var_name = 0;\n"; + } + } } for my $datum (@inter_data) { @@ -91,6 +101,16 @@ } if ($datum =~ /\w+ \w+ (\w+)/) { print $out " ${instance_inter}->$1 = 0;\n"; + next; + } + if ($datum =~ /\w+(\*)? (\w+)/) { + my $is_pointer = $1; + my $var_name = $2; + if ($1) { + print $out " ${instance_impl}->$var_name = NULL;\n"; + } else { + print $out " ${instance_impl}->$var_name = 0;\n"; + } } } diff -r 46d792f92156 -r 7ce72e373d9b src/impl/SysReadImpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/impl/SysReadImpl.h Tue Dec 03 11:12:52 2019 +0900 @@ -0,0 +1,3 @@ +typedef struct SysReadImpl impl SysRead { + +} SysReadImpl; diff -r 46d792f92156 -r 7ce72e373d9b src/impl/SysReadImplTmp.h --- a/src/impl/SysReadImplTmp.h Tue Dec 03 10:45:46 2019 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -typedef struct SysReadImplTmp impl SysRead { - -} SysRead; diff -r 46d792f92156 -r 7ce72e373d9b src/interface/SysRead.h --- a/src/interface/SysRead.h Tue Dec 03 10:45:46 2019 +0900 +++ b/src/interface/SysRead.h Tue Dec 03 11:12:52 2019 +0900 @@ -1,7 +1,7 @@ typedef struct SysRead{ union Data* sys_read; - struct Integer* num; - struct String *str; + int num; + char* str; __code read(Impl* sys_read, __code next(...)); //__code ret(Impl* cbc_sys_file, UInteger* num); __code next(...);