Skip to content

Commit 65fcd21

Browse files
committed
MSVC: Fix warning C4244 in zend_get_gc_buffer_use
This PR addresses a compilation warning of the form: warning C4244: '=': conversion from '__int64' to 'int', possible loss of data The expression gc_buffer->cur - gc_buffer->start produces a temporary of type ptrdiff_t, which is then assigned to an int. It causes said compilation warning if these types do not match.
1 parent 8ffedc8 commit 65fcd21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_gc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static zend_always_inline void zend_get_gc_buffer_add_ptr(
152152
static zend_always_inline void zend_get_gc_buffer_use(
153153
zend_get_gc_buffer *gc_buffer, zval **table, int *n) {
154154
*table = gc_buffer->start;
155-
*n = gc_buffer->cur - gc_buffer->start;
155+
*n = (int)(gc_buffer->cur - gc_buffer->start);
156156
}
157157

158158
END_EXTERN_C()

0 commit comments

Comments
 (0)