# HG changeset patch # User kono # Date 1193117459 -32400 # Node ID 8eadf0db2970b45606d6332a58dcf35a05d7803d # Parent bf4fd39737e91ffe350cf8250cbc8f28fcfbc29b *** empty log message *** diff -r bf4fd39737e9 -r 8eadf0db2970 Makefile --- a/Makefile Tue Oct 23 09:58:37 2007 +0900 +++ b/Makefile Tue Oct 23 14:30:59 2007 +0900 @@ -135,7 +135,7 @@ make check-code$(MK) TARGET=test/throw make check-code$(MK) TARGET=test/too-long-argument -check-nkf: +check-nkf: mc ( cd nkf203; $(CC) -g -o nkf1 nkf.c utf8tbl.c ) ( cd nkf203; ../mc-$(ARCH) -s nkf.c utf8tbl.c ) ( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s ) diff -r bf4fd39737e9 -r 8eadf0db2970 mc-codegen.c --- a/mc-codegen.c Tue Oct 23 09:58:37 2007 +0900 +++ b/mc-codegen.c Tue Oct 23 14:30:59 2007 +0900 @@ -3632,7 +3632,9 @@ if (car(init)!=DECL_DATA_ARRAY) { error(-1); } - e = pexpr(caddr(init)); + e = caddr(init); + if (!e) continue; // {...,} case + e = pexpr(e); offset = gen_decl_data0(v,type0,e,offset); } return offset; @@ -3664,7 +3666,7 @@ static int gen_decl_data_list(int v,int init,int target_type,int offset) { - int type0 = caddr(target_type); /* list of fields */ + int type0 = cadr(target_type); /* type of element */ int e; for(; init; init = cadr(init)) { @@ -3673,8 +3675,8 @@ error(-1); } e = caddr(init); - offset = gen_decl_data0(v,car(type0),e,offset); - type0 = cadr(type0); + if (!e) continue; // {...,} case + offset = gen_decl_data0(v,type0,e,offset); } return offset; } @@ -3737,6 +3739,7 @@ } gen_decl_data0(v,t,e,offset); + text_mode(0); if (init_vars) emit_init_vars(); g_expr0(e1); diff -r bf4fd39737e9 -r 8eadf0db2970 mc-inline.c --- a/mc-inline.c Tue Oct 23 09:58:37 2007 +0900 +++ b/mc-inline.c Tue Oct 23 14:30:59 2007 +0900 @@ -696,8 +696,9 @@ } #endif if (car(e)==ADDRESS||car(e)==GVAR) { - if (scalar(t)||car(t)==ARRAY) { + if (scalar(t)) { t = list2(POINTER,VOID); // fake + } else if (t>0 && car(t)==ARRAY) { } else { error(TYERR); } @@ -707,7 +708,7 @@ return offset+cadr(e); } type = t; - e = rvalue_t(e,t); + // e = rvalue_t(e,t); if (!scalar(type) && (type>0 && (car(type)!=ADDRESS && car(type)!=ARRAY))) e = correct_type(e,target_type); /* If this is a local declared constant, we don't have to assign. diff -r bf4fd39737e9 -r 8eadf0db2970 test/simp0.c --- a/test/simp0.c Tue Oct 23 09:58:37 2007 +0900 +++ b/test/simp0.c Tue Oct 23 14:30:59 2007 +0900 @@ -1,8 +1,27 @@ int printf(const char *format, ...); +#define LBUFSIZE 10 +static char current_file_dir[LBUFSIZE]; // keep track include file directory + +void +copy_current_file_dir(char *name) +{ + char *s = name; + char *d = current_file_dir; + char *p; + for(p = d;d