From 9dd97c647061ebd6507636d4478a2d29fff43533 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sun, 20 Jun 2004 01:45:16 +0000 Subject: [PATCH] fix strict aliasing warning --- lib/data.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/data.c b/lib/data.c index ed1c4c3..3dbf875 100644 --- a/lib/data.c +++ b/lib/data.c @@ -68,15 +68,17 @@ int _comedi_data_write(comedi_t *it,unsigned int subdev,unsigned int chan,unsign trigvar: 0, trigvar1: 0, }; - sampl_t sdata=data; - + sampl_t sdata[2]; + + sdata[0]=data & 0xffff; + sdata[1]=(data >> 16) & 0xffff; chan=CR_PACK(chan,range,aref); cmd.subdev=subdev; if(it->subdevices[subdev].subd_flags & SDF_LSAMPL){ - cmd.data=(sampl_t *)(&data); + cmd.data=sdata; }else{ - cmd.data=&sdata; + cmd.data=sdata; } cmd.chanlist=&chan; -- 2.26.2