Hi Skippy, On Tuesday 02 April 2013 21:38:45 Skippy VonDrake wrote: > I don't understand some code in handleConvertFromRaw(int argc, char > *argv[]) > (file VBoxManageDisk.cpp, version 4.1.10). > > Specifically: > > Assert(RT_MIN(cbFile / 512 / 16 / 63, 16383) - > (unsigned int)RT_MIN(cbFile / 512 / 16 / 63, 16383) == 0); > > cbFile is of type uint64_t, and I don't understand how this test could > *ever* fail!? > > What am I missing? Sorry if this is a "learning C" question... but I hope > someone will enlighten me as to how that assert could ever fail.
correct, that assertion is always true. I assume the intention of this assertion is to verify that the cast to 'unsigned int' will not chop any bits but the RT_MIN() term will be never bigger than 16383. So let's call this assertion superfluous but it will not cause any harm. And it's disabled in normal (non-debug) builds anyway. Kind regards, Frank -- Dr.-Ing. Frank Mehnert | Software Development Director, VirtualBox ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt, Germany Hauptverwaltung: Riesstr. 25, D-80992 München Registergericht: Amtsgericht München, HRA 95603 Geschäftsführer: Jürgen Kunz Komplementärin: ORACLE Deutschland Verwaltung B.V. Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697 Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ vbox-dev mailing list [email protected] https://www.virtualbox.org/mailman/listinfo/vbox-dev
