Changeset 175 for soft/giet_vm/xml
- Timestamp:
- Jul 21, 2012, 10:20:47 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/xml/xml_parser.c
r174 r175 364 364 365 365 //////// get type attribute 366 str = getStringValue(reader, "type", &ok);367 #if XML_PARSER_DEBUG 368 printf(" type = %s\n", str);369 #endif 370 if (ok && (strcmp( str, "ELF") == 0))366 char *type_str = getStringValue(reader, "type", &ok); 367 #if XML_PARSER_DEBUG 368 printf(" type = %s\n", type_str); 369 #endif 370 if (ok && (strcmp(type_str, "ELF") == 0)) 371 371 { 372 372 vobj[vobj_index]->type = VOBJ_TYPE_ELF; … … 380 380 } 381 381 } 382 else if (ok && (strcmp( str, "BLOB") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BLOB;383 else if (ok && (strcmp( str, "PTAB") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PTAB;384 else if (ok && (strcmp( str, "PERI") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PERI;385 else if (ok && (strcmp( str, "MWMR") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_MWMR;386 else if (ok && (strcmp( str, "LOCK") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_LOCK;387 else if (ok && (strcmp( str, "BUFFER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BUFFER;388 else if (ok && (strcmp( str, "BARRIER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BARRIER;382 else if (ok && (strcmp(type_str, "BLOB") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BLOB; 383 else if (ok && (strcmp(type_str, "PTAB") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PTAB; 384 else if (ok && (strcmp(type_str, "PERI") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PERI; 385 else if (ok && (strcmp(type_str, "MWMR") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_MWMR; 386 else if (ok && (strcmp(type_str, "LOCK") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_LOCK; 387 else if (ok && (strcmp(type_str, "BUFFER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BUFFER; 388 else if (ok && (strcmp(type_str, "BARRIER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BARRIER; 389 389 else 390 390 { … … 438 438 } 439 439 440 ////////// get init attribute ( optional : 0 if missing)440 ////////// get init attribute (mandatory for mwmr and barrier) 441 441 value = getIntValue(reader,"init", &ok); 442 442 if ( ok ) … … 449 449 else 450 450 { 451 vobj[vobj_index]->init = 0; 451 if(vobj[vobj_index]->type == VOBJ_TYPE_MWMR || vobj[vobj_index]->type == VOBJ_TYPE_BARRIER ) 452 { 453 printf("[XML ERROR] illegal or missing <value> attribute for vobj (%d,%d), of type: %s\n", 454 vspace_index, vobj_loc_index, type_str); 455 exit(1); 456 } 457 else 458 vobj[vobj_index]->init = 0; 452 459 } 453 460
Note: See TracChangeset
for help on using the changeset viewer.