[Libreoffice] [patch] binfilter: cleanup and compilation warnings removal.

Pierre-André Jacquod pjacquod at alumni.ethz.ch
Mon Nov 22 12:06:42 PST 2010


>>  - Unused parameters in some methods are triggering compilation
>> warnings. Should I fix them by removing the parameter name ?
> 	Sounds reasonable.
> 	Really though - the binfilter is not the best place to focus cleanups
> (though I appreciate it is fugly old code ;-) Most people will not want
> it (only useful for decade-old binary StarOffice file formats).

Okay, but at compile time, there is really a flow of warning. So I
wanted also to work a bit on it..... That's just cleaning, not really

But when I see:

warning: comparison is always false due to limited range of data type

and the source code is (it starts form line 1573......

           if( n > MAXSTRLEN-1 )
/*N*/      {
/*?*/          DBG_ERRORFILE( "bad string array boundary" );
/*?*/          USHORT nDiff = n - (MAXSTRLEN-1);
/*?*/                 n = MAXSTRLEN-1;
/*?*/                 rStream.Read( c, n );
/*?*/                 rStream.SeekRel( nDiff );
/*N*/      }
/*N*/      else
/*N*/          rStream.Read( c, n );
/*N*/      cStr[ n ] = 0;

would as cleaning be acceptable to change the code to:

/*N*/      rStream.Read( c, n );
/*N*/      cStr[ n ] = 0;

??? I wonder...
If yes, a lot of code can be removed (between 40 and 60 comparisons are
generating this warning). So I would prefer not starting and beeing told
not to touch it afterward.


More information about the LibreOffice mailing list