- fixed code in wrlib dependant on the order of evaluation.
commite7ce6468fcaf977aa52a0c76ba654faa8fcc3ed3
authordan <dan>
Mon, 6 Nov 2000 04:21:25 +0000 (6 04:21 +0000)
committerdan <dan>
Mon, 6 Nov 2000 04:21:25 +0000 (6 04:21 +0000)
treea7de7e61a533eadaa5737b83ea80d8729176f49f
parentf7b4e85525693355eeb4f48fc82f623805df76e8
- fixed code in wrlib dependant on the order of evaluation.

  code like
    *ptr++ = *ptr++ = *ptr++ = color;
  is wrong, because there is no guarantee that ptr will be incremented
  _between_ the assignment operations. it can be incremented after all
  assignment operations as well. Because of this both of these are valid
  implementations for a compiler:
    a. assign, increment, assign, increment, assign, increment
    b. assign, assign, assign, increment by 3
  In case b. only the first memory location of the 3 will be modified, being
  assigned 3 times the same value, while the other 2 remain unchanged.
  For example egcs-2.91.66 (and possibly gcc-2.95.x too) implement this in
  the second way (like in case b.)
  Also the order in which the assignement is made is undefined (left to right
  or right to left).

this fixed the problem we had with greyscale jpegs showing up in red,
and possibly other problems related to pseudocolor and greyscale displays.
ChangeLog
wrlib/ChangeLog
wrlib/convert.c
wrlib/draw.c
wrlib/jpeg.c
wrlib/view.c