]> granicus.if.org Git - php/commitdiff
Fixed compiler warning "cast from pointer to integer of different size"
authorXinchen Hui <laruence@php.net>
Thu, 18 Apr 2013 09:32:46 +0000 (17:32 +0800)
committerXinchen Hui <laruence@php.net>
Thu, 18 Apr 2013 09:32:46 +0000 (17:32 +0800)
ext/opcache/shared_alloc_shm.c
ext/opcache/zend_shared_alloc.c

index d2b842304b545df7fe150b7762e82dfa3bd2ce10..d53236b3b028f868feabffa2f86a27622c575af1 100644 (file)
@@ -111,7 +111,7 @@ static int create_segments(size_t requested_size, zend_shared_segment_shm ***sha
                }
 
                shared_segments[i].common.p = shmat(shared_segments[i].shm_id, NULL, 0);
-               if (((int) shared_segments[i].common.p) == -1) {
+               if (shared_segments[i].common.p == (void *)-1) {
                        *error_in = "shmat";
                        shmctl(shared_segments[i].shm_id, IPC_RMID, &sds);
                        return ALLOC_FAILURE;
index ebfdea276d71958b2ae39aaf6b9f4ef23965401c..5405751ac3ade123882876fdb8b52d4de793bd44 100644 (file)
@@ -137,7 +137,7 @@ static int zend_shared_alloc_try(const zend_shared_memory_handler_entry *he, int
                int i;
                /* cleanup */
                for (i = 0; i < *shared_segments_count; i++) {
-                       if ((*shared_segments_p)[i]->p && (int)(*shared_segments_p)[i]->p != -1) {
+                       if ((*shared_segments_p)[i]->p && (*shared_segments_p)[i]->p != (void *)-1) {
                                S_H(detach_segment)((*shared_segments_p)[i]);
                        }
                }