Skip to content
Snippets Groups Projects
Commit 58cd45ae authored by Tim Wickberg's avatar Tim Wickberg
Browse files

Move BITSTR_RANGE_FMT definition to bitstring.h so it can be used elsewhere.

Use within dist_tasks.c when printing a bitoff_t to fix compile with
USE_64BIT_BITSTR enabled.
parent b7053bda
No related branches found
No related tags found
No related merge requests found
......@@ -1006,18 +1006,6 @@ bit_pick_cnt(bitstr_t *b, bitoff_t nbits)
return new;
}
/*
* XXX the relationship between stdint types and "unsigned [long] long"
* types is architecture/compiler dependent, so this may have to be tweaked.
*/
#ifdef USE_64BIT_BITSTR
#define BITSTR_RANGE_FMT "%"PRIu64"-%"PRIu64","
#define BITSTR_SINGLE_FMT "%"PRIu64","
#else
#define BITSTR_RANGE_FMT "%u-%u,"
#define BITSTR_SINGLE_FMT "%u,"
#endif
/*
* Convert to range string format, e.g. 0-5,42
*/
......
......@@ -80,6 +80,18 @@ typedef bitstr_t bitoff_t;
#endif
/*
* XXX the relationship between stdint types and "unsigned [long] long"
* types is architecture/compiler dependent, so this may have to be tweaked.
*/
#ifdef USE_64BIT_BITSTR
#define BITSTR_RANGE_FMT "%"PRIu64"-%"PRIu64","
#define BITSTR_SINGLE_FMT "%"PRIu64","
#else
#define BITSTR_RANGE_FMT "%u-%u,"
#define BITSTR_SINGLE_FMT "%u,"
#endif
/*
* internal macros / defs
*/
......
......@@ -1248,9 +1248,9 @@ static bitstr_t *_lllp_map_abstract_mask(bitstr_t *bitmask)
if (bit < bit_size(newmask))
bit_set(newmask, bit);
else
error("_lllp_map_abstract_mask: can't go from "
"%d -> %d since we only have %d bits",
i, bit, bit_size(newmask));
error("%s: can't go from %d -> %d since we "
"only have " BITSTR_SINGLE_FMT " bits",
__func__, i, bit, bit_size(newmask));
}
}
return newmask;
......@@ -1308,8 +1308,8 @@ static void _lllp_generate_cpu_bind(launch_tasks_request_msg_t *req,
charsize += 3; /* "0x" and trailing "," */
masks_len = maxtasks * charsize + 1; /* number of masks + null */
debug3("_lllp_generate_cpu_bind %d %d %d", maxtasks, charsize,
masks_len);
debug3("_lllp_generate_cpu_bind %d " BITSTR_SINGLE_FMT " %d",
maxtasks, charsize, masks_len);
masks_str = xmalloc(masks_len);
masks_len = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment