[S] Change in libosmocore[master]: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email ) Change subject: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/ .. gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/ Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Related: OS#5500 --- M include/osmocom/gsm/gsm0502.h M tests/gsm0502/gsm0502_test.c 2 files changed, 24 insertions(+), 14 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/include/osmocom/gsm/gsm0502.h b/include/osmocom/gsm/gsm0502.h index 6624e70..0ac1387 100644 --- a/include/osmocom/gsm/gsm0502.h +++ b/include/osmocom/gsm/gsm0502.h @@ -70,7 +70,7 @@ * \returns similarly to memcmp(), -1 if fn1 goes before fn2; * 0 if fn1 equals fn2; * 1 if fn1 goes after fn2. */ -static inline int gsm0502_fn_compare(uint32_t fn1, uint32_t fn2) +static inline int gsm0502_fncmp(uint32_t fn1, uint32_t fn2) { const uint32_t thresh = GSM_TDMA_HYPERFRAME / 2; diff --git a/tests/gsm0502/gsm0502_test.c b/tests/gsm0502/gsm0502_test.c index d78a94d..7768abb 100644 --- a/tests/gsm0502/gsm0502_test.c +++ b/tests/gsm0502/gsm0502_test.c @@ -148,28 +148,28 @@ printf("\n"); } -static void test_gsm0502_fn_compare(void) +static void test_gsm0502_fncmp(void) { - OSMO_ASSERT(gsm0502_fn_compare(1337, 1337) == 0); - OSMO_ASSERT(gsm0502_fn_compare(42, 1337)== -1); - OSMO_ASSERT(gsm0502_fn_compare(1337, 42)== 1); - OSMO_ASSERT(gsm0502_fn_compare(42, 0) == 1); + OSMO_ASSERT(gsm0502_fncmp(1337, 1337) == 0); + OSMO_ASSERT(gsm0502_fncmp(42, 1337) == -1); + OSMO_ASSERT(gsm0502_fncmp(1337, 42) == 1); + OSMO_ASSERT(gsm0502_fncmp(42, 0)== 1); /* 2715642 is very close to the Fn period (GSM_TDMA_HYPERFRAME) */ - OSMO_ASSERT(gsm0502_fn_compare(2715642, 42) == -1); - OSMO_ASSERT(gsm0502_fn_compare(42, 2715642) == 1); - OSMO_ASSERT(gsm0502_fn_compare(0, 2715642) == 1); + OSMO_ASSERT(gsm0502_fncmp(2715642, 42) == -1); + OSMO_ASSERT(gsm0502_fncmp(42, 2715642) == 1); + OSMO_ASSERT(gsm0502_fncmp(0, 2715642) == 1); /* 1357824 is half of the Fn period (GSM_TDMA_HYPERFRAME) */ - OSMO_ASSERT(gsm0502_fn_compare(1357820, 1357824)== -1); - OSMO_ASSERT(gsm0502_fn_compare(1357820, 1357825)== -1); - OSMO_ASSERT(gsm0502_fn_compare(1357824, 1357820)== 1); - OSMO_ASSERT(gsm0502_fn_compare(1357825, 1357820)== 1); + OSMO_ASSERT(gsm0502_fncmp(1357820, 1357824) == -1); + OSMO_ASSERT(gsm0502_fncmp(1357820, 1357825) == -1); + OSMO_ASSERT(gsm0502_fncmp(1357824, 1357820) == 1); + OSMO_ASSERT(gsm0502_fncmp(1357825, 1357820) == 1); } int main(int argc, char **argv) { test_gsm0502_fn_remap(); - test_gsm0502_fn_compare(); + test_gsm0502_fncmp(); return EXIT_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Gerrit-Change-Number: 34527 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-MessageType: merged
[S] Change in libosmocore[master]: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email ) Change subject: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/ .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Gerrit-Change-Number: 34527 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin Gerrit-Attention: fixeria Gerrit-Comment-Date: Tue, 26 Sep 2023 09:45:27 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
[S] Change in libosmocore[master]: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email ) Change subject: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/ .. Patch Set 1: -Code-Review -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Gerrit-Change-Number: 34527 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria Gerrit-Reviewer: pespin Gerrit-CC: Jenkins Builder Gerrit-Attention: fixeria Gerrit-Comment-Date: Tue, 26 Sep 2023 09:43:16 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
[S] Change in libosmocore[master]: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email ) Change subject: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/ .. Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Gerrit-Change-Number: 34527 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria Gerrit-Reviewer: pespin Gerrit-CC: Jenkins Builder Gerrit-Attention: fixeria Gerrit-Comment-Date: Tue, 26 Sep 2023 09:42:48 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
[S] Change in libosmocore[master]: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email ) Change subject: gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/ .. gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/ Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Related: OS#5500 --- M include/osmocom/gsm/gsm0502.h M tests/gsm0502/gsm0502_test.c 2 files changed, 24 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/34527/1 diff --git a/include/osmocom/gsm/gsm0502.h b/include/osmocom/gsm/gsm0502.h index 6624e70..0ac1387 100644 --- a/include/osmocom/gsm/gsm0502.h +++ b/include/osmocom/gsm/gsm0502.h @@ -70,7 +70,7 @@ * \returns similarly to memcmp(), -1 if fn1 goes before fn2; * 0 if fn1 equals fn2; * 1 if fn1 goes after fn2. */ -static inline int gsm0502_fn_compare(uint32_t fn1, uint32_t fn2) +static inline int gsm0502_fncmp(uint32_t fn1, uint32_t fn2) { const uint32_t thresh = GSM_TDMA_HYPERFRAME / 2; diff --git a/tests/gsm0502/gsm0502_test.c b/tests/gsm0502/gsm0502_test.c index d78a94d..7768abb 100644 --- a/tests/gsm0502/gsm0502_test.c +++ b/tests/gsm0502/gsm0502_test.c @@ -148,28 +148,28 @@ printf("\n"); } -static void test_gsm0502_fn_compare(void) +static void test_gsm0502_fncmp(void) { - OSMO_ASSERT(gsm0502_fn_compare(1337, 1337) == 0); - OSMO_ASSERT(gsm0502_fn_compare(42, 1337)== -1); - OSMO_ASSERT(gsm0502_fn_compare(1337, 42)== 1); - OSMO_ASSERT(gsm0502_fn_compare(42, 0) == 1); + OSMO_ASSERT(gsm0502_fncmp(1337, 1337) == 0); + OSMO_ASSERT(gsm0502_fncmp(42, 1337) == -1); + OSMO_ASSERT(gsm0502_fncmp(1337, 42) == 1); + OSMO_ASSERT(gsm0502_fncmp(42, 0)== 1); /* 2715642 is very close to the Fn period (GSM_TDMA_HYPERFRAME) */ - OSMO_ASSERT(gsm0502_fn_compare(2715642, 42) == -1); - OSMO_ASSERT(gsm0502_fn_compare(42, 2715642) == 1); - OSMO_ASSERT(gsm0502_fn_compare(0, 2715642) == 1); + OSMO_ASSERT(gsm0502_fncmp(2715642, 42) == -1); + OSMO_ASSERT(gsm0502_fncmp(42, 2715642) == 1); + OSMO_ASSERT(gsm0502_fncmp(0, 2715642) == 1); /* 1357824 is half of the Fn period (GSM_TDMA_HYPERFRAME) */ - OSMO_ASSERT(gsm0502_fn_compare(1357820, 1357824)== -1); - OSMO_ASSERT(gsm0502_fn_compare(1357820, 1357825)== -1); - OSMO_ASSERT(gsm0502_fn_compare(1357824, 1357820)== 1); - OSMO_ASSERT(gsm0502_fn_compare(1357825, 1357820)== 1); + OSMO_ASSERT(gsm0502_fncmp(1357820, 1357824) == -1); + OSMO_ASSERT(gsm0502_fncmp(1357820, 1357825) == -1); + OSMO_ASSERT(gsm0502_fncmp(1357824, 1357820) == 1); + OSMO_ASSERT(gsm0502_fncmp(1357825, 1357820) == 1); } int main(int argc, char **argv) { test_gsm0502_fn_remap(); - test_gsm0502_fn_compare(); + test_gsm0502_fncmp(); return EXIT_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34527?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Gerrit-Change-Number: 34527 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria Gerrit-MessageType: newchange