Fix WORDS_NEED_ALIGNMENT build

Integer promotion changed short+short into an int, but INTEL_SHORT only
takes short or unsigned short.  Add a cast to force the result back to
short.

Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/56>
This commit is contained in:
Kp 2015-04-04 17:23:47 +00:00
parent add7107cc7
commit df9ce26dfb

View file

@ -238,8 +238,7 @@ static void align_polygon_model_data(polymodel *pm)
}
//write (corrected) chunk for current chunk:
*((short *)(cur_ch.new_base + cur_ch.offset))
= INTEL_SHORT(cur_ch.correction
+ INTEL_SHORT(*((short *)(cur_ch.old_base + cur_ch.offset))));
= INTEL_SHORT(static_cast<short>(cur_ch.correction + GET_INTEL_SHORT(cur_ch.old_base + cur_ch.offset)));
//write (correctly aligned) chunk:
cur_old = old_dest(cur_ch);
cur_new = new_dest(cur_ch);