Apache OpenOffice (AOO) Bugzilla – Issue 120179
WaE: sc/source/filter/excel/excform.cxx
Last modified: 2017-05-20 11:27:54 UTC
Current trunk: /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sc/source/filter/excel/excform.cxx: In function ‘sal_Bool lcl_isInMissArgForZeroList(DefTokenId)’: /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sc/source/filter/excel/excform.cxx:1553: warning: comparison between signed and unsigned integer expressions Proposed change: diff -ur sc.orig/source/filter/excel/excform.cxx sc/source/filter/excel/excform.cxx --- sc.orig/source/filter/excel/excform.cxx 2012-07-03 14:41:38.000000000 +0200 +++ sc/source/filter/excel/excform.cxx 2012-07-03 14:42:16.000000000 +0200 @@ -1550,7 +1550,7 @@ sal_Bool lcl_isInMissArgForZeroList(DefTokenId id) { - for(short index = 0; index < missArgForZeroCount; index++) + for(DefTokenId index = 0; index < missArgForZeroCount; index++) if(missArgForZeroList[index] == id) return sal_True; return sal_False;
proposed patch looks fine for me.
Hm, DefTokenId is the type of content of the missArgForZeroList array. It is just a coincidence that it can be used as an array index. It is defined as typedef OpCode DefTokenId; in main/sc/source/filter/inc/qproform.hxx with OpCode defined in main/formula/inc/formula/ as typedef sal_uInt16 OpCode; and in main/binfilter/inc/bf_sc/opcode.hxx as typedef USHORT OpCode; What about this instead (I did not compile it): sal_Bool lcl_isInMissArgForZeroList(DefTokenId id) { const sal_uInt32 nCount (sizeof(missArgForZeroList)/sizeof(DefTokenId)); for (sal_uInt32 nIndex=0; nIndex<nCount; ++nIndex) if(missArgForZeroList[nIndex] == id) return sal_True; return sal_False; } nCount could be static or have a different type (size_t?)
Compiles fine and is clean. Yes.
Pavel, do you want to commit it or shall I?
Please do so. Thanks.
reassign
damn - I have overseen this issue. Andre, as it is your patch will you go ahead and commit it?
Reset assigne to the default "issues@openoffice.apache.org".