[DRBD-cvs] drbd by phil; Fixed some types, type casts and added s...
drbd-user@lists.linbit.com
drbd-user@lists.linbit.com
Tue, 17 Feb 2004 10:10:40 +0100 (CET)
DRBD CVS committal
Author : phil
Module : drbd
Dir : drbd/drbd
Modified Files:
Tag: rel-0_7-branch
drbd_compat_wrappers.h drbd_int.h drbd_main.c lru_cache.c
lru_cache.h
Log Message:
Fixed some types, type casts and added some casts. Now it builds without
warnings on Alpha (= pure 64bit Architecture)
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/drbd_compat_wrappers.h,v
retrieving revision 1.1.2.23
retrieving revision 1.1.2.24
diff -u -3 -r1.1.2.23 -r1.1.2.24
--- drbd_compat_wrappers.h 16 Feb 2004 20:39:00 -0000 1.1.2.23
+++ drbd_compat_wrappers.h 17 Feb 2004 09:10:35 -0000 1.1.2.24
@@ -268,9 +268,9 @@
* hm. obviously the tcp stack kmaps internally somewhere.
*/
if (PageHighMem(page))
- offset = (int)bh->b_data;
+ offset = (int)(long)bh->b_data;
else
- offset = (int)bh->b_data - (int)page_address(page);
+ offset = (long)bh->b_data - (long)page_address(page);
return _drbd_send_page(mdev,page,offset,size);
}
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_int.h,v
retrieving revision 1.58.2.126
retrieving revision 1.58.2.127
diff -u -3 -r1.58.2.126 -r1.58.2.127
--- drbd_int.h 16 Feb 2004 20:39:00 -0000 1.58.2.126
+++ drbd_int.h 17 Feb 2004 09:10:35 -0000 1.58.2.127
@@ -203,8 +203,8 @@
})
#endif
-#define SET_MAGIC(x) ((x)->magic = (int)(x) ^ DRBD_MAGIC)
-#define VALID_POINTER(x) ((x) ? (((x)->magic ^ DRBD_MAGIC) == (int)(x)):0)
+#define SET_MAGIC(x) ((x)->magic = (long)(x) ^ DRBD_MAGIC)
+#define VALID_POINTER(x) ((x) ? (((x)->magic ^ DRBD_MAGIC) == (long)(x)):0)
#define INVALIDATE_MAGIC(x) (x->magic--)
#define SET_MDEV_MAGIC(x) \
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_main.c,v
retrieving revision 1.73.2.130
retrieving revision 1.73.2.131
diff -u -3 -r1.73.2.130 -r1.73.2.131
--- drbd_main.c 16 Feb 2004 20:39:00 -0000 1.73.2.130
+++ drbd_main.c 17 Feb 2004 09:10:35 -0000 1.73.2.131
@@ -512,7 +512,7 @@
ok = ( sent == size );
if(!ok) {
ERR("short sent %s size=%d sent=%d\n",
- cmdname(cmd), size, sent);
+ cmdname(cmd), (int)size, sent);
}
C_DBG(5,"on %s >>> %s l: %d\n",
sock == mdev->meta.socket ? "msock" : "sock",
@@ -751,7 +751,8 @@
break;
}
if (sent <= 0) {
- WARN("%s: size=%d len=%d sent=%d\n",__func__,size,len,sent);
+ WARN("%s: size=%d len=%d sent=%d\n",
+ __func__,(int)size,len,sent);
break;
}
len -= sent;
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/lru_cache.c,v
retrieving revision 1.1.2.21
retrieving revision 1.1.2.22
diff -u -3 -r1.1.2.21 -r1.1.2.22
--- lru_cache.c 25 Jan 2004 00:38:09 -0000 1.1.2.21
+++ lru_cache.c 17 Feb 2004 09:10:35 -0000 1.1.2.22
@@ -47,7 +47,7 @@
* struct lru_cache, and the hash table slots.
* returns pointer to a newly initialized lru_cache object with said parameters.
*/
-struct lru_cache* lc_alloc(unsigned int e_count, unsigned int e_size,
+struct lru_cache* lc_alloc(unsigned int e_count, size_t e_size,
void *private_p)
{
unsigned long bytes;
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/lru_cache.h,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -3 -r1.1.2.14 -r1.1.2.15
--- lru_cache.h 12 Jan 2004 09:31:36 -0000 1.1.2.14
+++ lru_cache.h 17 Feb 2004 09:10:35 -0000 1.1.2.15
@@ -84,7 +84,7 @@
#define LC_DIRTY (1<<__LC_DIRTY)
#define LC_STARVING (1<<__LC_STARVING)
-extern struct lru_cache* lc_alloc(unsigned int e_count, unsigned int e_size,
+extern struct lru_cache* lc_alloc(unsigned int e_count, size_t e_size,
void *private_p);
extern void lc_free(struct lru_cache* lc);
extern void lc_set (struct lru_cache* lc, unsigned int enr, int index);