Portability improvement (data alignment issues)

This commit is contained in:
Daniel Thayer 2012-11-13 15:48:25 -06:00
parent 48c4487378
commit 10376b13f5

View file

@ -2716,8 +2716,9 @@ function bytestring_to_double%(s: string%): double
return new Val(0.0, TYPE_DOUBLE); return new Val(0.0, TYPE_DOUBLE);
} }
double d = ntohd( *(double *)s->Bytes() ); double d;
return new Val(d, TYPE_DOUBLE); memcpy(&d, s->Bytes(), sizeof(double));
return new Val(ntohd(d), TYPE_DOUBLE);
%} %}
## Converts a reverse pointer name to an address. For example, ## Converts a reverse pointer name to an address. For example,