gd-libgd

committed 3be2f89

Workaround double->int conversion bug in gcc on some architectures (ia64, s390 and powerpc)

src/gd.c

` 			return 0;`
` 		m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */`
` 		/* adjust x0 to be on the left boundary (ie to be zero), and y0 to match */`
`-		*y0 -= m * (*x0 - mindim);`
`+		*y0 -= (int)(m * (*x0 - mindim));`
` 		*x0 = mindim;`
` 		/* now, perhaps, adjust the far end of the line as well */`
` 		if (*x1 > maxdim) {`
` 		if (*x1 > maxdim)		/* as is the end, so the line misses the window */`
` 			return 0;`
` 		m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */`
`-		*y0 += m * (maxdim - *x0);	/* adjust so point is on the right`
`-					   boundary */`
`+		*y0 += (int)(m * (maxdim - *x0));	/* adjust so point is on the right`
`+							   boundary */`
` 		*x0 = maxdim;`
` 		/* now, perhaps, adjust the end of the line */`
` 		if (*x1 < mindim) {`
`-			*y1 -= m * (*x1 - mindim);`
`+			*y1 -= (int)(m * (*x1 - mindim))`
` 			*x1 = mindim;`
` 		}`
` 		return 1;`
` 	if (*x1 > maxdim) {`
` 		/* other end is outside to the right */`
` 		m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */`
`-		*y1 += m * (maxdim - *x1);`
`+		*y1 += (int)(m * (maxdim - *x1));`
` 		*x1 = maxdim;`
` 		return 1;`
` 	}`
` 	if (*x1 < mindim) {`
` 		/* other end is outside to the left */`
` 		m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */`
`-		*y1 -= m * (*x1 - mindim);`
`+		*y1 -= (int)(m * (*x1 - mindim));`
` 		*x1 = mindim;`
` 		return 1;`
` 	}`
` 	BLEND_COLOR(t, dr, r, dr);`
` 	BLEND_COLOR(t, dg, g, dg);`
` 	BLEND_COLOR(t, db, b, db);`
`-	im->tpixels[y][x] = gdTrueColorAlpha(dr, dg, db,  gdAlphaOpaque);`
`+	im->tpixels[y][x] = gdTrueColorAlpha(dr, dg, db, gdAlphaOpaque);`
` }`
` `
` static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)`
` 		/* TBB: set the last pixel for consistency (<=) */`
` 		while ((x >> 16) <= x2) {`
` 			gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF);`
`-			gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF);`
`+			gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1, col, (~y >> 8) & 0xFF);`
` 			x += (1 << 16);`
` 			y += inc;`
` 		}`
` 		y = y1 << 16;`
` 		inc = (dx * 65536) / dy;`
` 		/* TBB: set the last pixel for consistency (<=) */`
`-		while ((y>>16) <= y2) {`
`+		while ((y >> 16) <= y2) {`
` 			gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF);`
`-			gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF);`
`+			gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16), col, (~x >> 8) & 0xFF);`
` 			x += inc;`
`-			y += (1<<16);`
`+			y += (1 << 16);`
` 		}`
` 	}`
` }`
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.