From 09ae6adb17f6491875090b20a657d8a395a4b28c Mon Sep 17 00:00:00 2001 From: Christopher Hoover Date: Mon, 10 Aug 2026 21:32:45 -0700 Subject: [PATCH] fix: update examples to the one-parameter nec_geometry_complete nec_geometry_complete() dropped its unused second parameter (CHANGELOG, "nec_geometry_complete() now takes only one parameter"), but the C and Ruby examples were not updated with it. example/test_nec.c does not compile against the shipped libnecpp.h: error: too many arguments to function 'nec_geometry_complete' 24 | NEC_ERROR_HANDLE(nec_geometry_complete(nec, 1, 0)); libnecpp.h:201: note: declared here 201 | long nec_geometry_complete(nec_context* in_context, int gpflag); Three call sites in test_nec.c and one in test.rb. The Python examples and the test harness were already updated. With this, test_nec.c builds clean under -Wall and runs: the seven-wire antenna reports Z = 595.415366 - j354.438287 and 6.328267 dB max gain. --- example/test.rb | 2 +- example/test_nec.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/test.rb b/example/test.rb index 6c2e1783..701c84a1 100644 --- a/example/test.rb +++ b/example/test.rb @@ -22,7 +22,7 @@ def frequency_response for f in (1..30) do nec = Necpp.nec_create Necpp.nec_wire(nec, 1, 17, 0, 0, 2, 0, 0, 11, 0.1, 1, 1); - Necpp.nec_geometry_complete(nec, 1, 0); + Necpp.nec_geometry_complete(nec, 1); Necpp.nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); Necpp.nec_fr_card(nec, 0, 1, f, 0); Necpp.nec_ex_card(nec, 0, 0, 5, 0, 1.0, 0, 0, 0, 0, 0); diff --git a/example/test_nec.c b/example/test_nec.c index f4d16c0c..1d5297a7 100644 --- a/example/test_nec.c +++ b/example/test_nec.c @@ -21,7 +21,7 @@ void seven_wire_antenna() { /* NEC_ERROR_HANDLE(nec_wire(nec, 5, 7, -0.0318, 0.0439, 0.014, -0.0318, 0.0045, 0.0624, 0.001, 1.0, 1.0));*/ NEC_ERROR_HANDLE(nec_wire(nec, 6, 5, -0.0318, 0.0045, 0.0624, -0.0106, 0.0378, 0.0866, 0.001, 1.0, 1.0)); NEC_ERROR_HANDLE(nec_wire(nec, 7, 7, -0.0106, 0.0378, 0.0866, -0.0106, 0.0257, 0.023, 0.001, 1.0, 1.0)); - NEC_ERROR_HANDLE(nec_geometry_complete(nec, 1, 0)); + NEC_ERROR_HANDLE(nec_geometry_complete(nec, 1)); NEC_ERROR_HANDLE(nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0)); NEC_ERROR_HANDLE(nec_fr_card(nec, 0, 1, 1600.0, 0.0)); NEC_ERROR_HANDLE(nec_ex_card(nec, 0, 1, 1, 0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0)); @@ -48,7 +48,7 @@ void simple_example() { nec = nec_create(); nec_wire(nec, 0, 9, 0, 0, 2, 0, 0, 7, 0.1, 1, 1); - nec_geometry_complete(nec, 1, 0); + nec_geometry_complete(nec, 1); nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); nec_fr_card(nec, 0, 1, 30, 0); nec_ex_card(nec, 0, 0, 5, 0, 1.0, 0, 0, 0, 0, 0); @@ -87,7 +87,7 @@ void example3() { nec = nec_create(); nec_wire(nec, 0, 9, 0., 0.0, 2.0, 0.0, 0.0, 7.0, 0.03, 1.0, 1.0); - nec_geometry_complete(nec, 1, 0); + nec_geometry_complete(nec, 1); nec_ek_card(nec, 0); nec_fr_card(nec, 0, 1, 30., 0 ); nec_ex_card(nec, 0, 0, 5, 0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0);