diff --git a/rotation.cpp b/rotation.cpp index b86bad7..8c97fc1 100644 --- a/rotation.cpp +++ b/rotation.cpp @@ -195,10 +195,11 @@ struct Image { pvalue_t* pixel = buffer; for (unsigned int i = 0; i < nb_pixels; ++i) { - *(pixel++) = istr.get(); - *(pixel++) = istr.get(); - *(pixel++) = istr.get(); - *(pixel++) = 0; // padding + pixel[0] = istr.get(); + pixel[1] = istr.get(); + pixel[2] = istr.get(); + + pixel += PIXEL_SIZE; } return true; @@ -210,10 +211,11 @@ struct Image { pvalue_t* pixel = buffer; for (unsigned int i = 0; i < nb_pixels; ++i) { - ostr << (char) *(pixel++); - ostr << (char) *(pixel++); - ostr << (char) *(pixel++); - pixel++; // padding + ostr << (char) pixel[0]; + ostr << (char) pixel[1]; + ostr << (char) pixel[2]; + + pixel += PIXEL_SIZE; } return true; @@ -402,10 +404,11 @@ struct TiledImage : public Image { for (unsigned int i = 0; i < width; ++i) { pvalue_t* tile = this->access_pixel(i, j); - *(tile++) = istr.get(); - *(tile++) = istr.get(); - *(tile++) = istr.get(); - *(tile++) = 0; // padding + tile[0] = istr.get(); + tile[1] = istr.get(); + tile[2] = istr.get(); + + tile += PIXEL_SIZE; } this->fill_overlap(); @@ -419,10 +422,11 @@ struct TiledImage : public Image { for (unsigned int i = 0; i < width; ++i) { pvalue_t const* tile = this->access_pixel(i, j); - ostr << (char) *(tile++); - ostr << (char) *(tile++); - ostr << (char) *(tile++); - tile++; // padding + ostr << (char) tile[0]; + ostr << (char) tile[1]; + ostr << (char) tile[2]; + + tile += PIXEL_SIZE; } return true;