Changeset 893
- Timestamp:
- 05/11/08 22:11:11 (2 months ago)
- Files:
-
- trunk/src/init.h (modified) (2 diffs)
- trunk/src/init1.c (modified) (53 diffs)
- trunk/src/init2.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/init.h
r892 r893 28 28 PARSE_ERROR_MISSING_RECORD_HEADER, 29 29 PARSE_ERROR_NON_SEQUENTIAL_RECORDS, 30 PARSE_ERROR_NOT_NUMBER, 30 31 PARSE_ERROR_OBSOLETE_FILE, 31 32 PARSE_ERROR_OUT_OF_BOUNDS, … … 34 35 PARSE_ERROR_TOO_MANY_ENTRIES, 35 36 PARSE_ERROR_UNDEFINED_DIRECTIVE, 37 PARSE_ERROR_UNRECOGNISED_BLOW, 36 38 PARSE_ERROR_UNRECOGNISED_TVAL, 37 39 PARSE_ERROR_UNRECOGNISED_SVAL, trunk/src/init1.c
r892 r893 568 568 569 569 /* Verify correct "colon" format */ 570 if (buf[1] != ':') return (PARSE_ERROR_ GENERIC);570 if (buf[1] != ':') return (PARSE_ERROR_MISSING_COLON); 571 571 572 572 … … 818 818 819 819 /* Scan for the value */ 820 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);820 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 821 821 822 822 /* Save the value */ … … 830 830 831 831 /* Scan for the value */ 832 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);832 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 833 833 834 834 /* Save the value */ … … 842 842 843 843 /* Scan for the value */ 844 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);844 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 845 845 846 846 /* Save the value */ … … 854 854 855 855 /* Scan for the value */ 856 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);856 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 857 857 858 858 /* Save the value */ … … 866 866 867 867 /* Scan for the value */ 868 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);868 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 869 869 870 870 /* Save the value */ … … 879 879 880 880 /* Scan for the value */ 881 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);881 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 882 882 883 883 /* Save the value */ … … 892 892 893 893 /* Scan for the value */ 894 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);894 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 895 895 896 896 /* Save the value */ … … 904 904 905 905 /* Scan for the value */ 906 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);906 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 907 907 908 908 /* Save the value */ … … 916 916 917 917 /* Scan for the value */ 918 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);918 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 919 919 920 920 /* Save the value */ … … 928 928 929 929 /* Scan for the value */ 930 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);930 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 931 931 932 932 /* Save the value */ … … 940 940 941 941 /* Scan for the value */ 942 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);942 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 943 943 944 944 /* Save the value */ … … 952 952 953 953 /* Scan for the value */ 954 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);954 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 955 955 956 956 /* Save the value */ … … 964 964 965 965 /* Scan for the value */ 966 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);966 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 967 967 968 968 /* Save the value */ … … 976 976 977 977 /* Scan for the value */ 978 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_ GENERIC);978 if (1 != sscanf(buf+4, "%d", &max)) return (PARSE_ERROR_NOT_NUMBER); 979 979 980 980 /* Save the value */ … … 988 988 989 989 /* Scan for the value */ 990 if (1 != sscanf(buf+4, "%ld", &max)) return (PARSE_ERROR_ GENERIC);990 if (1 != sscanf(buf+4, "%ld", &max)) return (PARSE_ERROR_NOT_NUMBER); 991 991 992 992 /* Save the value */ … … 1000 1000 1001 1001 /* Scan for the value */ 1002 if (1 != sscanf(buf+4, "%ld", &max)) return (PARSE_ERROR_ GENERIC);1002 if (1 != sscanf(buf+4, "%ld", &max)) return (PARSE_ERROR_NOT_NUMBER); 1003 1003 1004 1004 /* Save the value */ … … 1036 1036 1037 1037 /* Verify that colon */ 1038 if (!s) return (PARSE_ERROR_ GENERIC);1038 if (!s) return (PARSE_ERROR_MISSING_COLON); 1039 1039 1040 1040 /* Nuke the colon, advance to the name */ … … 1135 1135 1136 1136 /* Verify that colon */ 1137 if (!s) return (PARSE_ERROR_ GENERIC);1137 if (!s) return (PARSE_ERROR_MISSING_COLON); 1138 1138 1139 1139 /* Nuke the colon, advance to the name */ … … 1176 1176 /* Scan for the values */ 1177 1177 if (1 != sscanf(buf+2, "%d", 1178 &mimic)) return (PARSE_ERROR_ GENERIC);1178 &mimic)) return (PARSE_ERROR_NOT_NUMBER); 1179 1179 1180 1180 /* Save the values */ … … 1271 1271 1272 1272 /* Error */ 1273 return (PARSE_ERROR_ GENERIC);1273 return (PARSE_ERROR_INVALID_FLAG); 1274 1274 } 1275 1275 … … 1318 1318 1319 1319 /* Verify that colon */ 1320 if (!s) return (PARSE_ERROR_ GENERIC);1320 if (!s) return (PARSE_ERROR_MISSING_COLON); 1321 1321 1322 1322 /* Nuke the colon, advance to the name */ … … 1533 1533 1534 1534 /* Parse this entry */ 1535 if (0 != grab_one_kind_flag(k_ptr, s)) return (PARSE_ERROR_INVALID_FLAG); 1535 if (0 != grab_one_kind_flag(k_ptr, s)) 1536 return (PARSE_ERROR_INVALID_FLAG); 1536 1537 1537 1538 /* Start the next entry */ … … 1625 1626 1626 1627 /* Error */ 1627 return (PARSE_ERROR_ GENERIC);1628 return (PARSE_ERROR_INVALID_FLAG); 1628 1629 } 1629 1630 … … 1649 1650 1650 1651 /* Verify that colon */ 1651 if (!s) return (PARSE_ERROR_ GENERIC);1652 if (!s) return (PARSE_ERROR_MISSING_COLON); 1652 1653 1653 1654 /* Nuke the colon, advance to the name */ … … 1752 1753 1753 1754 /* Parse this entry */ 1754 if (0 != grab_one_artifact_flag(a_ptr, s)) return (PARSE_ERROR_INVALID_FLAG); 1755 if (0 != grab_one_artifact_flag(a_ptr, s)) 1756 return (PARSE_ERROR_INVALID_FLAG); 1755 1757 1756 1758 /* Start the next entry */ … … 1766 1768 /* Find the colon after the name */ 1767 1769 s = strchr(buf + 2, ':'); 1768 if (!s) return (PARSE_ERROR_ GENERIC);1770 if (!s) return (PARSE_ERROR_MISSING_COLON); 1769 1771 1770 1772 /* Nuke the colon, advance to the name */ … … 1854 1856 1855 1857 /* Error */ 1856 return (PARSE_ERROR_ GENERIC);1858 return (PARSE_ERROR_INVALID_FLAG); 1857 1859 } 1858 1860 … … 1882 1884 1883 1885 /* Verify that colon */ 1884 if (!s) return (PARSE_ERROR_ GENERIC);1886 if (!s) return (PARSE_ERROR_MISSING_COLON); 1885 1887 1886 1888 /* Nuke the colon, advance to the name */ … … 2012 2014 2013 2015 /* Parse this entry */ 2014 if (0 != grab_one_ego_item_flag(e_ptr, s)) return (PARSE_ERROR_INVALID_FLAG); 2016 if (0 != grab_one_ego_item_flag(e_ptr, s)) 2017 return (PARSE_ERROR_INVALID_FLAG); 2015 2018 2016 2019 /* Start the next entry */ … … 2062 2065 2063 2066 /* Failure */ 2064 return (PARSE_ERROR_ GENERIC);2067 return (PARSE_ERROR_INVALID_FLAG); 2065 2068 } 2066 2069 … … 2084 2087 2085 2088 /* Failure */ 2086 return (PARSE_ERROR_ GENERIC);2089 return (PARSE_ERROR_INVALID_FLAG); 2087 2090 } 2088 2091 … … 2110 2113 2111 2114 /* Verify that colon */ 2112 if (!s) return (PARSE_ERROR_ GENERIC);2115 if (!s) return (PARSE_ERROR_MISSING_COLON); 2113 2116 2114 2117 /* Nuke the colon, advance to the name */ … … 2231 2234 2232 2235 /* Oops, no more slots */ 2233 if (i == MONSTER_BLOW_MAX) return (PARSE_ERROR_GENERIC); 2236 if (i == MONSTER_BLOW_MAX) 2237 return (PARSE_ERROR_TOO_MANY_ENTRIES); 2234 2238 2235 2239 /* Analyze the first field */ … … 2246 2250 2247 2251 /* Invalid method */ 2248 if (!r_info_blow_method[n1]) return (PARSE_ERROR_ GENERIC);2252 if (!r_info_blow_method[n1]) return (PARSE_ERROR_UNRECOGNISED_BLOW); 2249 2253 2250 2254 /* Analyze the second field */ … … 2261 2265 2262 2266 /* Invalid effect */ 2263 if (!r_info_blow_effect[n2]) return (PARSE_ERROR_ GENERIC);2267 if (!r_info_blow_effect[n2]) return (PARSE_ERROR_UNRECOGNISED_BLOW); 2264 2268 2265 2269 /* Analyze the third field */ … … 2297 2301 2298 2302 /* Parse this entry */ 2299 if (0 != grab_one_basic_flag(r_ptr, s)) return (PARSE_ERROR_INVALID_FLAG); 2303 if (0 != grab_one_basic_flag(r_ptr, s)) 2304 return (PARSE_ERROR_INVALID_FLAG); 2300 2305 2301 2306 /* Start the next entry */ … … 2375 2380 2376 2381 /* Error */ 2377 return (PARSE_ERROR_ GENERIC);2382 return (PARSE_ERROR_INVALID_FLAG); 2378 2383 } 2379 2384 … … 2424 2429 2425 2430 /* Verify that colon */ 2426 if (!s) return (PARSE_ERROR_ GENERIC);2431 if (!s) return (PARSE_ERROR_MISSING_COLON); 2427 2432 2428 2433 /* Nuke the colon, advance to the name */ … … 2430 2435 2431 2436 /* Paranoia -- require a name */ 2432 if (!*s) return (PARSE_ERROR_ GENERIC);2437 if (!*s) return (PARSE_ERROR_MISSING_FIELD); 2433 2438 2434 2439 /* Get the index */ … … 2470 2475 2471 2476 /* Verify that colon */ 2472 if (!s) return (PARSE_ERROR_ GENERIC);2477 if (!s) return (PARSE_ERROR_MISSING_COLON); 2473 2478 2474 2479 /* Nuke the colon, advance to the subindex */ … … 2493 2498 2494 2499 /* Verify text */ 2495 if (!buf[1] || !buf[2]) return (PARSE_ERROR_ GENERIC);2500 if (!buf[1] || !buf[2]) return (PARSE_ERROR_MISSING_FIELD); 2496 2501 2497 2502 /* Scan and save the values */ … … 2590 2595 2591 2596 /* Parse this entry */ 2592 if (0 != grab_one_racial_flag(pr_ptr, s)) return (PARSE_ERROR_INVALID_FLAG); 2597 if (0 != grab_one_racial_flag(pr_ptr, s)) 2598 return (PARSE_ERROR_INVALID_FLAG); 2593 2599 2594 2600 /* Start the next entry */ … … 2646 2652 2647 2653 /* Error */ 2648 return (PARSE_ERROR_ GENERIC);2654 return (PARSE_ERROR_INVALID_FLAG); 2649 2655 } 2650 2656 … … 2673 2679 2674 2680 /* Verify that colon */ 2675 if (!s) return (PARSE_ERROR_ GENERIC);2681 if (!s) return (PARSE_ERROR_MISSING_COLON); 2676 2682 2677 2683 /* Nuke the colon, advance to the name */ … … 2679 2685 2680 2686 /* Paranoia -- require a name */ 2681 if (!*s) return (PARSE_ERROR_ GENERIC);2687 if (!*s) return (PARSE_ERROR_MISSING_FIELD); 2682 2688 2683 2689 /* Get the index */ … … 2723 2729 2724 2730 /* Verify that colon */ 2725 if (!s) return (PARSE_ERROR_ GENERIC);2731 if (!s) return (PARSE_ERROR_MISSING_COLON); 2726 2732 2727 2733 /* Nuke the colon, advance to the subindex */ … … 2746 2752 2747 2753 /* Verify text */ 2748 if (!buf[1] || !buf[2]) return (PARSE_ERROR_ GENERIC);2754 if (!buf[1] || !buf[2]) return (PARSE_ERROR_MISSING_FIELD); 2749 2755 2750 2756 /* Scan and save the values */ … … 2759 2765 2760 2766 /* Verify text */ 2761 if (!buf[1] || !buf[2]) return (PARSE_ERROR_ GENERIC);2767 if (!buf[1] || !buf[2]) return (PARSE_ERROR_MISSING_FIELD); 2762 2768 2763 2769 /* Scan and save the values */ … … 3031 3037 { 3032 3038 /* Confirm the colon */ 3033 if (buf[1] != ':') return PARSE_ERROR_ GENERIC;3039 if (buf[1] != ':') return PARSE_ERROR_MISSING_COLON; 3034 3040 3035 3041 /* Get the index */ … … 3140 3146 3141 3147 /* Paranoia */ 3142 if (!buf[2]) return (PARSE_ERROR_ GENERIC);3148 if (!buf[2]) return (PARSE_ERROR_MISSING_FIELD); 3143 3149 if (!buf[3]) return (PARSE_ERROR_GENERIC); 3144 3150 if (!buf[4]) return (PARSE_ERROR_GENERIC); … … 3177 3183 3178 3184 /* Paranoia */ 3179 if (!buf[1]) return (PARSE_ERROR_ GENERIC);3180 if (!buf[2]) return (PARSE_ERROR_ GENERIC);3185 if (!buf[1]) return (PARSE_ERROR_MISSING_FIELD); 3186 if (!buf[2]) return (PARSE_ERROR_MISSING_FIELD); 3181 3187 3182 3188 /* Store the text */ … … 3216 3222 3217 3223 /* Verify that colon */ 3218 if (!s) return (PARSE_ERROR_ GENERIC);3224 if (!s) return (PARSE_ERROR_MISSING_COLON); 3219 3225 3220 3226 /* Nuke the colon, advance to the name */ trunk/src/init2.c
r892 r893 239 239 "missing record header", 240 240 "non-sequential records", 241 "value not a number", 241 242 "obsolete file", 242 243 "value out of bounds", … … 245 246 "too many entries", 246 247 "undefined directive", 248 "unrecognised blow", 247 249 "unrecognised tval name", 248 250 "unrecognised sval name",
