[Mono-dev] libgdiplus-2.8 - no need to go long long

Ralph Leckett rleckett at gmail.com
Mon Oct 11 11:56:00 EDT 2010


In libgdiplus-2.8, the following is dumb:

	unsigned long long int size;

	size = bmi.biWidth;
	size *= 4;
	if (size > G_MAXINT32)
		goto error;

The following is a better way:

	long size;

	size = bmi.biWidth;
	if (size > G_MAXINT32 / 4)
		goto error;
	size *= 4;


More information about the Mono-devel-list mailing list