Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead macro SET_WHEN_UINT #10326

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

peterzhu2118
Copy link
Member

No description provided.

@nobu
Copy link
Member

nobu commented Mar 22, 2024

I've forgotten to update the code using it.

diff --git a/debug.c b/debug.c
index 755f2753166..453e01a2260 100644
--- a/debug.c
+++ b/debug.c
@@ -219,27 +219,24 @@ ruby_env_debug_option(const char *str, int len, void *arg)
         } \
     } while (0)
 #define SET_WHEN_UINT(name, vals, num, req) \
-    if (NAME_MATCH_VALUE(name)) SET_UINT_LIST(name, vals, num);
+    if (NAME_MATCH_VALUE(name)) { \
+        if (!len) req; \
+        else SET_UINT_LIST(name, vals, num); \
+        return 1; \
+    }
 
     SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr, Qtrue);
     SET_WHEN("core", ruby_enable_coredump, 1);
     SET_WHEN("ci", ruby_on_ci, 1);
-    if (NAME_MATCH_VALUE("rgengc")) {
-        if (!len) ruby_rgengc_debug = 1;
-        else SET_UINT_LIST("rgengc", &ruby_rgengc_debug, 1);
-        return 1;
-    }
+    SET_WHEN_UINT("rgengc", &ruby_rgengc_debug, 1, ruby_rgengc_debug = 1);
 #if defined _WIN32
 # if RUBY_MSVCRT_VERSION >= 80
     SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
 # endif
 #endif
 #if defined _WIN32 || defined __CYGWIN__
-    if (NAME_MATCH_VALUE("codepage")) {
-        if (!len) fprintf(stderr, "missing codepage argument");
-        else SET_UINT_LIST("codepage", ruby_w32_codepage, numberof(ruby_w32_codepage));
-        return 1;
-    }
+    SET_WHEN_UINT("codepage", ruby_w32_codepage, numberof(ruby_w32_codepage),
+                  fprintf(stderr, "missing codepage argument"));
 #endif
     return 0;
 }

Copy link

launchable-app bot commented Mar 22, 2024

Launchable Report

❌ Test session #2748492 failedos: test_opts:--repeat-count:2 test_task:test-alldetails on CI
🔔 no issues ✖️1 test failed ✔️25647 tests passed

Passed test sessions

✅ Test session #2748486 passed os: test_opts: test_task:checkdetails on CI
✅ Test session #2748488 passed os:macos-arm-oss test_opts:--enable-yjit test_task:checkdetails on CI
✅ Test session #2748495 passed os: test_opts:--disable-yjit test_task:checkdetails on CI
✅ Test session #2748497 passed os: test_opts:--enable-shared--enable-load-relative test_task:checkdetails on CI
✅ Test session #2748498 passed os: test_opts:cppflags:-DVM_CHECK_MODE test_task:checkdetails on CI
✅ Test session #2748500 passed os:macos-12 test_opts: test_task:checkdetails on CI
✅ Test session #2748501 passed os:ubuntu-20.04 test_opts: test_task:checkdetails on CI
✅ Test session #2748505 passed os: test_opts: test_task:checkdetails on CI
✅ Test session #2748510 passed os:macos-13 test_opts: test_task:checkdetails on CI
✅ Test session #2748517 passed os:macos-arm-oss test_opts:--enable-yjit:dev test_task:checkdetails on CI
✅ Test session #2748520 passed os:ubuntu-20.04 test_opts:"RUSTC:rustc+1.58.0" test_task:checkdetails on CI
✅ Test session #2748535 passed os:ubuntu-20.04 test_opts:--enable-yjit:dev test_task:checkdetails on CI
✅ Test session #2748566 passed os:ubuntu-20.04 test_opts:--enable-yjit:dev test_task:checkdetails on CI

Build: refs_pull_10326_merge_7e666143b2d6d8a49806ad4e2141c0d4340c4118

@peterzhu2118 peterzhu2118 merged commit 19752cf into ruby:master Mar 26, 2024
98 checks passed
@peterzhu2118 peterzhu2118 deleted the dead-macro-debug branch March 26, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants