← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH 0/2] Remove useless casts

 

On 9/9/19 1:42 PM, Seth Hillbrand wrote:
> On 2019-09-06 18:36, Simon Richter wrote:
>> Hi,
>>
>> I have two patches that remove useless casts. The first covers cases
>> where
>> it is quite obvious that the cast can be removed with no adverse effects,
>> the second contains the cases where that is less clear.
>>
>> In theory, both can be applied and should not cause code changes, but the
>> second needs review to see if something else was originally intended by
>> that code.
>>
>>    Simon
> 
> Hi Simon-
> 
> I'm in favor of cleaning the casts as we code or if there's a specific
> instance where the cast creates a problem (perhaps causing an unneeded
> class instantiation).  The large size of these patches without a clear
> problem they are solving makes me leery that we will introduce a new
> issue and I'd prefer to avoid this if possible.
> 
> Best-
> Seth
> 

I concur unless a cast is redundant in the sense that a function return
or a variable is already the same type as the cast.  In this case I
don't see where there would be any issues.

Wayne


References