Projects
osmocom:master
libosmocore
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 44
View file
libosmocore.spec
Changed
@@ -14,13 +14,13 @@ Name: libosmocore Requires: osmocom-master -Version: 1.7.0.93.e709b +Version: 1.7.0.94.9470 Release: 0 Summary: The Open Source Mobile Communications Core Library License: GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND AGPL-3.0-or-later Group: Productivity/Telephony/Utilities Url: https://osmocom.org/projects/libosmocore/wiki/Libosmocore -Source: libosmocore_1.7.0.93.e709b.tar.xz +Source: libosmocore_1.7.0.94.9470.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.6 BuildRequires: libtool >= 2
View file
commit_94705d042a94d40585414d83d446889a087dae05.txt
Added
View file
commit_e709bd4814020146baff2538ea50dbbc96432ff0.txt
Deleted
View file
libosmocore_1.7.0.93.e709b.dsc -> libosmocore_1.7.0.94.9470.dsc
Changed
@@ -2,7 +2,7 @@ Source: libosmocore Binary: libosmocore, libosmocodec0, libosmocodec-doc, libosmocoding0, libosmocoding-doc, libosmocore19, libosmocore-doc, libosmogb14, libosmogb-doc, libosmogsm18, libosmogsm-doc, libosmovty9, libosmovty-doc, libosmoctrl0, libosmoctrl-doc, libosmosim2, libosmousb0, libosmocore-dev, libosmocore-utils, libosmocore-dbg Architecture: any all -Version: 1.7.0.93.e709b +Version: 1.7.0.94.9470 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/libosmocore Standards-Version: 3.9.8 @@ -31,8 +31,8 @@ libosmovty-doc deb doc optional arch=all libosmovty9 deb libs optional arch=any Checksums-Sha1: - df4e2310cd0907042c7e7171185c21bf38b64c60 1005608 libosmocore_1.7.0.93.e709b.tar.xz + fdb21123e3bbe53ef9499e9cc8e604004ba6ad8c 1005452 libosmocore_1.7.0.94.9470.tar.xz Checksums-Sha256: - 8fe86935a241d9ce6bd112b4ba1c551a7617bba2e42930a36f72ace0c288df94 1005608 libosmocore_1.7.0.93.e709b.tar.xz + 473a03572296b0683791b1d26275c60efd4448610715c5d32d6452a18fdf1c8f 1005452 libosmocore_1.7.0.94.9470.tar.xz Files: - 0b970dbb5632944612b865e7cea65b20 1005608 libosmocore_1.7.0.93.e709b.tar.xz + 763dddee69cca088c8bf16d34b5a8122 1005452 libosmocore_1.7.0.94.9470.tar.xz
View file
libosmocore_1.7.0.93.e709b.tar.xz/.tarball-version -> libosmocore_1.7.0.94.9470.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.7.0.93-e709b +1.7.0.94-9470
View file
libosmocore_1.7.0.93.e709b.tar.xz/debian/changelog -> libosmocore_1.7.0.94.9470.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -libosmocore (1.7.0.93.e709b) unstable; urgency=medium +libosmocore (1.7.0.94.9470) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Wed, 11 Jan 2023 15:37:38 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Thu, 12 Jan 2023 09:37:36 +0000 libosmocore (1.7.0) unstable; urgency=medium
View file
libosmocore_1.7.0.93.e709b.tar.xz/include/osmocom/core/utils.h -> libosmocore_1.7.0.94.9470.tar.xz/include/osmocom/core/utils.h
Changed
@@ -182,6 +182,18 @@ uint32_t osmo_isqrt32(uint32_t x); +/*! Floored Modulo (See also: Daan Leijen, Division and Modulus for Computer Scientists). + * \paramin x dividend. + * \paramin y divisor. + * \returns remainder of x divided by y. */ +#define OSMO_MOD_FLR(x, y) (((x) > 0 && (y) < 0) || ((x) < 0 && (y) > 0) ? (x) % (y) + (y) : (x) % (y)) + +/*! Euclidean Modulo (See also: Daan Leijen, Division and Modulus for Computer Scientists). + * \paramin x dividend. + * \paramin y divisor. + * \returns remainder of x divided by y. */ +#define OSMO_MOD_EUC(x, y) ((x) % (y) < 0 ? (y) > 0 ? (x) % (y) + (y) : (x) % (y) - (y) : (x) % (y)) + char osmo_luhn(const char* in, int in_len); /*! State for OSMO_STRBUF_APPEND() and OSMO_STRBUF_PRINTF(). See there for examples. */
View file
libosmocore_1.7.0.93.e709b.tar.xz/tests/utils/utils_test.c -> libosmocore_1.7.0.94.9470.tar.xz/tests/utils/utils_test.c
Changed
@@ -766,6 +766,65 @@ } } +static void mod_test_mod(int x, int y, int expected_result) +{ + int result; + result = x % y; + printf(" %d mod %d = %d = %d\n", x, y, result, expected_result); + OSMO_ASSERT(result == expected_result); +} + +static void mod_test_mod_flr(int x, int y, int expected_result) +{ + int result; + result = OSMO_MOD_FLR(x, y); + printf(" %d mod_flr %d = %d = %d\n", x, y, result, expected_result); + OSMO_ASSERT(result == expected_result); +} + +static void mod_test_mod_euc(int x, int y, int expected_result) +{ + int result; + result = OSMO_MOD_EUC(x, y); + printf(" %d mod_euc %d = %d = %d\n", x, y, result, expected_result); + OSMO_ASSERT(result == expected_result); +} + +static void mod_test(void) +{ + /* See also: Daan Leijen, Division and Modulus for Computer + * Scientists, section 1.3 */ + + printf("\nTesting built in truncated modulo for comparison:\n"); + mod_test_mod(8, 3, 2); + mod_test_mod(8, -3, 2); + mod_test_mod(-8, 3, -2); + mod_test_mod(-8, -3, -2); + mod_test_mod(1, 2, 1); + mod_test_mod(1, -2, 1); + mod_test_mod(-1, 2, -1); + mod_test_mod(-1, -2, -1); + + printf("\nTesting OSMO_MOD_FLR():\n"); + mod_test_mod_flr(8, 3, 2); + mod_test_mod_flr(8, -3, -1); + mod_test_mod_flr(-8, 3, 1); + mod_test_mod_flr(-8, -3, -2); + mod_test_mod_flr(1, 2, 1); + mod_test_mod_flr(1, -2, -1); + mod_test_mod_flr(-1, 2, 1); + mod_test_mod_flr(-1, -2, -1); + + printf("\nTesting OSMO_MOD_EUC():\n"); + mod_test_mod_euc(8, 3, 2); + mod_test_mod_euc(8, -3, 2); + mod_test_mod_euc(-8, 3, 1); + mod_test_mod_euc(-8, -3, 1); + mod_test_mod_euc(1, 2, 1); + mod_test_mod_euc(1, -2, 1); + mod_test_mod_euc(-1, 2, 1); + mod_test_mod_euc(-1, -2, 1); +} struct osmo_sockaddr_to_str_and_uint_test_case { uint16_t port; @@ -2088,6 +2147,7 @@ str_escape3_test(); str_quote3_test(); isqrt_test(); + mod_test(); osmo_sockaddr_to_str_and_uint_test(); osmo_str_tolowupper_test(); strbuf_test();
View file
libosmocore_1.7.0.93.e709b.tar.xz/tests/utils/utils_test.ok -> libosmocore_1.7.0.94.9470.tar.xz/tests/utils/utils_test.ok
Changed
@@ -354,6 +354,36 @@ Testing integer square-root +Testing built in truncated modulo for comparison: + 8 mod 3 = 2 = 2 + 8 mod -3 = 2 = 2 + -8 mod 3 = -2 = -2 + -8 mod -3 = -2 = -2 + 1 mod 2 = 1 = 1 + 1 mod -2 = 1 = 1 + -1 mod 2 = -1 = -1 + -1 mod -2 = -1 = -1 + +Testing OSMO_MOD_FLR(): + 8 mod_flr 3 = 2 = 2 + 8 mod_flr -3 = -1 = -1 + -8 mod_flr 3 = 1 = 1 + -8 mod_flr -3 = -2 = -2 + 1 mod_flr 2 = 1 = 1 + 1 mod_flr -2 = -1 = -1 + -1 mod_flr 2 = 1 = 1 + -1 mod_flr -2 = -1 = -1 + +Testing OSMO_MOD_EUC(): + 8 mod_euc 3 = 2 = 2 + 8 mod_euc -3 = 2 = 2 + -8 mod_euc 3 = 1 = 1 + -8 mod_euc -3 = 1 = 1 + 1 mod_euc 2 = 1 = 1 + 1 mod_euc -2 = 1 = 1 + -1 mod_euc 2 = 1 = 1 + -1 mod_euc -2 = 1 = 1 + osmo_sockaddr_to_str_and_uint_test 0 0.0.0.0:0 addr_len=20 --> 0.0.0.0:0 rc=7 1 255.255.255.255:65535 addr_len=20 --> 255.255.255.255:65535 rc=15
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.