Whamcloud - gitweb
Branch b_release_1_6_5
authorjohann <johann>
Fri, 2 May 2008 20:24:28 +0000 (20:24 +0000)
committerjohann <johann>
Fri, 2 May 2008 20:24:28 +0000 (20:24 +0000)
b=15517
i=johann
i=umka

Fix compile warnings on i686.

lnet/autoconf/lustre-lnet.m4
lnet/include/libcfs/linux/kp30.h
lustre/tests/it_test.c

index c016f84..4a47927 100644 (file)
@@ -1058,11 +1058,11 @@ AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
 
 # check userland __u64 type
 AC_DEFUN([LN_U64_LONG_LONG],
-[AC_MSG_CHECKING([check u64 is long long type])
+[AC_MSG_CHECKING([u64 is long long type])
 tmp_flags="$CFLAGS"
 CFLAGS="$CFLAGS -Werror"
 AC_COMPILE_IFELSE([
-       #include <asm/types.h>
+       #include <linux/types.h>
        int main(void) {
                unsigned long long *data1;
                __u64 *data2;
@@ -1075,10 +1075,59 @@ AC_COMPILE_IFELSE([
         AC_DEFINE(HAVE_U64_LONG_LONG, 1,
                   [__u64 is long long type])
 ],[
+       AC_MSG_RESULT([no])
+])
+CFLAGS="$tmp_flags"
+])
+
+# check userland size_t type
+AC_DEFUN([LN_SIZE_T_LONG],
+[AC_MSG_CHECKING([size_t is unsigned long type])
+tmp_flags="$CFLAGS"
+CFLAGS="$CFLAGS -Werror"
+AC_COMPILE_IFELSE([
+       #include <linux/types.h>
+       int main(void) {
+               unsigned long *data1;
+               size_t *data2;
+               
+               data1 = data2;
+               return 0;
+       }
+],[
+       AC_MSG_RESULT([yes])
+        AC_DEFINE(HAVE_SIZE_T_LONG, 1,
+                  [size_t is long type])
+],[
+       AC_MSG_RESULT([no])
 ])
 CFLAGS="$tmp_flags"
 ])
 
+AC_DEFUN([LN_SSIZE_T_LONG],
+[AC_MSG_CHECKING([ssize_t is signed long type])
+tmp_flags="$CFLAGS"
+CFLAGS="$CFLAGS -Werror"
+AC_COMPILE_IFELSE([
+       #include <linux/types.h>
+       int main(void) {
+               long *data1;
+               ssize_t *data2;
+               
+               data1 = data2;
+               return 0;
+       }
+],[
+       AC_MSG_RESULT([yes])
+        AC_DEFINE(HAVE_SSIZE_T_LONG, 1,
+                  [ssize_t is long type])
+],[
+       AC_MSG_RESULT([no])
+])
+CFLAGS="$tmp_flags"
+])
+
+
 # LN_TASKLIST_LOCK
 # 2.6.18 remove tasklist_lock export
 AC_DEFUN([LN_TASKLIST_LOCK],
@@ -1229,6 +1278,8 @@ LN_STRUCT_PAGE_LIST
 LN_STRUCT_SIGHAND
 LN_FUNC_SHOW_TASK
 LN_U64_LONG_LONG
+LN_SSIZE_T_LONG
+LN_SIZE_T_LONG
 # 2.6.18
 LN_TASKLIST_LOCK
 # 2.6.19
index 7de45d6..19355ed 100644 (file)
@@ -346,23 +346,30 @@ extern int  lwt_snapshot (cycles_t *now, int *ncpu, int *total_size,
 # define LPD64 "%Ld"
 # define LPX64 "%#Lx"
 # define LPF64 "L"
-# define LPSZ  "%lu"
-# define LPSSZ "%ld"
 #elif (_LWORDSIZE == 32)
 # define LPU64 "%Lu"
 # define LPD64 "%Ld"
 # define LPX64 "%#Lx"
 # define LPF64 "L"
-# define LPSZ  "%u"
-# define LPSSZ "%d"
 #elif (_LWORDSIZE == 64)
 # define LPU64 "%lu"
 # define LPD64 "%ld"
 # define LPX64 "%#lx"
 # define LPF64 "l"
+#endif
+
+#ifdef HAVE_SIZE_T_LONG
 # define LPSZ  "%lu"
+#else
+# define LPSZ  "%u"
+#endif
+
+#ifdef HAVE_SSIZE_T_LONG
 # define LPSSZ "%ld"
+#else
+# define LPSSZ "%d"
 #endif
+
 #ifndef LPU64
 # error "No word size defined"
 #endif
index da9256d..44c7f6f 100644 (file)
@@ -7,6 +7,7 @@
 #include <time.h>
 #include <sys/time.h>
 
+#include <libcfs/kp30.h>
 #include <../ldlm/interval_tree.c>
 
 #define dprintf(fmt, args...) //printf(fmt, ##args)
@@ -17,7 +18,7 @@
 } while(0)
 
 #define __F(ext)         (ext)->start, (ext)->end
-#define __S              "[%llx:%llx]"
+#define __S              "["LPX64":"LPX64"]"
 
 #define ALIGN_SIZE       4096
 #define ALIGN_MASK       (~(ALIGN_SIZE - 1))