diff options
author | Harald Welte <laforge@gnumonks.org> | 2016-04-27 18:21:16 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-04-29 13:10:37 +0200 |
commit | 5d547a4358edbd18744d1996d6ecb40328f09061 (patch) | |
tree | 866489ca9f7ec7be7ee8016e41680d61a819bb29 /openbsc/tests/oap | |
parent | d8aa412c46638abea05488ebb2e9d70ca7fd628a (diff) |
osmo_oap_decode(): Use common argument ordering
In general, if a function generates output data like a msgb (or in this
case filling an osmo_oap_message structure), the output argument
precedes the source. This is what we use all over libosmo*, and it is
modelled after memcpy(), where dst is the first argument, before src.
Let's align osmo_oap_decode(). Intestingly, osmo_oap_encode was already
correct, so the encode/decode functions used different conventions
before.
Diffstat (limited to 'openbsc/tests/oap')
-rw-r--r-- | openbsc/tests/oap/oap_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/tests/oap/oap_test.c b/openbsc/tests/oap/oap_test.c index 625d8d892..339d77430 100644 --- a/openbsc/tests/oap/oap_test.c +++ b/openbsc/tests/oap/oap_test.c @@ -168,7 +168,7 @@ static void test_oap_api(void) /* Expect the challenge response in msg_tx */ OSMO_ASSERT(msg_tx); - OSMO_ASSERT(osmo_oap_decode(msg_tx->data, msg_tx->len, &oap_tx) == 0); + OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_CHALLENGE_RESULT); OSMO_ASSERT(strcmp("e2d05b598c61d9ba", osmo_hexdump_nospc(oap_tx.xres, sizeof(oap_tx.xres))) @@ -191,7 +191,7 @@ static void test_oap_api(void) OSMO_ASSERT(oap_handle(state, msg_rx, &msg_tx) == 0); OSMO_ASSERT(state->registration_failures == 1); OSMO_ASSERT(msg_tx); - OSMO_ASSERT(osmo_oap_decode(msg_tx->data, msg_tx->len, &oap_tx) == 0); + OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_REGISTER_REQUEST); OSMO_ASSERT(state->state == OAP_REQUESTED_CHALLENGE); msgb_free(msg_tx); |