]> granicus.if.org Git - php/commitdiff
fix compiler warning
authorMarcus Boerger <helly@php.net>
Thu, 24 Oct 2002 19:15:40 +0000 (19:15 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 24 Oct 2002 19:15:40 +0000 (19:15 +0000)
ext/dbx/dbx_odbc.c
ext/mbstring/mbstring.c
ext/mysql/libmysql/string.c
ext/pcre/php_pcre.c
ext/pgsql/pgsql.c
ext/standard/math.c
ext/standard/string.c

index 40f282b2bc9f3c4be2e71d60bbd58c57abe5a9cb..01a0a82aecfe1035d420d587bb8dff90c76b54a3 100644 (file)
@@ -72,7 +72,6 @@ int dbx_odbc_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
        int number_of_arguments=1;
        zval **arguments[1];
        zval *returned_zval=NULL;
-       int exit_status=EG(exit_status);
 
        int actual_resource_type;
        void *resource;
index d44d51cd75de2a94497a126d76962a295deb6163..5a2a6109e86fe8b32aa93f8879546381de7bb755 100644 (file)
@@ -3475,7 +3475,7 @@ PHPAPI size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC)
 PHPAPI char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc)
 {
        register const char *p = s;
-       char *last;
+       char *last=NULL;
 
        if (nbytes == (size_t)-1) {
                while (*p != '\0') {
index cbf9f2ddc394569795c5d313a4abd042a8cb438d..5de6428242bfead491bd1a469dd3355b2bce6344 100644 (file)
@@ -37,7 +37,7 @@ my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
 
 my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str)
 {
-  uint length;
+  uint length=0;
   DBUG_ENTER("dynstr_set");
 
   if (init_str && (length= (uint) strlen(init_str)+1) > str->max_length)
index 084dd4958fcb185fa857270e387f19267f036495..e3489415bd3c19b37283f3911c98ad664dc60462 100644 (file)
@@ -753,16 +753,16 @@ PHPAPI char *php_pcre_replace(char *regex,   int regex_len,
        int                              backref;                       /* Backreference number */
        int                              eval;                          /* If the replacement string should be eval'ed */
        int                              start_offset;          /* Where the new search starts */
-       int                              g_notempty = 0;        /* If the match should not be empty */
-       int                              replace_len;           /* Length of replacement string */
+       int                              g_notempty=0;          /* If the match should not be empty */
+       int                              replace_len=0;         /* Length of replacement string */
        char                    *result,                        /* Result of replacement */
-                                       *replace,                       /* Replacement string */
+                                       *replace=NULL,          /* Replacement string */
                                        *new_buf,                       /* Temporary buffer for re-allocation */
                                        *walkbuf,                       /* Location of current replacement in the result */
                                        *walk,                          /* Used to walk the replacement string */
                                        *match,                         /* The current match */
                                        *piece,                         /* The current piece of subject */
-                                       *replace_end,           /* End of replacement string */
+                                       *replace_end=NULL,      /* End of replacement string */
                                        *eval_result,           /* Result of eval or custom function */
                                         walk_last;                     /* Last walked character */
 
index a4d437382ced8359af03266354f0f38aeea18b4b..70aa5302299a2537bba07383d177b22c65d17e40 100644 (file)
@@ -3048,7 +3048,7 @@ PHP_FUNCTION(pg_get_notify)
 PHP_FUNCTION(pg_get_pid)
 {
        zval *pgsql_link;
-       int id = -1, pid;
+       int id = -1;
        PGconn *pgsql;
 
        if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
index 219a269d249a84408a86a9167133cd349eb1ebac..dafaf057883ddf99e582dee1291ac58be4a8a73f 100644 (file)
@@ -677,7 +677,7 @@ _php_math_basetolong(zval *arg, int base) {
 PHPAPI int
 _php_math_basetozval(zval *arg, int base, zval *ret) {
        long num = 0;
-       double fnum;
+       double fnum = 0;
        int i;
        int mode = 0;
        char c, *s;
index 0c4a09c5ed4c5b6257f52ced2dc77d1c4e0df600..588943ebe4909fa00fb1e89bfd4cb536a39ffa56 100644 (file)
@@ -915,6 +915,7 @@ PHP_FUNCTION(strtok)
        case 1:
                tok = args[0];
                break;
+       default:
        case 2:
                str = args[0];
                tok = args[1];
@@ -1198,7 +1199,7 @@ PHP_FUNCTION(dirname)
 PHP_FUNCTION(pathinfo)
 {
        zval *tmp;
-       char *path, *ret;
+       char *path, *ret = NULL;
        int path_len;
        int opt = PHP_PATHINFO_ALL;
 
@@ -3182,6 +3183,7 @@ PHP_FUNCTION(setlocale)
 
        if (Z_TYPE_PP(args[1]) == IS_ARRAY) {
                zend_hash_internal_pointer_reset(Z_ARRVAL_PP(args[1]));
+               i=0; /* not needed in this case: only kill a compiler warning */
        } else {
                i=1;
        }