bg_al = gdImageAlpha(bg_img, _bg);
for (i = 0; i < aa_steps; i++) {
- rd = bg_rd + (double) (fg_rd - bg_rd) / aa_steps * (i + 1);
- gr = bg_gr + (double) (fg_gr - bg_gr) / aa_steps * (i + 1);
- bl = bg_bl + (double) (fg_bl - bg_bl) / aa_steps * (i + 1);
- al = bg_al + (double) (fg_al - bg_al) / aa_steps * (i + 1);
+ rd = bg_rd + (int) (fg_rd - bg_rd) / aa_steps * (i + 1);
+ gr = bg_gr + (int) (fg_gr - bg_gr) / aa_steps * (i + 1);
+ bl = bg_bl + (int) (fg_bl - bg_bl) / aa_steps * (i + 1);
+ al = bg_al + (int) (fg_al - bg_al) / aa_steps * (i + 1);
aa[i] = gdImageColorResolveAlpha(bg_img, rd, gr, bl, al);
}
for (i = 1; i < str_len; i++) {
amount_kern = (int) T1_GetKerning(*f_ind, str[i - 1], str[i]);
amount_kern += str[i - 1] == ' ' ? space : 0;
- add_width = (int) (amount_kern + width) / extend;
+ add_width = (int) ((amount_kern + width) / extend);
char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0, (float) size, transform);
str_path = T1_ConcatOutlines(str_path, char_path);
zval copyval = **var2;
zval_copy_ctor(©val);
convert_to_double(©val);
- matrix[i][j] = Z_DVAL_PP(var2);
+ matrix[i][j] = (float) Z_DVAL_PP(var2);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have a 3x3 matrix");
RETURN_FALSE;
}
}
}
- RETURN_BOOL(gdImageConvolution(im_src, matrix, div, offset));
+ RETURN_BOOL(gdImageConvolution(im_src, matrix, (float) div, (float) offset));
}
/* }}} */
/* End section: Filters */
if (status != U_ZERO_ERROR) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failure converting savepath to local filesystem encoding, attempting to use utf8");
} else {
- if (newlen >= buflen) {
+ if ((unsigned int)newlen >= buflen) {
newlen = buflen - 1;
newbuf[newlen] = 0;
}
output[1] = '2';
output[2] = 'a';
output[3] = '$';
- output[4] = '0' + count / 10;
+ output[4] = (char) ('0' + count / 10);
output[5] = '0' + count % 10;
output[6] = '$';
int pattern_len;
long flags = 0;
glob_t globbuf;
- unsigned int n;
- int ret;
+ int ret, n;
zend_bool basedir_limit = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|l", &pppattern, &flags) == FAILURE ||
if (!memcmp(p, basic_entities_dec[j].entity, basic_entities_dec[j].entitylen)) {
int e_len = basic_entities_dec[j].entitylen - 1;
- *p++ = basic_entities_dec[j].charcode;
+ *p++ = (char)basic_entities_dec[j].charcode;
memmove(p, p + e_len, (e - p - e_len));
e -= e_len;
goto done;
int jpeg_file_len, iptcdata_len;
FILE *fp;
unsigned int marker;
- unsigned int done = 0, inx;
+ unsigned int done = 0;
+ int inx;
long spool = 0;
unsigned char *spoolbuf=0, *poi=0;
struct stat sb;
case 'i':
case 'I':
- INC_OUTPUTPOS(arg,sizeof(int))
+ INC_OUTPUTPOS((unsigned int) arg, sizeof(int))
break;
case 'l':
break;
case 'f':
- INC_OUTPUTPOS(arg,sizeof(float))
+ INC_OUTPUTPOS((unsigned int) arg, sizeof(float))
break;
case 'd':
- INC_OUTPUTPOS(arg,sizeof(double))
+ INC_OUTPUTPOS((unsigned int) arg, sizeof(double))
break;
case 'X':
/* prepare the timeout value for use */
conv = (php_timeout_ull) (timeout * 1000000.0);
- tv.tv_sec = conv / 1000000;
+ tv.tv_sec = (long) (conv / 1000000);
tv.tv_usec = conv % 1000000;
- if (zerrno) {
+ if (zerrno) {
zval_dtor(zerrno);
ZVAL_LONG(zerrno, 0);
}
/* prepare the timeout value for use */
conv = (php_timeout_ull) (timeout * 1000000.0);
- tv.tv_sec = conv / 1000000;
+ tv.tv_sec = (long) (conv / 1000000);
tv.tv_usec = conv % 1000000;
if (zpeername) {
PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case)
{
unsigned char ca, cb;
- int ai, bi;
+ unsigned int ai, bi;
int fractional, result;
ai = bi = 0;
UChar const *ap, *bp;
int fractional, result;
int a_off, b_off;
- int a_curr, b_curr;
+ unsigned int a_curr, b_curr;
if (a_len == 0 || b_len == 0)
return a_len - b_len;
}
}
- if (PG(upload_max_filesize) > 0 && (total_bytes+blen) > PG(upload_max_filesize)) {
+ if (PG(upload_max_filesize) > 0 && (int)(total_bytes+blen) > PG(upload_max_filesize)) {
#if DEBUG_FILE_UPLOAD
sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename);
#endif
cancel_upload = UPLOAD_ERROR_A;
- } else if (max_file_size && ((total_bytes+blen) > max_file_size)) {
+ } else if (max_file_size && ((int)(total_bytes+blen) > max_file_size)) {
#if DEBUG_FILE_UPLOAD
sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
#endif
PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */
{
- int cc;
+ unsigned int cc;
va_list ap;
va_start(ap, format);
PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */
{
- int cc;
+ unsigned int cc;
strx_printv(&cc, buf, len, format, ap);
if (cc >= len) {
php_stream_bucket_append(brig_inp, bucket TSRMLS_CC);
status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL TSRMLS_CC);
- if (stream->readpos + consumed > stream->writepos || consumed < 0) {
+ if ((int) (stream->readpos + consumed) > stream->writepos || consumed < 0) {
/* No behaving filter should cause this. */
status = PSFS_ERR_FATAL;
}
php_stream_bucket_convert_notranscode(bucket, stream->readbuf_type);
}
- /* Grow buffer to hold this bucket if need be.
- TODO: See warning in main/stream/streams.c::php_stream_fill_read_buffer */
- if (stream->readbuflen - stream->writepos < bucket->buflen) {
+ /* Grow buffer to hold this bucket if need be */
+ if (stream->readbuflen - stream->writepos < (unsigned int)bucket->buflen) {
stream->readbuflen += bucket->buflen;
stream->readbuf.v = perealloc(stream->readbuf.v, PS_ULEN(stream->readbuf_type == IS_UNICODE, stream->readbuflen), stream->is_persistent);
}
if (chain == &(stream->readfilters)) {
/* Dump any newly flushed data to the read buffer */
- if (stream->readpos > stream->chunk_size) {
+ if ((unsigned int)stream->readpos > stream->chunk_size) {
/* Back the buffer up */
memcpy(stream->readbuf.s, stream->readbuf.s + PS_ULEN(stream->readbuf_type == IS_UNICODE, stream->readpos), PS_ULEN(stream->readbuf_type == IS_UNICODE, stream->writepos - stream->readpos));
stream->writepos -= stream->readpos;
/* avoid problems if someone mis-uses the stream */
if (count == sizeof(php_stream_dirent) && pglob) {
- if (pglob->index < pglob->glob.gl_pathc) {
+ if (pglob->index < (unsigned int) pglob->glob.gl_pathc) {
php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path TSRMLS_CC);
PHP_STRLCPY(ent->d_name, path, sizeof(ent->d_name), strlen(path));
return sizeof(php_stream_dirent);
/* grow buffer to hold this bucket
* TODO: this can fail for persistent streams */
- if (stream->readbuflen - stream->writepos < bucket->buflen) {
+ if (stream->readbuflen - stream->writepos < (unsigned int)bucket->buflen) {
stream->readbuflen += bucket->buflen;
stream->readbuf.v = perealloc(stream->readbuf.v, PS_ULEN(stream->readbuf_type == IS_UNICODE, stream->readbuflen), stream->is_persistent);
}