Issue 97538 - psprint: ambiguous && ||
Summary: psprint: ambiguous && ||
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: DEV300m37
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: caolanm
QA Contact: issues@gsl
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-12-23 17:02 UTC by caolanm
Modified: 2009-02-24 14:59 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
keep things as they are, except silence warning (1.04 KB, patch)
2008-12-23 17:02 UTC, caolanm
no flags Details | Diff
change logic, but might be what was originally intended (1.04 KB, patch)
2008-12-23 17:03 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-12-23 17:02:26 UTC
In psprint/source/fontsubset/gsub.cxx (this code also appears in vcl as well)
there is some unbracketed && || which looks dodgy
i.e.

if( (aFeatureIndexList[0] != nFeatureIndex)
   &&  (!std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag))
   ||  (!std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(),
nFeatureIndex) ) )

patch 1 make the implicit logic explicit, i.e. keeps things as they are, while
patch 2 changes the logic to be what *might* have been meant. I can't really
tell which is the correct one :-)
Comment 1 caolanm 2008-12-23 17:02:51 UTC
Created attachment 58986 [details]
keep things as they are, except silence warning
Comment 2 caolanm 2008-12-23 17:03:42 UTC
Created attachment 58987 [details]
change logic, but might be what was originally intended
Comment 3 philipp.lohmann 2009-01-06 10:10:36 UTC
pl->hdu: gsub.cxx is your baby, yes ?
Comment 4 hdu@apache.org 2009-01-06 11:55:51 UTC
Clarified the code to get rid of the warning in CWS vcl98. Also fixed the corresponding warning in 
vcl/source/glyphs/gcach_ftyp.cxx. Ceterum censeo psprint+vcl belong into one module.
Comment 5 hdu@apache.org 2009-01-16 12:09:07 UTC
@cmc or @pl: please verify in CWS vcl98 (cws/vcl98/psprint/source/fontsubset 265911 and 
cws/vcl98/vcl/source/glyphs 265912)
Comment 6 philipp.lohmann 2009-01-16 13:17:06 UTC
please verify in CWS vcl98
Comment 7 caolanm 2009-01-16 14:10:57 UTC
verified, looks ok to me
Comment 8 caolanm 2009-02-24 14:59:09 UTC
seen DEV300m42, OOO310_m1