diff options
author | Neal H. Walfield <neal@gnu.org> | 2009-01-18 02:07:41 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@gnu.org> | 2009-01-18 02:07:41 +0100 |
commit | 6e8917cd379cd0aec0a7689d4c903f32cd09edaf (patch) | |
tree | 131d9618d15da4d650127e71584600758bae9221 /libviengoos | |
parent | 7fe504f224ab520ea06a77c0b36b1513843e5f44 (diff) |
Use correct format and type specifiers.
benchmarks/
2009-01-18 Neal H. Walfield <neal@gnu.org>
* activity-distribution.c: Include <stdint.h> and <inttypes.h>.
(main): Use correct printf format specifiers.
* cache.c: Include <stdint.h> and <inttypes.h>.
(helper): Use correct printf format specifiers.
(helper_fork): Likewise.
(object_read): Likewise.
(object_fill): Likewise.
(main): Likewise.
hieronymus/
2009-01-18 Neal H. Walfield <neal@gnu.org>
* hieronymus.c (main): Use correct printf format specifiers.
libc-parts/
2009-01-18 Neal H. Walfield <neal@gnu.org>
* backtrace.c (backtrace_print): Use correct printf format
specifiers.
* panic.c (panic_): Likewise.
* profile.c (profile_stats_dump): Likewise.
* process-spawn.c: Include <stdint.h> and <inttypes.h>.
(process_spawn): Use correct printf format specifiers.
libhurd-mm/
2009-01-18 Neal H. Walfield <neal@gnu.org>
* as.h: Include <stdint.h> and <inttypes.h>.
(AS_CHECK_SHADOW): Use correct printf format specifiers.
* as.c: Include <stdint.h> and <inttypes.h>.
(free_space_split): Use correct printf format specifiers.
(as_free): Likewise.
(as_alloced_dump): Likewise.
* as-lookup.c: Include <stdint.h> and <inttypes.h>.
(as_lookup_rel_internal): Use correct printf format specifiers.
* as-build.c: Include <stdint.h> and <inttypes.h>.
(as_build): Use correct printf format specifiers.
* as-dump.c: Include <stdint.h> and <inttypes.h>.
(print_nr): Remove function.
(do_walk): Use correct printf format specifiers. Use precision
specifiers instead of print_nr.
* anonymous.c (fault): Use correct
printf format specifiers.
(anonymous_pager_alloc): Likewise.
* exceptions.c (hurd_activation_handler_normal): Likewise.
(hurd_activation_handler_activated): Likewise.
(hurd_activation_handler_init_early): Likewise.
* map.h: Include <inttypes.h>.
(map_find): Use correct printf format specifiers.
(REGION_FMT): Likewise.
(MAP_FMT): Likewise.
* map.c (map_install): Likewise.
(map_split): Likewise.
* madvise.c (madvise): Likewise.
* mmap.c (munmap): Likewise.
* mprotect.c (mprotect): Likewise.
* pager.c (pager_init): Likewise.
* storage.h (storage_alloc): Likewise.
* storage.c (storage_alloc): Likewise.
(storage_init): Likewise.
libpthread/
2009-01-18 Neal H. Walfield <neal@gnu.org>
* sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock): Use
correct printf format specifiers.
* sysdeps/viengoos/pt-wakeup.c (__pthread_wakeup): Likewise.
libviengoos/
2009-01-18 Neal H. Walfield <neal@gnu.org>
* viengoos/addr.h: Include <inttypes.h>.
(VG_ADDR_FMT): Use correct printf format specifiers.
(VG_ADDR_VOID): Use the correct constant suffix.
(vg_addr_prefix): Likewise.
(vg_addr_chop): Likewise.
(vg_addr_extract): Likewise.
(vg_addr_extend): Do both of the above.
* viengoos/cap.h: Include <inttypes.h>.
(VG_OID_FMT): Use correct printf format specifiers.
(VG_CAP_FMT): Likewise.
(vg_cap_copy_x): Likewise.
* viengoos/thread.h: Include <inttypes.h>.
(vg_niltid): Use the correct constant suffix.
(VG_THREAD_ID_FMT): Use correct printf format specifiers.
ruth/
2009-01-18 Neal H. Walfield <neal@gnu.org>
* ruth.c (main): Use correct printf format specifiers.
viengoos/
2009-01-18 Neal H. Walfield <neal@gnu.org>
* object.h (object_desc_to_object): Use correct printf format
specifiers.
Diffstat (limited to 'libviengoos')
-rw-r--r-- | libviengoos/ChangeLog | 17 | ||||
-rw-r--r-- | libviengoos/viengoos/addr.h | 22 | ||||
-rw-r--r-- | libviengoos/viengoos/cap.h | 12 | ||||
-rw-r--r-- | libviengoos/viengoos/thread.h | 5 |
4 files changed, 40 insertions, 16 deletions
diff --git a/libviengoos/ChangeLog b/libviengoos/ChangeLog index 1c061f1..6f0c111 100644 --- a/libviengoos/ChangeLog +++ b/libviengoos/ChangeLog @@ -1,3 +1,20 @@ +2009-01-18 Neal H. Walfield <neal@gnu.org> + + * viengoos/addr.h: Include <inttypes.h>. + (VG_ADDR_FMT): Use correct printf format specifiers. + (VG_ADDR_VOID): Use the correct constant suffix. + (vg_addr_prefix): Likewise. + (vg_addr_chop): Likewise. + (vg_addr_extract): Likewise. + (vg_addr_extend): Do both of the above. + * viengoos/cap.h: Include <inttypes.h>. + (VG_OID_FMT): Use correct printf format specifiers. + (VG_CAP_FMT): Likewise. + (vg_cap_copy_x): Likewise. + * viengoos/thread.h: Include <inttypes.h>. + (vg_niltid): Use the correct constant suffix. + (VG_THREAD_ID_FMT): Use correct printf format specifiers. + 2009-01-16 Neal H. Walfield <neal@gnu.org> * viengoos/thread.h (VG_READ): Define. diff --git a/libviengoos/viengoos/addr.h b/libviengoos/viengoos/addr.h index 5d6d143..c43b1c0 100644 --- a/libviengoos/viengoos/addr.h +++ b/libviengoos/viengoos/addr.h @@ -25,6 +25,7 @@ #include <hurd/types.h> #include <viengoos/math.h> #include <stdint.h> +#include <inttypes.h> #include <assert.h> @@ -53,7 +54,7 @@ struct vg_addr /* Client-side capability handle. */ typedef struct vg_addr vg_addr_t; -#define VG_ADDR_FMT "%llx/%d" +#define VG_ADDR_FMT "%"PRIx64 "/%d" #define VG_ADDR_PRINTF(addr_) vg_addr_prefix ((addr_)), vg_addr_depth ((addr_)) /* Create an address given a prefix and a depth. */ @@ -72,7 +73,7 @@ typedef struct vg_addr vg_addr_t; #define VG_ADDR_INIT(prefix_, depth_) \ { .raw = ((((prefix_) << 1) | 1) << (VG_ADDR_BITS - (depth_))) } -#define VG_ADDR_VOID ((struct vg_addr) { 0ULL }) +#define VG_ADDR_VOID ((struct vg_addr) { UINT64_C(0) }) #define VG_ADDR_EQ(a, b) (a.raw == b.raw) #define VG_ADDR_IS_VOID(a) (VG_ADDR_EQ (a, VG_ADDR_VOID)) @@ -88,7 +89,8 @@ static inline uint64_t vg_addr_prefix (vg_addr_t addr) { /* (Clear the boundary bit and shift right 1.) */ - return (addr.raw & ~(1ULL << (VG_ADDR_BITS - vg_addr_depth (addr)))) >> 1; + return (addr.raw & ~(UINT64_C (1) + << (VG_ADDR_BITS - vg_addr_depth (addr)))) >> 1; } /* Extend the address VG_ADDR by concatenating the lowest DEPTH bits of @@ -100,8 +102,8 @@ vg_addr_extend (vg_addr_t addr, uint64_t prefix, int depth) assertx (depth >= 0, "depth: %d", depth); assertx (vg_addr_depth (addr) + depth <= VG_ADDR_BITS, "addr: " VG_ADDR_FMT "; depth: %d", VG_ADDR_PRINTF (addr), depth); - assertx (prefix < (1ULL << depth), - "prefix: %llx; depth: %lld", prefix, 1ULL << depth); + assertx (prefix < (UINT64_C (1) << depth), + "prefix: %"PRIx64"; depth: %"PRId64, prefix, UINT64_C (1) << depth); return VG_ADDR (vg_addr_prefix (addr) | (prefix << (VG_ADDR_BITS - vg_addr_depth (addr) - depth)), vg_addr_depth (addr) + depth); @@ -115,8 +117,9 @@ vg_addr_extend (vg_addr_t addr, uint64_t prefix, int depth) assertx (d__ >= 0, "depth: %d", d__); \ assertx (vg_addr_depth ((a__)) + (d__) <= VG_ADDR_BITS, \ "addr: " VG_ADDR_FMT "; depth: %d", VG_ADDR_PRINTF (a__), d__); \ - assertx (p__ < (1ULL << d__), \ - "prefix: %llx; depth: %lld", p__, 1ULL << d__); \ + assertx (p__ < (UINT64_C(1) << d__), \ + "prefix: %"PRIx64"; depth: %"PRId64, \ + p__, UINT64_C (1) << d__); \ VG_ADDR (vg_addr_prefix ((a__)) \ | ((p__) << (VG_ADDR_BITS - vg_addr_depth ((a__)) - (d__))), \ vg_addr_depth ((a__)) + (d__)); \ @@ -130,7 +133,8 @@ vg_addr_chop (vg_addr_t addr, int depth) int d = vg_addr_depth (addr) - depth; assert (d >= 0); - return VG_ADDR (vg_addr_prefix (addr) & ~((1ULL << (VG_ADDR_BITS - d)) - 1), + return VG_ADDR (vg_addr_prefix (addr) + & ~((UINT64_C (1) << (VG_ADDR_BITS - d)) - 1), d); } @@ -141,7 +145,7 @@ vg_addr_extract (vg_addr_t addr, int width) assert (width <= vg_addr_depth (addr)); return (vg_addr_prefix (addr) >> (VG_ADDR_BITS - vg_addr_depth (addr))) - & ((1ULL << width) - 1); + & ((UINT64_C (1) << width) - 1); } /* Convert an address to a pointer. The address must name an object diff --git a/libviengoos/viengoos/cap.h b/libviengoos/viengoos/cap.h index 50562d9..026af9e 100644 --- a/libviengoos/viengoos/cap.h +++ b/libviengoos/viengoos/cap.h @@ -29,6 +29,7 @@ #include <hurd/error.h> #include <stdint.h> #include <stdbool.h> +#include <inttypes.h> /* Capabilities. @@ -253,7 +254,7 @@ struct vg_cap_properties /* An OID corresponds to a page on a volume. Only the least 54 bits are significant. */ typedef uint64_t vg_oid_t; -#define VG_OID_FMT "0x%llx" +#define VG_OID_FMT "%"PRIx64 #define VG_OID_PRINTF(__op_oid) ((vg_oid_t) (__op_oid)) #endif @@ -326,13 +327,14 @@ struct vg_cap /* Convenience macros for printing capabilities. */ #ifdef RM_INTERN -#define VG_CAP_FMT "{ " VG_OID_FMT ".%d:%s %llx/%d; %d/%d }" +#define VG_CAP_FMT "{ " VG_OID_FMT ".%d:%s %"PRIx64"/%d; %d/%d }" #define VG_CAP_PRINTF(vg_cap) \ - VG_OID_PRINTF ((vg_cap)->oid), (vg_cap)->version, vg_cap_type_string ((vg_cap)->type), \ + VG_OID_PRINTF ((vg_cap)->oid), (vg_cap)->version, \ + vg_cap_type_string ((vg_cap)->type), \ VG_CAP_GUARD ((vg_cap)), VG_CAP_GUARD_BITS ((vg_cap)), \ VG_CAP_SUBPAGE ((vg_cap)), VG_CAP_SUBPAGES ((vg_cap)) #else -#define VG_CAP_FMT "{ %s %llx/%d; %d/%d }" +#define VG_CAP_FMT "{ %s %"PRIx64"/%d; %d/%d }" #define VG_CAP_PRINTF(vg_cap) \ vg_cap_type_string ((vg_cap)->type), \ VG_CAP_GUARD ((vg_cap)), VG_CAP_GUARD_BITS ((vg_cap)), \ @@ -672,7 +674,7 @@ vg_cap_copy_x (vg_activity_t activity, || gbits != VG_CAP_GUARD_BITS (target)) { debug (5, "Guard changed invalidating translation " - "0x%x/%d -> %llx/%d", + "0x%x/%d -> %"PRIx64"/%d", guard, gbits, VG_CAP_GUARD (target), VG_CAP_GUARD_BITS (target)); changes_translation = true; } diff --git a/libviengoos/viengoos/thread.h b/libviengoos/viengoos/thread.h index dbab8ee..f6b29e8 100644 --- a/libviengoos/viengoos/thread.h +++ b/libviengoos/viengoos/thread.h @@ -26,9 +26,10 @@ typedef l4_thread_id_t vg_thread_id_t; # define VG_THREAD_ID_FMT "%x" # else # include <stdint.h> +# include <inttypes.h> typedef uint64_t vg_thread_id_t; -# define vg_niltid -1 -# define VG_THREAD_ID_FMT "%llx" +# define vg_niltid (UINT64_C (-1)) +# define VG_THREAD_ID_FMT "%"PRIx64 # endif #endif /* !__have_vg_thread_id_t */ |