git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11028 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -115,6 +115,17 @@ class AtomVec : protected Pointers {
|
||||
int deform_groupbit;
|
||||
double *h_rate;
|
||||
|
||||
// union data struct for packing 32-bit and 64-bit ints into double bufs
|
||||
// this avoids aliasing issues by having 2 pointers (double,int)
|
||||
// to same buf memory
|
||||
// constructor for 32-bit int prevents compiler
|
||||
// from possibly calling the double constructor when passed an int
|
||||
// copy to a double *buf:
|
||||
// buf[m++] = ubuf(foo).d, where foo is a 32-bit or 64-bit int
|
||||
// copy from a double *buf:
|
||||
// foo = (int) ubuf(buf[m++]).i;, where (int) or (tagint) match foo
|
||||
// the cast prevents compiler warnings about possible truncation
|
||||
|
||||
union ubuf {
|
||||
double d;
|
||||
int64_t i;
|
||||
|
||||
Reference in New Issue
Block a user