Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 35905) +++ trunk/src_plugins/io_lihata/write.c (revision 35906) @@ -1749,7 +1749,7 @@ rnd_coord_t v1, v2; rnd_bool success1, success2; -/* rnd_trace("SMART %s d='%s' m='%s'\n", inmem_node->name, ondisk_value, inmem_node->data.text.value);*/ +/* rnd_trace("SMART crd %s d='%s' m='%s'\n", inmem_node->name, ondisk_value, inmem_node->data.text.value);*/ v1 = rnd_get_value_ex(ondisk_value, NULL, NULL, NULL, NULL, &success1); v2 = rnd_get_value_ex(inmem_node->data.text.value, NULL, NULL, NULL, NULL, &success2); @@ -1761,9 +1761,25 @@ else return LHTPERS_MEM; } - /* else fall back to the string compare below */ } + else if (lhtpers_rule_find(io_lihata_out_doubles, inmem_node) != NULL) { + double d1, d2; + char *end1, *end2; + rnd_trace("SMART dbl %s d='%s' m='%s'\n", inmem_node->name, ondisk_value, inmem_node->data.text.value); + + d1 = strtod(ondisk_value, &end1); + d2 = strtod(inmem_node->data.text.value, &end2); + if ((*end1 == '\0') && (*end2 == '\0')) { + /* smart: if values are the same, keep the on-disk version */ + if (d1 == d2) + return LHTPERS_DISK; + else + return LHTPERS_MEM; + } + } + /* else fall back to the string compare below */ + if (inmem_node->data.text.value == NULL) return LHTPERS_INHIBIT; Index: trunk/src_plugins/io_lihata/write_style.c =================================================================== --- trunk/src_plugins/io_lihata/write_style.c (revision 35905) +++ trunk/src_plugins/io_lihata/write_style.c (revision 35906) @@ -725,3 +725,12 @@ {NULL, NULL, NULL} }; + +static const char *cpat_arc_astart[] = {"te:astart", "ha:arc.*", "*", NULL}; +static const char *cpat_arc_adelta[] = {"te:adelta", "ha:arc.*", "*", NULL}; + +lhtpers_rule_t io_lihata_out_doubles[] = { + {cpat_arc_astart, NULL, NULL}, + {cpat_arc_adelta, NULL, NULL}, + {NULL, NULL, NULL} +}; Index: trunk/src_plugins/io_lihata/write_style.h =================================================================== --- trunk/src_plugins/io_lihata/write_style.h (revision 35905) +++ trunk/src_plugins/io_lihata/write_style.h (revision 35906) @@ -31,3 +31,4 @@ extern lhtpers_rule_t *io_lihata_out_rules[]; extern lhtpers_rule_t io_lihata_out_coords[]; +extern lhtpers_rule_t io_lihata_out_doubles[];