That is a standard warning, not an error, and not related to const or var. While width may be a multiple of 32, the compiler cannot know that. It could be any valid number, as far as it's concerned. In your case, it's not a problem, if you're sure the number is always an even multiple of 32. I think you can suppress the warning, if it bothers you.
#warning-ignore:integer_division
hframes = get_texture().get_width()/32