1
1

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.
Этот коммит содержится в:
Ralph Castain 2014-09-07 15:42:05 +00:00
родитель 0f59ce6591
Коммит 916f98a3ee
3 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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: