]> granicus.if.org Git - php/commitdiff
Fixed compiler warnings.
authorIlia Alshanetsky <iliaa@php.net>
Sun, 31 Aug 2003 20:45:51 +0000 (20:45 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 31 Aug 2003 20:45:51 +0000 (20:45 +0000)
ext/calendar/calendar.c
ext/dio/dio.c
ext/ldap/ldap.c
ext/mssql/php_mssql.c
ext/openssl/openssl.c
ext/sockets/sockets.c
ext/sysvsem/sysvsem.c
ext/sysvshm/sysvshm.c
ext/xmlrpc/xmlrpc-epi-php.c

index bee87059fc61c5bb78926fa33cbd87b7c101a15f..3034a317380e0fd5bfa7bd8671c76318472b5897 100644 (file)
@@ -177,7 +177,7 @@ PHP_FUNCTION(cal_info)
        }
 
        if (cal < 0 || cal >= CAL_NUM_CALS) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %d.", cal);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
                RETURN_FALSE;
        }
 
@@ -215,7 +215,7 @@ PHP_FUNCTION(cal_days_in_month)
        }
 
        if (cal < 0 || cal >= CAL_NUM_CALS) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %d.", cal);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
                RETURN_FALSE;
        }
 
@@ -245,7 +245,7 @@ PHP_FUNCTION(cal_to_jd)
        }
 
        if (cal < 0 || cal >= CAL_NUM_CALS) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %d.", cal);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal);
                RETURN_FALSE;
        }
 
@@ -268,7 +268,7 @@ PHP_FUNCTION(cal_from_jd)
        }
 
        if (cal < 0 || cal >= CAL_NUM_CALS) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %d", cal);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld", cal);
                RETURN_FALSE;
        }
        calendar = &cal_conversion_table[cal];
index 2f1b848874d1e00b29025f05b75004556888d7b9..444400e371115d219a8dbdee512df03704ec8f99 100644 (file)
@@ -157,7 +157,7 @@ PHP_FUNCTION(dio_open)
        }
 
        if (fd == -1) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open file %s with flags %d and permissions %d: %s", file_name, flags, mode, strerror(errno));
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open file %s with flags %ld and permissions %ld: %s", file_name, flags, mode, strerror(errno));
                RETURN_FALSE;
        }
 
@@ -237,7 +237,7 @@ PHP_FUNCTION(dio_truncate)
        ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
 
        if (ftruncate(f->fd, offset) == -1) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %d bytes: %s", f->fd, offset, strerror(errno));
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
                RETURN_FALSE;
        }
 
index 697855a9bfe705ce495cf22ea4e5ab1186c98814..02aa7a162e03c68004f521c10909ec0e7f527b07 100644 (file)
@@ -394,7 +394,7 @@ PHP_FUNCTION(ldap_connect)
 #endif
 
        if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", LDAPG(num_links));
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", LDAPG(num_links));
                RETURN_FALSE;
        }
 
index 559f21c1610e0b82d20281188061618ec44f549c..4d78518ec0357c7d553f9f7f8ad434e60081b8df 100644 (file)
@@ -485,13 +485,13 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                        list_entry new_le;
 
                        if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
-                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", MS_SQL_G(num_links));
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
                                efree(hashed_details);
                                dbfreelogin(mssql.login);
                                RETURN_FALSE;
                        }
                        if (MS_SQL_G(max_persistent) != -1 && MS_SQL_G(num_persistent) >= MS_SQL_G(max_persistent)) {
-                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%d)", MS_SQL_G(num_persistent));
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent));
                                efree(hashed_details);
                                dbfreelogin(mssql.login);
                                RETURN_FALSE;
@@ -606,7 +606,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                        }
                }
                if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", MS_SQL_G(num_links));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
                        efree(hashed_details);
                        RETURN_FALSE;
                }
index 2618379674e08a5fd1172eb358774d741f5b8736..b01e78aea61a0c7adaadc2d32928c1ad21f05887 100644 (file)
@@ -2298,7 +2298,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
                        cipher = EVP_des_ede3_cbc();
                        break;
                default:
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid cipher type `%d'", cipherid);
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid cipher type `%ld'", cipherid);
                        goto clean_exit;
        }
        if (cipher == NULL) {
index ed1dda7bc902c85713091da2ed153ceb8831651a..e1e0418bb67c9c9d5e74b532f2262c66d18c3f72 100644 (file)
@@ -1033,12 +1033,12 @@ PHP_FUNCTION(socket_create)
                && arg1 != AF_INET6
 #endif
                && arg1 != AF_INET) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%d] specified for argument 1, assuming AF_INET", arg1);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%ld] specified for argument 1, assuming AF_INET", arg1);
                arg1 = AF_INET;
        }
 
        if (arg2 > 10) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%d] specified for argument 2, assuming SOCK_STREAM", arg2);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%ld] specified for argument 2, assuming SOCK_STREAM", arg2);
                arg2 = SOCK_STREAM;
        }
        
@@ -1651,12 +1651,12 @@ PHP_FUNCTION(socket_create_pair)
                && domain != AF_INET6
 #endif
                && domain != AF_UNIX) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%d] specified for argument 1, assuming AF_INET", domain);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%ld] specified for argument 1, assuming AF_INET", domain);
                domain = AF_INET;
        }
        
        if (type > 10) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%d] specified for argument 2, assuming SOCK_STREAM", type);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%ld] specified for argument 2, assuming SOCK_STREAM", type);
                type = SOCK_STREAM;
        }
        
index b6f7a502f9a27d21affb49da30f9d6475b74904d..83af9cdaa40db7d3d6323958f66007da831a49ee 100644 (file)
@@ -193,7 +193,7 @@ PHP_FUNCTION(sem_get)
 
        semid = semget(key, 3, perm|IPC_CREAT);
        if (semid == -1) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
                RETURN_FALSE;
        }
 
@@ -225,7 +225,7 @@ PHP_FUNCTION(sem_get)
        sop[2].sem_flg = SEM_UNDO;
        while (semop(semid, sop, 3) == -1) {
                if (errno != EINTR) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
                        break;
                }
        }
@@ -237,7 +237,7 @@ PHP_FUNCTION(sem_get)
        count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL);
 #endif
        if (count == -1) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
        }
 
        /* If we are the only user, then take this opportunity to set the max. */
@@ -248,17 +248,17 @@ PHP_FUNCTION(sem_get)
                union semun semarg;
                semarg.val = max_acquire;
                if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
                }
 #elif defined(SETVAL_WANTS_PTR)
                /* This is correct for Solaris 2.6 which does not have union semun. */
                if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
                }
 #else
                /* This works for i.e. AIX */
                if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
                }
 #endif
        }
@@ -270,7 +270,7 @@ PHP_FUNCTION(sem_get)
        sop[0].sem_flg = SEM_UNDO;
        while (semop(semid, sop, 1) == -1) {
                if (errno != EINTR) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
                        break;
                }
        }
@@ -307,7 +307,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
        ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semphore", php_sysvsem_module.le_sem);
 
        if (!acquire && sem_ptr->count == 0) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %d (key 0x%x) is not currently acquired", Z_LVAL_PP(arg_id), sem_ptr->key);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_PP(arg_id), sem_ptr->key);
                RETURN_FALSE;
        }
 
@@ -317,7 +317,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
 
        while (semop(sem_ptr->semid, &sop, 1) == -1) {
                if (errno != EINTR) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
                        RETURN_FALSE;
                }
        }
@@ -372,7 +372,7 @@ PHP_FUNCTION(sem_remove)
 #else
        if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) {
 #endif
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semphore %d does not (any longer) exist", Z_LVAL_PP(arg_id));
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semphore %ld does not (any longer) exist", Z_LVAL_PP(arg_id));
                RETURN_FALSE;
        }
 
@@ -381,7 +381,7 @@ PHP_FUNCTION(sem_remove)
 #else
        if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) {
 #endif
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for SysV sempphore %d: %s", Z_LVAL_PP(arg_id), strerror(errno));
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_PP(arg_id), strerror(errno));
                RETURN_FALSE;
        }
        
index 9ff88c56aeeb5362016a9e382931799052568183..8422232c101074ada649159f14a83224669a6b13 100644 (file)
@@ -215,7 +215,7 @@ PHP_FUNCTION(shm_remove)
        }
 
        if (shmctl(shm_list_ptr->id, IPC_RMID,NULL) < 0) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %i: %s", shm_list_ptr->key, id, strerror(errno));
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, id, strerror(errno));
                RETURN_FALSE;
        } 
 
@@ -246,7 +246,7 @@ PHP_FUNCTION(shm_put_var)
 
        shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
        if (type != php_sysvshm.le_shm) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
                RETURN_FALSE;
        }
 
@@ -293,7 +293,7 @@ PHP_FUNCTION(shm_get_var)
 
        shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
        if (type != php_sysvshm.le_shm) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
                RETURN_FALSE;
        }
 
@@ -302,7 +302,7 @@ PHP_FUNCTION(shm_get_var)
        shm_varpos = php_check_shm_data((shm_list_ptr->ptr), key);
 
        if (shm_varpos < 0) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %d doesn't exist", key);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %ld doesn't exist", key);
                RETURN_FALSE;
        }
        shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos);
@@ -339,14 +339,14 @@ PHP_FUNCTION(shm_remove_var)
 
        shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
        if (type != php_sysvshm.le_shm) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a SysV shared memory index", id);
                RETURN_FALSE;
        }
 
        shm_varpos = php_check_shm_data((shm_list_ptr->ptr), key);
 
        if (shm_varpos < 0) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %d doesn't exist", key);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %ld doesn't exist", key);
                RETURN_FALSE;
        }
        php_remove_shm_data((shm_list_ptr->ptr), shm_varpos);   
index f5f4e5f9bad8f88a1fd7cea098635df874dff35a..50bc435148b7837a750f2a1b99357244c4615d95 100644 (file)
@@ -921,7 +921,7 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
             else {
                /* could not create description */
                if(err.xml_elem_error.parser_code) {
-                  php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %i, column %i, message: %s] Unable to add introspection data returned from %s()", 
+                  php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to add introspection data returned from %s()", 
                              err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error, Z_STRVAL_PP(php_function));
                }
                else {
@@ -1189,7 +1189,7 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
                } else {
                        /* could not create description */
                        if(err.xml_elem_error.parser_code) {
-                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %i, column %i, message: %s] Unable to create introspection data", 
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to create introspection data", 
                                err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error);
                        } else {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid xml structure. Unable to create introspection data");