[haiku-commits] Re: r38135 - haiku/trunk/src/preferences/print

  • From: Michael Pfeiffer <michael.w.pfeiffer@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 16 Aug 2010 16:53:20 +0200

Hi,

Am 16.08.2010 um 11:42 schrieb pulkomandy@xxxxxxxxxxxxxxxxx:

> CID 1555 : Wrong cast type
> 
> @@ -219,7 +219,7 @@
>       float& rightColumnMaximumWidth = fLayoutData.fRightColumnMaximumWidth;
> 
>       for (int32 i = 0; i < CountItems(); i ++) {
> -             PrinterItem* item = dynamic_cast<PrinterItem*>(ItemAt(i));
> +             PrinterItem* item = static_cast<PrinterItem*>(ItemAt(i));

Should this kind of problems better be fixed by asserting that the value is not 
NULL?

Is there a macro available that does that? 
Would be 
  ASSERT(item != NULL);
sufficient?

Bye,
Michael

Other related posts: