assert(data != NULL);
if (data->fd >= 0) {
+#ifdef PHP_WIN32
+ int bytes_written = write(data->fd, buf, (unsigned int)count);
+#else
int bytes_written = write(data->fd, buf, count);
+#endif
if (bytes_written < 0) return 0;
return (size_t) bytes_written;
} else {
GetSystemInfo(&info);
gran = info.dwAllocationGranularity;
- loffs = (range->offset / gran) * gran;
- delta = range->offset - loffs;
+ loffs = ((DWORD)range->offset / gran) * gran;
+ delta = (DWORD)range->offset - loffs;
}
data->last_mapped_addr = MapViewOfFile(data->file_mapping, acc, 0, loffs, range->length + delta);
}
#ifdef PHP_WIN32
- if (!php_win32_check_trailing_space(url_from, strlen(url_from))) {
+ if (!php_win32_check_trailing_space(url_from, (int)strlen(url_from))) {
php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to TSRMLS_CC);
return 0;
}
- if (!php_win32_check_trailing_space(url_to, strlen(url_to))) {
+ if (!php_win32_check_trailing_space(url_to, (int)strlen(url_to))) {
php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to TSRMLS_CC);
return 0;
}
/* we look for directory separator from the end of string, thus hopefuly reducing our work load */
char *e;
zend_stat_t sb;
- int dir_len = strlen(dir);
+ int dir_len = (int)strlen(dir);
int offset = 0;
char buf[MAXPATHLEN];
static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
{
#if PHP_WIN32
- int url_len = strlen(url);
+ int url_len = (int)strlen(url);
#endif
if (php_check_open_basedir(url TSRMLS_CC)) {
return 0;
mode_t mode;
int ret = 0;
#if PHP_WIN32
- int url_len = strlen(url);
+ int url_len = (int)strlen(url);
#endif
#if PHP_WIN32
return NULL;
}
- filename_length = strlen(filename);
+ filename_length = (int)strlen(filename);
/* Relative path open */
if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) {
*/
if (zend_is_executing(TSRMLS_C)) {
exec_fname = zend_get_executed_filename(TSRMLS_C);
- exec_fname_length = strlen(exec_fname);
- path_length = strlen(path);
+ exec_fname_length = (int)strlen(exec_fname);
+ path_length = (int)strlen(path);
while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length]));
if ((exec_fname && exec_fname[0] == '[')