Work around compiler warnings for int/ptr casts.
git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@38 53a565d1-3bb7-0310-b661-cf11e63c67ab
This commit is contained in:
parent
bbfc1944cd
commit
d93e0e84c9
|
@ -8,6 +8,8 @@ AC_PROG_CC
|
|||
AM_PROG_LIBTOOL
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_CHECK_SIZEOF(void *, 8)
|
||||
|
||||
# set the libtool so version numbers
|
||||
lt_major=4
|
||||
lt_revision=0
|
||||
|
|
|
@ -27,8 +27,8 @@ static int do_fcp_listen(struct raw1394_handle *handle, int startstop)
|
|||
req->type = RAW1394_REQ_FCP_LISTEN;
|
||||
req->generation = handle->generation;
|
||||
req->misc = startstop;
|
||||
req->tag = (__u64)&rh;
|
||||
req->recvb = (__u64)handle->buffer;
|
||||
req->tag = ptr2int(&rh);
|
||||
req->recvb = ptr2int(handle->buffer);
|
||||
req->length = 512;
|
||||
|
||||
err = write(handle->fd, req, sizeof(*req));
|
||||
|
|
|
@ -28,8 +28,8 @@ static int do_iso_listen(struct raw1394_handle *handle, int channel)
|
|||
req->type = RAW1394_REQ_ISO_LISTEN;
|
||||
req->generation = handle->generation;
|
||||
req->misc = channel;
|
||||
req->tag = (__u64)&rh;
|
||||
req->recvb = (__u64)handle->buffer;
|
||||
req->tag = ptr2int(&rh);
|
||||
req->recvb = ptr2int(handle->buffer);
|
||||
req->length = HBUF_SIZE;
|
||||
|
||||
err = write(handle->fd, req, sizeof(*req));
|
||||
|
|
|
@ -158,7 +158,7 @@ int raw1394_get_port_info(struct raw1394_handle *handle,
|
|||
CLEAR_REQ(req);
|
||||
req->type = RAW1394_REQ_LIST_CARDS;
|
||||
req->generation = handle->generation;
|
||||
req->recvb = (__u64)handle->buffer;
|
||||
req->recvb = ptr2int(handle->buffer);
|
||||
req->length = HBUF_SIZE;
|
||||
|
||||
while (1) {
|
||||
|
|
|
@ -32,4 +32,12 @@ int _raw1394_sync_cb(struct raw1394_handle*, struct sync_cb_data*, int);
|
|||
#define HBUF_SIZE 8192
|
||||
#define CLEAR_REQ(reqp) memset((reqp), 0, sizeof(struct raw1394_request))
|
||||
|
||||
#if SIZEOF_VOID_P == 4
|
||||
#define int2ptr(x) ((void *)(__u32)x)
|
||||
#define ptr2int(x) ((__u64)(__u32)x)
|
||||
#else
|
||||
#define int2ptr(x) ((void *)x)
|
||||
#define ptr2int(x) ((__u64)x)
|
||||
#endif
|
||||
|
||||
#endif /* _RAW1394_PRIVATE_H */
|
||||
|
|
|
@ -31,7 +31,7 @@ int raw1394_start_read(struct raw1394_handle *handle, nodeid_t node,
|
|||
|
||||
req->address = ((__u64)node << 48) | addr;
|
||||
req->length = length;
|
||||
req->recvb = (__u64)buffer;
|
||||
req->recvb = ptr2int(buffer);
|
||||
|
||||
return (int)write(handle->fd, req, sizeof(*req));
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ int raw1394_start_write(struct raw1394_handle *handle, nodeid_t node,
|
|||
|
||||
req->address = ((__u64)node << 48) | addr;
|
||||
req->length = length;
|
||||
req->sendb = (__u64)data;
|
||||
req->sendb = ptr2int(data);
|
||||
|
||||
return (int)write(handle->fd, req, sizeof(*req));
|
||||
}
|
||||
|
@ -74,8 +74,8 @@ int raw1394_start_lock(struct raw1394_handle *handle, nodeid_t node,
|
|||
req->tag = tag;
|
||||
|
||||
req->address = ((__u64)node << 48) | addr;
|
||||
req->sendb = (__u64)sendbuf;
|
||||
req->recvb = (__u64)result;
|
||||
req->sendb = ptr2int(sendbuf);
|
||||
req->recvb = ptr2int(result);
|
||||
req->misc = extcode;
|
||||
|
||||
switch (extcode) {
|
||||
|
@ -110,7 +110,7 @@ int raw1394_start_iso_write(struct raw1394_handle *handle, unsigned int channel,
|
|||
req->address = ((__u64)channel << 48) | speed;
|
||||
req->misc = (tag << 16) | sy;
|
||||
req->length = length;
|
||||
req->sendb = data;
|
||||
req->sendb = ptr2int(data);
|
||||
|
||||
return (int)write(handle->fd, req, sizeof(*req));
|
||||
}
|
||||
|
|
Reference in New Issue