Mercurial > vim
diff src/if_mzsch.c @ 33531:1a769647d661
patch 9.0.2013: confusing ifdefs in if_<lang>.c
Commit: https://github.com/vim/vim/commit/c97b3febc82c1ccacf5f328ed0bd81c8b850e97d
Author: Ken Takata <kentkt@csc.jp>
Date: Wed Oct 11 21:27:06 2023 +0200
patch 9.0.2013: confusing ifdefs in if_<lang>.c
Problem: confusing ifdefs in if_<lang>.c
Solution: refactor ifndefs to #ifdefs
if_x: Avoid using #ifndef - #else - #endif
Using #ifndef - #else - #endif is sometimes confusing.
Use #ifdef - #else - #endif instead.
closes: #13310
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 11 Oct 2023 21:30:11 +0200 |
parents | 04d9dff67d99 |
children | 7062d2a09d31 |
line wrap: on
line diff
--- a/src/if_mzsch.c +++ b/src/if_mzsch.c @@ -1366,10 +1366,10 @@ mzscheme_buffer_free(buf_T *buf) bp = BUFFER_REF(buf); bp->buf = INVALID_BUFFER_VALUE; -#ifndef MZ_PRECISE_GC +#ifdef MZ_PRECISE_GC + scheme_free_immobile_box(buf->b_mzscheme_ref); +#else scheme_gc_ptr_ok(bp); -#else - scheme_free_immobile_box(buf->b_mzscheme_ref); #endif buf->b_mzscheme_ref = NULL; MZ_GC_CHECK(); @@ -1391,10 +1391,10 @@ mzscheme_window_free(win_T *win) MZ_GC_REG(); wp = WINDOW_REF(win); wp->win = INVALID_WINDOW_VALUE; -#ifndef MZ_PRECISE_GC +#ifdef MZ_PRECISE_GC + scheme_free_immobile_box(win->w_mzscheme_ref); +#else scheme_gc_ptr_ok(wp); -#else - scheme_free_immobile_box(win->w_mzscheme_ref); #endif win->w_mzscheme_ref = NULL; MZ_GC_CHECK(); @@ -1921,10 +1921,10 @@ window_new(win_T *win) MZ_GC_REG(); self = scheme_malloc_fail_ok(scheme_malloc_tagged, sizeof(vim_mz_window)); CLEAR_POINTER(self); -#ifndef MZ_PRECISE_GC +#ifdef MZ_PRECISE_GC + win->w_mzscheme_ref = scheme_malloc_immobile_box(NULL); +#else scheme_dont_gc_ptr(self); // because win isn't visible to GC -#else - win->w_mzscheme_ref = scheme_malloc_immobile_box(NULL); #endif MZ_GC_CHECK(); WINDOW_REF(win) = self; @@ -2305,10 +2305,10 @@ buffer_new(buf_T *buf) MZ_GC_REG(); self = scheme_malloc_fail_ok(scheme_malloc_tagged, sizeof(vim_mz_buffer)); CLEAR_POINTER(self); -#ifndef MZ_PRECISE_GC +#ifdef MZ_PRECISE_GC + buf->b_mzscheme_ref = scheme_malloc_immobile_box(NULL); +#else scheme_dont_gc_ptr(self); // because buf isn't visible to GC -#else - buf->b_mzscheme_ref = scheme_malloc_immobile_box(NULL); #endif MZ_GC_CHECK(); BUFFER_REF(buf) = self;