Explicitly cast to int

This commit is contained in:
Jan Petykiewicz 2018-11-29 01:35:20 -08:00
parent 1de6fb0e39
commit ea5e298023

View File

@ -73,9 +73,9 @@ __global ftype *Hz = H + ZZ;
* the cell x_{+1} == 0 instead, ie. px = -(sx - 1) * dix . * the cell x_{+1} == 0 instead, ie. px = -(sx - 1) * dix .
*/ */
{% for r in 'xyz' %} {% for r in 'xyz' %}
int m{{r}} = -di{{r}}; int m{{r}} = - (int) di{{r}};
int p{{r}} = +di{{r}}; int p{{r}} = + (int) di{{r}};
int wrap_{{r}} = (s{{r}} - 1) * di{{r}}; int wrap_{{r}} = (s{{r}} - 1) * (int) di{{r}};
if ( {{r}} == 0 ) { if ( {{r}} == 0 ) {
m{{r}} = wrap_{{r}}; m{{r}} = wrap_{{r}};
} else if ( {{r}} == s{{r}} - 1 ) { } else if ( {{r}} == s{{r}} - 1 ) {