Change in libosmocore[master]: add osmo_use_count API

Neels Hofmeyr gerrit-no-reply at
Mon Mar 11 05:55:06 UTC 2019

Neels Hofmeyr has posted comments on this change. ( )

Change subject: add osmo_use_count API

Patch Set 2:

File include/osmocom/core/use_count.h:
PS2, Line 66: * osmo_use_count_cb_t 
> Never seen such spacing style before.
it's my personal favorite way to space function pointer typedefs. I find the "(*name)" really weird as language design, so I like to set it apart from the name. Especially if a pointer is returned...

  typedef foo *(*bar)(args);

always confuses me... for me it helps to write

  foo* (* bar )(args);

so that bar doesn't look like function arguments or a typecast...

Can change if you insist?
PS2, Line 141:  */
> Also looks a bit weird...
that's your standard linux torvalds paper scroll way...

ok the standard way would be

   * words

but the known kernel code argument is that this is "braindamaged":

  /* words
   * words */
PS2, Line 150: count
> I'm not arguing agains the requirement / use case. […]
ah ok, a naming issue, I understand now. will ponder it...
File tests/use_count/use_count_test.c:
PS2, Line 320: "use_count_test.c"
> Why not __FILE__?
because it contains the full relative path and depends on where configure was launched from. we could go for 'strrchr(__FILE__, '/') + 1' but that is obscure, unsafe and actually more characters.
PS2, Line 327: 	log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE);
wait a minute, this looks redundant
PS2, Line 326: log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME);
             : 	log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE);
             : 	log_set_print_filename_pos(osmo_stderr_target, LOG_FILENAME_POS_LINE_END);
             : 	log_set_print_category(osmo_stderr_target, 1);
             : 	log_set_print_category_hex(osmo_stderr_target, 0);
             : 	log_set_print_level(osmo_stderr_target, 1);
             : 	log_set_use_color(osmo_stderr_target, 0);
> Off-topic: I think we need some generic configuration for all unit tests.
most of them don't care about logging...

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ife31e6798b4e728a23913179e346552a7dd338c0
Gerrit-Change-Number: 13121
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at>
Gerrit-Comment-Date: Mon, 11 Mar 2019 05:55:06 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list