- if(isFraction) {
- fprintf(stderr, "genprops: not prepared for new fractions in DerivedNumericValues.txt field 1 at %s\n", fields[1][0]);
- exit(U_PARSE_ERROR);
- }
-
- if(beVerbose) {
- printf("adding U+%04x numeric type %d value %u\n", (int)start, U_NT_NUMERIC, (int)value);
- }
-
- /* reconstruct the properties and set the new numeric type and value */
- uprv_memset(&newProps, 0, sizeof(newProps));
- newProps.code=start;
- newProps.generalCategory=(uint8_t)GET_CATEGORY(oldProps32);
- newProps.bidi=(uint8_t)GET_BIDI_CLASS(oldProps32);
- newProps.isMirrored=(uint8_t)(oldProps32&(1UL<<UPROPS_MIRROR_SHIFT) ? TRUE : FALSE);
- newProps.numericType=(uint8_t)U_NT_NUMERIC; /* assumed numeric type, see Unicode 4.0.1 comment */
- newProps.numericValue=(int32_t)value; /* newly parsed numeric value */
- addProps(start, makeProps(&newProps));
- }
-}
-
-/* DerivedBidiClass.txt ----------------------------------------------------- */
-
-static void U_CALLCONV
-bidiClassLineFn(void *context,
- char *fields[][2], int32_t fieldCount,
- UErrorCode *pErrorCode) {
- char *s;
- uint32_t oldStart, start, limit, value, props32;
- UBool didSet;
-
- /* get the code point range */
- u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
- if(U_FAILURE(*pErrorCode)) {
- fprintf(stderr, "genprops: syntax error in DerivedBidiClass.txt field 0 at %s\n", fields[0][0]);
- exit(*pErrorCode);
- }
- ++limit;
-
- /* parse bidi class */
- s=trimTerminateField(fields[1][0], fields[1][1]);
- value=u_getPropertyValueEnum(UCHAR_BIDI_CLASS, s);
- if((int32_t)value<0) {
- fprintf(stderr, "genprops error: unknown bidi class in DerivedBidiClass.txt field 1 at %s\n", s);
- exit(U_PARSE_ERROR);
- }
-
- didSet=FALSE;
- oldStart=start;
- for(; start<limit; ++start) {
- props32=getProps(start);
-
- /* ignore if this bidi class is already set */
- if(value==GET_BIDI_CLASS(props32)) {
- continue;
- }
+ /* verify that we do not change an existing value (fractions were excluded above) */
+ if(oldType!=0) {
+ /* the code point already has a value stored */
+ if((oldProps32&0xff00)!=(value&0xff00)) {
+ fprintf(stderr, "genprops error: new numeric value differs from old one for U+%04lx\n", (long)start);
+ exit(U_PARSE_ERROR);
+ }
+ /* same value, continue */
+ } else {
+ /* the code point is getting a new numeric value */
+ if(beVerbose) {
+ printf("adding U+%04x numeric type %d value 0x%04x from %s\n", (int)start, U_NT_NUMERIC, (int)value, fields[0][0]);
+ }