fix strict aliasing warning
authorFrank Mori Hess <fmhess@speakeasy.net>
Sun, 20 Jun 2004 01:45:16 +0000 (01:45 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sun, 20 Jun 2004 01:45:16 +0000 (01:45 +0000)
lib/data.c

index ed1c4c33bc24c798eccf37e3e14b58b768a97bcd..3dbf87527fc87c326280cc2ae93f15c71f7ddd9f 100644 (file)
@@ -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;