Mercurial > hg > CbC > old > device
comparison mc-parse.c @ 489:79fef53141b4
fix clear_ptr_cache in MIPS/ARM.
author | kono |
---|---|
date | Mon, 19 Dec 2005 22:42:12 +0900 |
parents | 62f3c801b6ac |
children | 0a4ca939f403 |
comparison
equal
deleted
inserted
replaced
488:62f3c801b6ac | 489:79fef53141b4 |
---|---|
1291 int offset1 = offset; | 1291 int offset1 = offset; |
1292 int decl_str_init_save = decl_str_init; | 1292 int decl_str_init_save = decl_str_init; |
1293 int mode_save=mode; | 1293 int mode_save=mode; |
1294 NMTBL *nptr0; | 1294 NMTBL *nptr0; |
1295 int sz= size(type); | 1295 int sz= size(type); |
1296 int type0=type_value(type); | |
1296 | 1297 |
1297 decl_str_init = 0; | 1298 decl_str_init = 0; |
1298 if(cadr(type)==-1) { | 1299 if(cadr(type0)==-1) { |
1299 error(DCERR); | 1300 error(DCERR); |
1300 return; | 1301 return; |
1301 } | 1302 } |
1302 if (mode==LDECL && LOCAL_STRUCT_INIT_STATIC) { | 1303 if (mode==LDECL && LOCAL_STRUCT_INIT_STATIC) { |
1303 // uninitialized part should be 0. | 1304 // uninitialized part should be 0. |
1315 list3(RSTRUCT,list3(GVAR,0,(int)nptr0),sz),sz), | 1316 list3(RSTRUCT,list3(GVAR,0,(int)nptr0),sz),sz), |
1316 init_vars); | 1317 init_vars); |
1317 return; | 1318 return; |
1318 } | 1319 } |
1319 mode=SFDINIT; | 1320 mode=SFDINIT; |
1320 t1 = caddr(type); /* list of fields */ | 1321 t1 = caddr(type0); /* list of fields */ |
1321 while(1) { | 1322 while(1) { |
1322 getsym(0); | 1323 getsym(0); |
1323 if (sym==PERIOD) { /* struct/union field initializaer */ | 1324 if (sym==PERIOD) { /* struct/union field initializaer */ |
1324 getsym(0); | 1325 getsym(0); |
1325 if (sym==IDENT) { | 1326 if (sym==IDENT) { |
1404 e=expr1(); | 1405 e=expr1(); |
1405 mode = mode_save; | 1406 mode = mode_save; |
1406 offset = assign_data(e,t,n,offset); | 1407 offset = assign_data(e,t,n,offset); |
1407 type=t; | 1408 type=t; |
1408 return offset; | 1409 return offset; |
1409 } else if ((t1 = car(t0)) && t1==ARRAY) { | 1410 } else if (t0>0 && (t1 = car(t0)) && t1==ARRAY) { |
1410 if (sym==LC) { | 1411 if (sym==LC) { |
1411 conv->decl_data_begin_(); | 1412 conv->decl_data_begin_(); |
1412 mode = mode_save; | 1413 mode = mode_save; |
1413 t1 = cadr(t); | 1414 t1 = cadr(t); |
1414 for(i=0;;i++) { | 1415 for(i=0;;i++) { |
1431 getsym(0); | 1432 getsym(0); |
1432 return offset; | 1433 return offset; |
1433 } | 1434 } |
1434 } | 1435 } |
1435 /* NOT REACHED */ | 1436 /* NOT REACHED */ |
1436 } else if (cadr(t0)==CHAR) { | 1437 } else if (type_value(cadr(t0))==CHAR) { |
1437 e=expr1(); | 1438 e=expr1(); |
1438 mode = mode_save; | 1439 mode = mode_save; |
1439 if(car(e)!=STRING) | 1440 if(car(e)!=STRING) |
1440 error(TYERR); | 1441 error(TYERR); |
1441 offset=assign_data(e,list3(ARRAY,CHAR,size(type)),n,offset); | 1442 offset=assign_data(e,list3(ARRAY,CHAR,size(type)),n,offset); |