comparison 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
comparison
equal deleted inserted replaced
33530:17619194b11f 33531:1a769647d661
1364 MZ_GC_VAR_IN_REG(0, bp); 1364 MZ_GC_VAR_IN_REG(0, bp);
1365 MZ_GC_REG(); 1365 MZ_GC_REG();
1366 1366
1367 bp = BUFFER_REF(buf); 1367 bp = BUFFER_REF(buf);
1368 bp->buf = INVALID_BUFFER_VALUE; 1368 bp->buf = INVALID_BUFFER_VALUE;
1369 #ifndef MZ_PRECISE_GC 1369 #ifdef MZ_PRECISE_GC
1370 scheme_free_immobile_box(buf->b_mzscheme_ref);
1371 #else
1370 scheme_gc_ptr_ok(bp); 1372 scheme_gc_ptr_ok(bp);
1371 #else
1372 scheme_free_immobile_box(buf->b_mzscheme_ref);
1373 #endif 1373 #endif
1374 buf->b_mzscheme_ref = NULL; 1374 buf->b_mzscheme_ref = NULL;
1375 MZ_GC_CHECK(); 1375 MZ_GC_CHECK();
1376 MZ_GC_UNREG(); 1376 MZ_GC_UNREG();
1377 } 1377 }
1389 MZ_GC_DECL_REG(1); 1389 MZ_GC_DECL_REG(1);
1390 MZ_GC_VAR_IN_REG(0, wp); 1390 MZ_GC_VAR_IN_REG(0, wp);
1391 MZ_GC_REG(); 1391 MZ_GC_REG();
1392 wp = WINDOW_REF(win); 1392 wp = WINDOW_REF(win);
1393 wp->win = INVALID_WINDOW_VALUE; 1393 wp->win = INVALID_WINDOW_VALUE;
1394 #ifndef MZ_PRECISE_GC 1394 #ifdef MZ_PRECISE_GC
1395 scheme_free_immobile_box(win->w_mzscheme_ref);
1396 #else
1395 scheme_gc_ptr_ok(wp); 1397 scheme_gc_ptr_ok(wp);
1396 #else
1397 scheme_free_immobile_box(win->w_mzscheme_ref);
1398 #endif 1398 #endif
1399 win->w_mzscheme_ref = NULL; 1399 win->w_mzscheme_ref = NULL;
1400 MZ_GC_CHECK(); 1400 MZ_GC_CHECK();
1401 MZ_GC_UNREG(); 1401 MZ_GC_UNREG();
1402 } 1402 }
1919 return (Scheme_Object *)WINDOW_REF(win); 1919 return (Scheme_Object *)WINDOW_REF(win);
1920 1920
1921 MZ_GC_REG(); 1921 MZ_GC_REG();
1922 self = scheme_malloc_fail_ok(scheme_malloc_tagged, sizeof(vim_mz_window)); 1922 self = scheme_malloc_fail_ok(scheme_malloc_tagged, sizeof(vim_mz_window));
1923 CLEAR_POINTER(self); 1923 CLEAR_POINTER(self);
1924 #ifndef MZ_PRECISE_GC 1924 #ifdef MZ_PRECISE_GC
1925 win->w_mzscheme_ref = scheme_malloc_immobile_box(NULL);
1926 #else
1925 scheme_dont_gc_ptr(self); // because win isn't visible to GC 1927 scheme_dont_gc_ptr(self); // because win isn't visible to GC
1926 #else
1927 win->w_mzscheme_ref = scheme_malloc_immobile_box(NULL);
1928 #endif 1928 #endif
1929 MZ_GC_CHECK(); 1929 MZ_GC_CHECK();
1930 WINDOW_REF(win) = self; 1930 WINDOW_REF(win) = self;
1931 MZ_GC_CHECK(); 1931 MZ_GC_CHECK();
1932 self->win = win; 1932 self->win = win;
2303 return (Scheme_Object *)BUFFER_REF(buf); 2303 return (Scheme_Object *)BUFFER_REF(buf);
2304 2304
2305 MZ_GC_REG(); 2305 MZ_GC_REG();
2306 self = scheme_malloc_fail_ok(scheme_malloc_tagged, sizeof(vim_mz_buffer)); 2306 self = scheme_malloc_fail_ok(scheme_malloc_tagged, sizeof(vim_mz_buffer));
2307 CLEAR_POINTER(self); 2307 CLEAR_POINTER(self);
2308 #ifndef MZ_PRECISE_GC 2308 #ifdef MZ_PRECISE_GC
2309 buf->b_mzscheme_ref = scheme_malloc_immobile_box(NULL);
2310 #else
2309 scheme_dont_gc_ptr(self); // because buf isn't visible to GC 2311 scheme_dont_gc_ptr(self); // because buf isn't visible to GC
2310 #else
2311 buf->b_mzscheme_ref = scheme_malloc_immobile_box(NULL);
2312 #endif 2312 #endif
2313 MZ_GC_CHECK(); 2313 MZ_GC_CHECK();
2314 BUFFER_REF(buf) = self; 2314 BUFFER_REF(buf) = self;
2315 MZ_GC_CHECK(); 2315 MZ_GC_CHECK();
2316 self->buf = buf; 2316 self->buf = buf;