[Olsr-dev] [PATCH v1 000/115] Merge common code from jsoninfo and txtinfo

Henning Rogge (spam-protected)
Thu Dec 3 11:10:07 CET 2015


Hi Ferry,

just as a first comment, you have a strange pattern when dealing with
function pointers...

1.) you don't need to use the & operator to initialize a function pointer

variable = function_name;

works fine.

2.) You don't need to do the strange (*xyz)(abc); pattern

example... in olsrd_info.c, in the determine_action() function (line
80..) you can write:

static unsigned int determine_action(char *requ) {
  if (!functions->is_command)
    return 0;

  if (functions->is_command(requ, SIW_OLSRD_CONF))
    return SIW_OLSRD_CONF;

  if (functions->is_command(requ, SIW_ALL))
    return SIW_ALL;


This would improve the readability of the function pointer handling quite a bit.

Henning

On Wed, Dec 2, 2015 at 9:35 PM, Ferry Huberts <(spam-protected)> wrote:
> I've also pushed the series as branch 'json-txt-merge'.
>
> For easier review,
> using something like gitk with 'ignore space change' (hint)
>
> Ferry
>
>
> --
> Olsr-dev mailing list
> (spam-protected)
> https://lists.olsr.org/mailman/listinfo/olsr-dev



More information about the Olsr-dev mailing list