From 9d4e27fed9b83fd1c0c3f85cdb561d34de05fef5 Mon Sep 17 00:00:00 2001 From: Peter Moulder Date: Thu, 5 Jun 2008 06:06:34 +0000 Subject: =?UTF-8?q?Fix=20expression=20whose=20behaviour=20is=20undefined?= =?UTF-8?q?=20in=20C++.=20=20N.B.=20This=20=E2=80=9Cfix=E2=80=9D=20involve?= =?UTF-8?q?s=20guessing=20at=20the=20intended=20meaning.=20=20I've=20maile?= =?UTF-8?q?d=20the=20author=20to=20confirm.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (bzr r5809) --- src/display/nr-filter-specularlighting.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/display/nr-filter-specularlighting.cpp b/src/display/nr-filter-specularlighting.cpp index 1c131b4cc..3a14eb78f 100644 --- a/src/display/nr-filter-specularlighting.cpp +++ b/src/display/nr-filter-specularlighting.cpp @@ -108,7 +108,8 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) { data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]); data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_GREEN]); data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_BLUE]); - data_o[j++] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]); + data_o[j] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]); + ++j; } out->empty = FALSE; delete dl; @@ -135,7 +136,8 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) { data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]); data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_GREEN]); data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_BLUE]); - data_o[j++] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]); + data_o[j] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]); + ++j; } out->empty = FALSE; delete pl; @@ -162,7 +164,8 @@ int FilterSpecularLighting::render(FilterSlot &slot, FilterUnits const &units) { data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_RED]); data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_GREEN]); data_o[j++] = CLAMP_D_TO_U8(inter * LC[LIGHT_BLUE]); - data_o[j++] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]); + data_o[j] = MAX(MAX(data_o[j-3], data_o[j-2]), data_o[j-1]); + ++j; } out->empty = FALSE; delete sl; -- cgit v1.2.3