From 916f98a3eea59bc6db68a388ab7cb6cb6d6c88b6 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Sun, 7 Sep 2014 15:42:05 +0000 Subject: [PATCH] Rename an HWLOC member of a union in the diff.h file to avoid a naming conflict with an external library - it isn't that HWLOC did something wrong, but rather that the name being used is so close to a type name that other folks has a tendency to #define it as well. We could argue with those folks that what they are doing is incorrect, but it is just easier to make a slight change and resolve the problem. This commit was SVN r32675. --- opal/mca/hwloc/hwloc191/hwloc/include/hwloc/diff.h | 2 +- opal/mca/hwloc/hwloc191/hwloc/src/diff.c | 12 ++++++------ opal/mca/hwloc/hwloc191/hwloc/src/topology-xml.c | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/opal/mca/hwloc/hwloc191/hwloc/include/hwloc/diff.h b/opal/mca/hwloc/hwloc191/hwloc/include/hwloc/diff.h index a6046ff1e7..62396f8a73 100644 --- a/opal/mca/hwloc/hwloc191/hwloc/include/hwloc/diff.h +++ b/opal/mca/hwloc/hwloc191/hwloc/include/hwloc/diff.h @@ -91,7 +91,7 @@ union hwloc_topology_diff_obj_attr_u { hwloc_uint64_t index; /* not used for SIZE */ hwloc_uint64_t oldvalue; hwloc_uint64_t newvalue; - } uint64; + } ui64; /** \brief String attribute modification with an optional name */ struct hwloc_topology_diff_obj_attr_string_s { diff --git a/opal/mca/hwloc/hwloc191/hwloc/src/diff.c b/opal/mca/hwloc/hwloc191/hwloc/src/diff.c index 40cda64232..92c56ce5db 100644 --- a/opal/mca/hwloc/hwloc191/hwloc/src/diff.c +++ b/opal/mca/hwloc/hwloc191/hwloc/src/diff.c @@ -117,10 +117,10 @@ static int hwloc_append_diff_obj_attr_uint64(hwloc_obj_t obj, newdiff->obj_attr.type = HWLOC_TOPOLOGY_DIFF_OBJ_ATTR; newdiff->obj_attr.obj_depth = obj->depth; newdiff->obj_attr.obj_index = obj->logical_index; - newdiff->obj_attr.diff.uint64.type = type; - newdiff->obj_attr.diff.uint64.index = index; - newdiff->obj_attr.diff.uint64.oldvalue = oldvalue; - newdiff->obj_attr.diff.uint64.newvalue = newvalue; + newdiff->obj_attr.diff.ui64.type = type; + newdiff->obj_attr.diff.ui64.index = index; + newdiff->obj_attr.diff.ui64.oldvalue = oldvalue; + newdiff->obj_attr.diff.ui64.newvalue = newvalue; hwloc_append_diff(newdiff, firstdiffp, lastdiffp); return 0; } @@ -316,8 +316,8 @@ hwloc_apply_diff_one(hwloc_topology_t topology, switch (obj_attr->diff.generic.type) { case HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE: { hwloc_obj_t tmpobj; - hwloc_uint64_t oldvalue = reverse ? obj_attr->diff.uint64.newvalue : obj_attr->diff.uint64.oldvalue; - hwloc_uint64_t newvalue = reverse ? obj_attr->diff.uint64.oldvalue : obj_attr->diff.uint64.newvalue; + hwloc_uint64_t oldvalue = reverse ? obj_attr->diff.ui64.newvalue : obj_attr->diff.ui64.oldvalue; + hwloc_uint64_t newvalue = reverse ? obj_attr->diff.ui64.oldvalue : obj_attr->diff.ui64.newvalue; hwloc_uint64_t valuediff = newvalue - oldvalue; if (obj->memory.local_memory != oldvalue) return -1; diff --git a/opal/mca/hwloc/hwloc191/hwloc/src/topology-xml.c b/opal/mca/hwloc/hwloc191/hwloc/src/topology-xml.c index 6c428e80d9..570abd0cc7 100644 --- a/opal/mca/hwloc/hwloc191/hwloc/src/topology-xml.c +++ b/opal/mca/hwloc/hwloc191/hwloc/src/topology-xml.c @@ -683,8 +683,8 @@ hwloc__xml_import_diff_one(hwloc__xml_import_state_t state, switch (atoi(obj_attr_type_s)) { case HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE: - diff->obj_attr.diff.uint64.oldvalue = strtoull(obj_attr_oldvalue_s, NULL, 0); - diff->obj_attr.diff.uint64.newvalue = strtoull(obj_attr_newvalue_s, NULL, 0); + diff->obj_attr.diff.ui64.oldvalue = strtoull(obj_attr_oldvalue_s, NULL, 0); + diff->obj_attr.diff.ui64.newvalue = strtoull(obj_attr_newvalue_s, NULL, 0); break; case HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO: diff->obj_attr.diff.string.name = strdup(obj_attr_name_s); @@ -1154,11 +1154,11 @@ hwloc__xml_export_diff(hwloc__xml_export_state_t parentstate, hwloc_topology_dif switch (diff->obj_attr.diff.generic.type) { case HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE: - sprintf(tmp, "%llu", (unsigned long long) diff->obj_attr.diff.uint64.index); + sprintf(tmp, "%llu", (unsigned long long) diff->obj_attr.diff.ui64.index); state.new_prop(&state, "obj_attr_index", tmp); - sprintf(tmp, "%llu", (unsigned long long) diff->obj_attr.diff.uint64.oldvalue); + sprintf(tmp, "%llu", (unsigned long long) diff->obj_attr.diff.ui64.oldvalue); state.new_prop(&state, "obj_attr_oldvalue", tmp); - sprintf(tmp, "%llu", (unsigned long long) diff->obj_attr.diff.uint64.newvalue); + sprintf(tmp, "%llu", (unsigned long long) diff->obj_attr.diff.ui64.newvalue); state.new_prop(&state, "obj_attr_newvalue", tmp); break; case HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME: