- The last two VC 6 compiler warnings gone. Please test under *nix.
ARG_ENABLE("phar", "enable phar support", "no");
if (PHP_PHAR != "no") {
- EXTENSION("phar", "util.c dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c zip.c");
+ EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c util.c zip.c");
if (PHP_PHAR_SHARED) {
ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_PHAR ");
}
}
/* }}}*/
-#ifdef PHP_WIN32
-static inline void phar_unixify_path_separators(char *path, int path_len) /* {{{ */
-{
- char *s;
-
- /* unixify win paths */
- for (s = path; s - path < path_len; s++) {
- if (*s == '\\') {
- *s = '/';
- }
- }
-}
-/* }}} */
-#endif
-
static void phar_split_extract_list(TSRMLS_D)
{
char *tmp = estrdup(PHAR_GLOBALS->extract_list);
buffer += entry.filename_len;
PHAR_GET_32(buffer, entry.uncompressed_filesize);
PHAR_GET_32(buffer, entry.timestamp);
- if (offset == halt_offset + manifest_len + 4) {
+ if (offset == halt_offset + (int)manifest_len + 4) {
mydata->min_timestamp = entry.timestamp;
mydata->max_timestamp = entry.timestamp;
} else {
BEGIN_EXTERN_C()
#ifdef PHP_WIN32
char *tsrm_strtok_r(char *s, const char *delim, char **last);
+
+static inline void phar_unixify_path_separators(char *path, int path_len)
+{
+ char *s;
+
+ /* unixify win paths */
+ for (s = path; s - path < path_len; s++) {
+ if (*s == '\\') {
+ *s = '/';
+ }
+ }
+}
#endif
void phar_request_initialize(TSRMLS_D);
static zend_class_entry *phar_ce_entry;
#endif
-#ifdef PHP_WIN32
-static inline void phar_unixify_path_separators(char *path, int path_len) /* {{{ */
-{
- char *s;
-
- /* unixify win paths */
- for (s = path; s - path < path_len; s++) {
- if (*s == '\\') {
- *s = '/';
- }
- }
-}
-/* }}} */
-#endif
-
static int phar_get_extract_list(void *pDest, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zval *return_value = va_arg(args, zval*);
}
/* }}} */
-#ifdef PHP_WIN32
-static inline void phar_unixify_path_separators(char *path, int path_len) /* {{{ */
-{
- char *s;
-
- /* unixify win paths */
- for (s = path; s - path < path_len; s++) {
- if (*s == '\\') {
- *s = '/';
- }
- }
-}
-/* }}} */
-#endif
/* adapted from format_octal() in libarchive
*
* Copyright (c) 2003-2007 Tim Kientzle
#include "phar_internal.h"
-#ifdef PHP_WIN32
-static inline void phar_unixify_path_separators(char *path, int path_len) /* {{{ */
-{
- char *s;
-
- /* unixify win paths */
- for (s = path; s - path < path_len; s++) {
- if (*s == '\\') {
- *s = '/';
- }
- }
-}
-/* }}} */
-#endif
-
static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, php_uint16 len TSRMLS_DC)
{
union {
/* set alias */
if (phar->is_explicit_alias) {
entry.fp = php_stream_fopen_tmpfile();
- if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
+ if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
if (error) {
spprintf(error, 0, "unable to set alias in new zip-based phar \"%s\"", phar->fname);
}