]> granicus.if.org Git - php/commitdiff
Fix compiler errors by using NULL_ZSTR where zstr is expected.
authorAndrei Zmievski <andrei@php.net>
Fri, 17 Mar 2006 22:52:55 +0000 (22:52 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 17 Mar 2006 22:52:55 +0000 (22:52 +0000)
# I guess we need to use NULL_ZSTR instead of NULL when passing NULL to
# functions that expect zstr parameter.

ext/spl/spl_directory.c
ext/standard/file.c
ext/standard/image.c
main/streams/streams.c
sapi/cli/php_cli.c

index 7b13b4c582745f40927a76fa2526732418132ffc..94cbd1c4c03863e69f4a56794b6de12a64885005 100755 (executable)
@@ -1349,7 +1349,7 @@ static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TS
                return FAILURE;
        }
 
-       buf = php_stream_get_line(intern->u.file.stream, NULL, intern->u.file.max_line_len, &line_len);
+       buf = php_stream_get_line(intern->u.file.stream, NULL_ZSTR, intern->u.file.max_line_len, &line_len);
 
        if (!buf) {
                intern->u.file.current_line = estrdup("");
index 9457aba3790442fa9c2ec04f3cb272c2ac633cc8..c433ef8803e5a81a7e5a732b490d7f7780f20fe5 100644 (file)
@@ -1002,7 +1002,7 @@ PHPAPI PHP_FUNCTION(fgets)
 
        php_stream_from_zval(stream, &zstream);
 
-       buf.v = php_stream_get_line_ex(stream, php_stream_reads_unicode(stream) ? IS_UNICODE : IS_STRING, NULL, 0, length, &retlen);
+       buf.v = php_stream_get_line_ex(stream, php_stream_reads_unicode(stream) ? IS_UNICODE : IS_STRING, NULL_ZSTR, 0, length, &retlen);
        if (!buf.v) {
                RETURN_FALSE;
        }
@@ -1157,7 +1157,7 @@ PHP_FUNCTION(fscanf)
        }
 
 
-       buf = php_stream_get_line((php_stream *) what, NULL, 0, &len);
+       buf = php_stream_get_line((php_stream *) what, NULL_ZSTR, 0, &len);
        if (buf == NULL) {
                efree(args);
                RETURN_FALSE;
@@ -1991,7 +1991,7 @@ PHP_FUNCTION(fgetcsv)
        }
 
        if (len < 0) {
-               if ((buf = php_stream_get_line(stream, NULL, 0, &buf_len)) == NULL) {
+               if ((buf = php_stream_get_line(stream, NULL_ZSTR, 0, &buf_len)) == NULL) {
                        RETURN_FALSE;
                }
        } else {
@@ -2088,7 +2088,7 @@ PHP_FUNCTION(fgetcsv)
                                                                memcpy(tptr, line_end, line_end_len);
                                                                tptr += line_end_len;
 
-                                                               if ((new_buf = php_stream_get_line(stream, NULL, 0, &new_len)) == NULL) {
+                                                               if ((new_buf = php_stream_get_line(stream, NULL_ZSTR, 0, &new_len)) == NULL) {
                                                                        /* we've got an unterminated enclosure,
                                                                         * assign all the data from the start of
                                                                         * the enclosure to end of data to the
index 6d0751aea1b1babfdf86d52895d40c783c0d4ee3..d23ad781ec453f3b8143432994bf81454851ffe7 100644 (file)
@@ -1023,7 +1023,7 @@ static int php_get_xbm(php_stream *stream, struct gfxinfo **result TSRMLS_DC)
        if (php_stream_rewind(stream)) {
                return 0;
        }
-       while ((fline=php_stream_gets(stream, NULL, 0)) != NULL) {
+       while ((fline=php_stream_gets(stream, NULL_ZSTR, 0)) != NULL) {
                iname = estrdup(fline); /* simple way to get necessary buffer of required size */
                if (sscanf(fline, "#define %s %d", iname, &value) == 2) {
                        if (!(type = strrchr(iname, '_'))) {
index d3b127495b1283f780300e92f93cf1e84edf6ef5..79ea5a05f8246bae6beed5eb83b3c45651d63d2b 100755 (executable)
@@ -1008,7 +1008,7 @@ PHPAPI void *_php_stream_get_line(php_stream *stream, int buf_type, zstr buf, si
                                UChar *eol;
                                readptr.u = stream->readbuf.u + stream->readpos;
 
-                               eol = php_stream_locate_eol(stream, ZSTR(NULL), 0 TSRMLS_CC);
+                               eol = php_stream_locate_eol(stream, NULL_ZSTR, 0 TSRMLS_CC);
                                if (eol) {
                                        cpysz = eol - readptr.u + 1;
                                        done = 1;
@@ -1027,7 +1027,7 @@ PHPAPI void *_php_stream_get_line(php_stream *stream, int buf_type, zstr buf, si
                        } else {
                                char *eol;
                                readptr.s = stream->readbuf.s + stream->readpos;
-                               eol = php_stream_locate_eol(stream, ZSTR(NULL), 0 TSRMLS_CC);
+                               eol = php_stream_locate_eol(stream, NULL_ZSTR, 0 TSRMLS_CC);
                                if (eol) {
                                        cpysz = eol - readptr.s + 1;
                                        done = 1;
@@ -1337,7 +1337,7 @@ PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC)
        int ret = 0;
 
        if (stream->writefilters.head) {
-               _php_stream_write_filtered(stream, IS_STRING, ZSTR(NULL), 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC  TSRMLS_CC);
+               _php_stream_write_filtered(stream, IS_STRING, NULL_ZSTR, 0, closing ? PSFS_FLAG_FLUSH_CLOSE : PSFS_FLAG_FLUSH_INC  TSRMLS_CC);
        }
 
        if (stream->ops->flush) {
index 864975414caa323ec496e154385ccb36e0d064c3..476d0d6c7934aaffd5d8911744d20c77ba0e9dde 100644 (file)
@@ -1146,7 +1146,7 @@ int main(int argc, char *argv[])
                                Z_LVAL_P(argi) = index;
                                INIT_PZVAL(argi);
                                zend_hash_update(&EG(symbol_table), "argi", sizeof("argi"), &argi, sizeof(zval *), NULL);
-                               while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) {
+                               while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL_ZSTR, 0)) != NULL) {
                                        len = strlen(input);
                                        while (len-- && (input[len]=='\n' || input[len]=='\r')) {
                                                input[len] = '\0';