From 3d3bc28fb48d858bbe6a66ab567a13eeb0b86c40 Mon Sep 17 00:00:00 2001 From: scjody Date: Thu, 29 Mar 2007 21:51:47 +0000 Subject: [PATCH] Branch b1_4 Cleanup compiler warnings on liblustre - patch by nic@cray.com b=11175 r=adilger r=green r=scjody --- lnet/include/libcfs/linux/kp30.h | 16 +++++++++++++--- lnet/include/libcfs/linux/linux-time.h | 4 ++-- lnet/utils/routerstat.c | 2 +- lustrecvs | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lnet/include/libcfs/linux/kp30.h b/lnet/include/libcfs/linux/kp30.h index be2cd34..a1e3b7c 100644 --- a/lnet/include/libcfs/linux/kp30.h +++ b/lnet/include/libcfs/linux/kp30.h @@ -309,7 +309,15 @@ extern int lwt_snapshot (cycles_t *now, int *ncpu, int *total_size, # define LP_POISON ((void *)(long)0x5a5a5a5a) #endif -#if (defined(__x86_64__) && defined(__KERNEL__)) +/* this is a bit chunky */ + +#if defined(__KERNEL__) + #define _LWORDSIZE BITS_PER_LONG +#else + #define _LWORDSIZE __WORDSIZE +#endif + +#if (defined(__x86_64__) && (defined(__KERNEL__) || defined(CRAY_XT3))) /* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */ # define LPU64 "%Lu" # define LPD64 "%Ld" @@ -317,14 +325,14 @@ extern int lwt_snapshot (cycles_t *now, int *ncpu, int *total_size, # define LPF64 "L" # define LPSZ "%lu" # define LPSSZ "%ld" -#elif (BITS_PER_LONG == 32 || __WORDSIZE == 32) +#elif (_LWORDSIZE == 32) # define LPU64 "%Lu" # define LPD64 "%Ld" # define LPX64 "%#Lx" # define LPF64 "L" # define LPSZ "%u" # define LPSSZ "%d" -#elif (BITS_PER_LONG == 64 || __WORDSIZE == 64) +#elif (_LWORDSIZE == 64) # define LPU64 "%lu" # define LPD64 "%ld" # define LPX64 "%#lx" @@ -336,4 +344,6 @@ extern int lwt_snapshot (cycles_t *now, int *ncpu, int *total_size, # error "No word size defined" #endif +#undef _LWORDSIZE + #endif diff --git a/lnet/include/libcfs/linux/linux-time.h b/lnet/include/libcfs/linux/linux-time.h index 7135218..e928387 100644 --- a/lnet/include/libcfs/linux/linux-time.h +++ b/lnet/include/libcfs/linux/linux-time.h @@ -234,7 +234,7 @@ static inline time_t cfs_duration_sec(cfs_duration_t d) static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s) { #if (BITS_PER_LONG == 32) && (HZ > 4096) - uint64_t t; + __u64 t; s->tv_sec = d / HZ; t = (d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION; @@ -248,7 +248,7 @@ static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s) static inline void cfs_duration_nsec(cfs_duration_t d, struct timespec *s) { #if (BITS_PER_LONG == 32) - uint64_t t; + __u64 t; s->tv_sec = d / HZ; t = (d - s->tv_sec * HZ) * ONE_BILLION; diff --git a/lnet/utils/routerstat.c b/lnet/utils/routerstat.c index febe89a..0b4e513 100644 --- a/lnet/utils/routerstat.c +++ b/lnet/utils/routerstat.c @@ -78,7 +78,7 @@ do_stat (int fd) } buffer[n] = 0; - n = sscanf (buffer, "%u %u %u %u %u %u %u %Lu %Lu %Lu %Lu", + n = sscanf (buffer, "%lu %lu %lu %lu %lu %lu %lu %Lu %Lu %Lu %Lu", &new_counter.msgs_alloc, &new_counter.msgs_max, &new_counter.errors, &new_counter.send_count, &new_counter.recv_count, diff --git a/lustrecvs b/lustrecvs index b0f8088..acf7c95 100755 --- a/lustrecvs +++ b/lustrecvs @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash LC_COLLATE="C" progname="${0##*/}" -- 1.8.3.1