Forcing int to bool in TPad

Hi ROOTers,

There is a minor issue in the interface of TPad that causes performance warning messages when compiling any program including the TPad header under Visual C++. The issue occurs whenever a bool is assigned to an int, such as in SetGrid, SetGridx, SetGridy, and others. At warning levels above 3, the compiler gives a performance warning that this is a bad idea. I think this is because converting an int to a bool involves multiple operations, as opposed to assigned a int to another data type which should be a fast mov instruction. To convert to a bool, there must at least be a shift right instruction in addition to the mov to insure only a single bit is used.

I don’t see the benefit of taking an integer in these cases anyway and the modification is trivial, so can this interface be changed? If somebody is feeding integers into these bit-setter functions, the conversion will happen in their own code as opposed to in the library code, so I don’t think changing it will break anybody’s program.

Cheers,
Dan

I am afraid we will hit some backward compatibility issues if we do that.