kalle Fri May 29 00:18:53 2009 UTC
Modified files:
/php-src/ext/gd gd.c
Log:
* Cast long to float in the T1* functions, we don't loose any data here
* Fix min/max redefs
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.416&r2=1.417&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.416 php-src/ext/gd/gd.c:1.417
--- php-src/ext/gd/gd.c:1.416 Thu May 28 20:53:09 2009
+++ php-src/ext/gd/gd.c Fri May 29 00:18:53 2009
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.416 2009/05/28 20:53:09 kalle Exp $ */
+/* $Id: gd.c,v 1.417 2009/05/29 00:18:53 kalle Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -3981,7 +3981,7 @@
if (width) {
extend = T1_GetExtend(*f_ind);
- str_path = T1_GetCharOutline(*f_ind, str[0], size, transform);
+ str_path = T1_GetCharOutline(*f_ind, str[0], (float) size,
transform);
if (!str_path) {
if (T1_errno) {
@@ -3995,15 +3995,15 @@
amount_kern += str[i - 1] == ' ' ? space : 0;
add_width = (int) (amount_kern + width) / extend;
- char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0,
size, transform);
+ char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0,
(float) size, transform);
str_path = T1_ConcatOutlines(str_path, char_path);
- char_path = T1_GetCharOutline(*f_ind, str[i], size,
transform);
+ char_path = T1_GetCharOutline(*f_ind, str[i], (float)
size, transform);
str_path = T1_ConcatOutlines(str_path, char_path);
}
str_img = T1_AAFillOutline(str_path, 0);
} else {
- str_img = T1_AASetString(*f_ind, str, str_len, space,
T1_KERNING, size, transform);
+ str_img = T1_AASetString(*f_ind, str, str_len, space,
T1_KERNING, (float) size, transform);
}
if (T1_errno) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s",
T1_StrError(T1_errno));
@@ -4070,8 +4070,13 @@
ZEND_FETCH_RESOURCE(f_ind, int *, &fnt, -1, "Type 1 font", le_ps_font);
-#define max(a, b) (a > b ? a : b)
-#define min(a, b) (a < b ? a : b)
+#ifndef max
+# define max(a, b) (a > b ? a : b)
+#endif
+#ifndef min
+# define min(a, b) (a < b ? a : b)
+#endif
+
#define new_x(a, b) (int) ((a) * cos_a - (b) * sin_a)
#define new_y(a, b) (int) ((a) * sin_a + (b) * cos_a)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php