From 6b580bfefd719bbaaef855fb10be2840bee8681a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 29 Nov 2011 10:46:43 +0000 Subject: [PATCH] Added more validation of softlist and cleared errors found (no whatsnew) --- hash/neogeo.xml | 88 +++++++++++++++++++++---------------------- hash/softwarelist.dtd | 1 - hash/stv.xml | 32 ++++++++-------- src/emu/softlist.c | 61 ++++++++++++++++++++---------- 4 files changed, 101 insertions(+), 81 deletions(-) diff --git a/hash/neogeo.xml b/hash/neogeo.xml index 091cdce8905..138871c1f15 100644 --- a/hash/neogeo.xml +++ b/hash/neogeo.xml @@ -2,18 +2,18 @@ - + NAM-1975 (NGM-001)(NGH-001) @@ -3500,7 +3500,7 @@ - + @@ -7102,7 +7102,7 @@ - + @@ -7146,7 +7146,7 @@ - + @@ -7192,7 +7192,7 @@ - + @@ -7235,7 +7235,7 @@ - + @@ -7326,7 +7326,7 @@ - + @@ -7370,8 +7370,8 @@ - - + + @@ -7414,7 +7414,7 @@ - + @@ -7502,7 +7502,7 @@ - + @@ -7550,7 +7550,7 @@ - + @@ -7602,7 +7602,7 @@ - + @@ -7646,7 +7646,7 @@ - + @@ -7701,7 +7701,7 @@ - + @@ -7743,7 +7743,7 @@ - + @@ -7797,7 +7797,7 @@ - + @@ -7838,7 +7838,7 @@ - + @@ -7878,7 +7878,7 @@ - + @@ -7926,7 +7926,7 @@ - + @@ -7970,7 +7970,7 @@ - + @@ -8025,7 +8025,7 @@ - + @@ -8066,7 +8066,7 @@ - + @@ -8115,7 +8115,7 @@ - + @@ -8166,7 +8166,7 @@ - + @@ -8217,7 +8217,7 @@ - + @@ -8265,7 +8265,7 @@ - + @@ -8308,7 +8308,7 @@ - + @@ -8351,7 +8351,7 @@ - + @@ -8402,7 +8402,7 @@ - + @@ -8454,7 +8454,7 @@ - + @@ -8497,7 +8497,7 @@ - + @@ -8549,7 +8549,7 @@ - + @@ -8594,7 +8594,7 @@ - + @@ -8644,7 +8644,7 @@ - + @@ -8687,7 +8687,7 @@ - + @@ -8731,7 +8731,7 @@ - + @@ -9479,7 +9479,7 @@ - + @@ -9661,7 +9661,7 @@ - + @@ -10129,7 +10129,7 @@ - + Digger Man (prototype) 2000 diff --git a/hash/softwarelist.dtd b/hash/softwarelist.dtd index 16e278cb8a1..a4d15449316 100644 --- a/hash/softwarelist.dtd +++ b/hash/softwarelist.dtd @@ -29,7 +29,6 @@ - diff --git a/hash/stv.xml b/hash/stv.xml index bd4bf69a1b1..4c1f4f63469 100644 --- a/hash/stv.xml +++ b/hash/stv.xml @@ -196,12 +196,12 @@ Sega - - - - - - + + + + + + @@ -229,11 +229,11 @@ Sega - - - - - + + + + + @@ -650,11 +650,11 @@ Atlus - - - - - + + + + + diff --git a/src/emu/softlist.c b/src/emu/softlist.c index 5558c6c1588..6b32a9d4e52 100644 --- a/src/emu/softlist.c +++ b/src/emu/softlist.c @@ -338,14 +338,15 @@ static void start_handler(void *data, const char *tagname, const char **attribut if ( ! strcmp(attributes[0], "name" ) ) { } - if ( ! strcmp(attributes[0], "description" ) ) + else if ( ! strcmp(attributes[0], "description" ) ) { swlist->description = (const char *)pool_malloc_lib(swlist->pool, (strlen(attributes[1]) + 1) * sizeof(char)); if (!swlist->description) return; strcpy((char *)swlist->description, attributes[1]); - } + } else + unknown_attribute(swlist, attributes[0]); } } else @@ -367,14 +368,16 @@ static void start_handler(void *data, const char *tagname, const char **attribut { name = attributes[1]; } - if ( !strcmp( attributes[0], "cloneof" ) ) + else if ( !strcmp( attributes[0], "cloneof" ) ) { parent = attributes[1]; } - if ( !strcmp( attributes[0], "supported" ) ) + else if ( !strcmp( attributes[0], "supported" ) ) { supported = attributes[1]; - } + } + else + unknown_attribute(swlist, attributes[0]); } if ( name ) @@ -476,8 +479,11 @@ static void start_handler(void *data, const char *tagname, const char **attribut if ( !strcmp( attributes[0], "name" ) ) str_feature_name = attributes[1]; - if ( !strcmp( attributes[0], "value" ) ) + else if ( !strcmp( attributes[0], "value" ) ) str_feature_value = attributes[1]; + + else + unknown_attribute(swlist, attributes[0]); } /* Prepare for adding feature to feature list */ @@ -514,8 +520,11 @@ static void start_handler(void *data, const char *tagname, const char **attribut if ( !strcmp( attributes[0], "name" ) ) str_name = attributes[1]; - if ( !strcmp( attributes[0], "interface" ) ) + else if ( !strcmp( attributes[0], "interface" ) ) str_interface = attributes[1]; + + else + unknown_attribute(swlist, attributes[0]); } if ( str_name && str_interface ) @@ -564,8 +573,11 @@ static void start_handler(void *data, const char *tagname, const char **attribut if ( !strcmp( attributes[0], "name" ) ) str_name = attributes[1]; - if ( !strcmp( attributes[0], "size") ) + else if ( !strcmp( attributes[0], "size") ) str_size = attributes[1]; + + else + unknown_attribute(swlist, attributes[0]); } if ( str_name && str_size ) { @@ -596,6 +608,8 @@ static void start_handler(void *data, const char *tagname, const char **attribut { if ( !strcmp( attributes[0], "name" ) ) str_name = attributes[1]; + else + unknown_attribute(swlist, attributes[0]); } if ( str_name ) { @@ -627,8 +641,11 @@ static void start_handler(void *data, const char *tagname, const char **attribut if ( !strcmp( attributes[0], "name" ) ) str_feature_name = attributes[1]; - if ( !strcmp( attributes[0], "value" ) ) + else if ( !strcmp( attributes[0], "value" ) ) str_feature_value = attributes[1]; + + else + unknown_attribute(swlist, attributes[0]); } /* Prepare for adding feature to feature list */ @@ -678,20 +695,22 @@ static void start_handler(void *data, const char *tagname, const char **attribut { if ( !strcmp( attributes[0], "name" ) ) str_name = attributes[1]; - if ( !strcmp( attributes[0], "size" ) ) + else if ( !strcmp( attributes[0], "size" ) ) str_size = attributes[1]; - if ( !strcmp( attributes[0], "crc" ) ) + else if ( !strcmp( attributes[0], "crc" ) ) str_crc = attributes[1]; - if ( !strcmp( attributes[0], "sha1" ) ) + else if ( !strcmp( attributes[0], "sha1" ) ) str_sha1 = attributes[1]; - if ( !strcmp( attributes[0], "offset" ) ) + else if ( !strcmp( attributes[0], "offset" ) ) str_offset = attributes[1]; - if ( !strcmp( attributes[0], "value" ) ) + else if ( !strcmp( attributes[0], "value" ) ) str_value = attributes[1]; - if ( !strcmp( attributes[0], "status" ) ) + else if ( !strcmp( attributes[0], "status" ) ) str_status = attributes[1]; - if ( !strcmp( attributes[0], "loadflag" ) ) - str_loadflag = attributes[1]; + else if ( !strcmp( attributes[0], "loadflag" ) ) + str_loadflag = attributes[1]; + else + unknown_attribute(swlist, attributes[0]); } if ( swlist->softinfo ) { @@ -771,12 +790,14 @@ static void start_handler(void *data, const char *tagname, const char **attribut { if ( !strcmp( attributes[0], "name" ) ) str_name = attributes[1]; - if ( !strcmp( attributes[0], "sha1" ) ) + else if ( !strcmp( attributes[0], "sha1" ) ) str_sha1 = attributes[1]; - if ( !strcmp( attributes[0], "status" ) ) + else if ( !strcmp( attributes[0], "status" ) ) str_status = attributes[1]; - if ( !strcmp( attributes[0], "writeable" ) ) + else if ( !strcmp( attributes[0], "writeable" ) ) str_writeable = attributes[1]; + else + unknown_attribute(swlist, attributes[0]); } if ( swlist->softinfo ) {