[acassen/keepalived] 976320: timeout_epilog: mark argument const

Alexandre Cassen <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <5714961dd0f12_1973fcc2e7632b831885@hookshot-fe1-cp1-prd.iad.github.net.mail>
  Branch: refs/heads/master
  Home:   https://github.com/acassen/keepalived
  Commit: 97632045cf0decd8d2bafe7bf803947882ce818b
      https://github.com/acassen/keepalived/commit/97632045cf0decd8d2bafe7bf803947882ce818b
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/check/check_http.c
    M keepalived/include/check_http.h

  Log Message:
  -----------
  timeout_epilog: mark argument const


  Commit: 6f82ce0f1855a125aa857f18397be3de89118abd
      https://github.com/acassen/keepalived/commit/6f82ce0f1855a125aa857f18397be3de89118abd
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M lib/parser.c
    M lib/parser.h

  Log Message:
  -----------
  parser: mark some function arguments as const


  Commit: 3534bc74ce8d8c8b1ba2c6c24129a316ebc92e58
      https://github.com/acassen/keepalived/commit/3534bc74ce8d8c8b1ba2c6c24129a316ebc92e58
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M lib/timer.c

  Log Message:
  -----------
  No need to initialize static variable

Fixes:

timer.c:29:24: warning: use of GNU old-style field designator extension
[-Wgnu-designator]
timeval_t time_now = { tv_sec: 0, tv_usec: 0 };
                 ^~~~~~~
                 .tv_sec =
timer.c:29:35: warning: use of GNU old-style field designator extension
[-Wgnu-designator]
timeval_t time_now = { tv_sec: 0, tv_usec: 0 };
                            ^~~~~~~~
                            .tv_usec =
2 warnings generated.


  Commit: d744a0d15cc64899900b24bb295c4429a46b5f34
      https://github.com/acassen/keepalived/commit/d744a0d15cc64899900b24bb295c4429a46b5f34
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/vrrp/vrrp_ipaddress.c

  Log Message:
  -----------
  terminate argv with NULL

man execvp says: "The array of pointers must be terminated by a null
pointer."

Fixes:
vrrp_ipaddress.c:190:12: warning: expression which evaluates to zero
treated as a null pointer constant of type 'char *'
[-Wnon-literal-null-conversion]
 argv[i] = '\0';
     ^~~~


  Commit: cf5b9f38e0dab0ee49bceadc921ed10ce14434a1
      https://github.com/acassen/keepalived/commit/cf5b9f38e0dab0ee49bceadc921ed10ce14434a1
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/check/ipvswrapper.c

  Log Message:
  -----------
  ipvswrapper.c: fix comparison

Fixes:

ipvswrapper.c:473:29: warning: use of logical '||' with constant operand
[-Wconstant-logical-operand]
   (cmd == ((64+1024+64)+2) || ((64+1024+64)+7))
                      ^  ~~~~~~~~~~~~~~~~
ipvswrapper.c:473:29: note: use '|' for a bitwise operation
   (cmd == ((64+1024+64)+2) || ((64+1024+64)+7))
                      ^~
                      |
ipvswrapper.c:477:29: warning: use of logical '||' with constant operand
[-Wconstant-logical-operand]
   (cmd == ((64+1024+64)+4) || ((64+1024+64)+8))
                      ^  ~~~~~~~~~~~~~~~~
ipvswrapper.c:477:29: note: use '|' for a bitwise operation
   (cmd == ((64+1024+64)+4) || ((64+1024+64)+8))
                      ^~
                      |
2 warnings generated.


  Commit: a9e93334a40f7c74a48c9b26d5954adf74121a98
      https://github.com/acassen/keepalived/commit/a9e93334a40f7c74a48c9b26d5954adf74121a98
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/core/main.c
    M keepalived/core/pidfile.c
    M keepalived/include/main.h
    M keepalived/include/pidfile.h

  Log Message:
  -----------
  mark pidfile strings as const


  Commit: 8fd8b9fd7ea99f113e55d7e15bec7037cde3836b
      https://github.com/acassen/keepalived/commit/8fd8b9fd7ea99f113e55d7e15bec7037cde3836b
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M lib/utils.c
    M lib/utils.h

  Log Message:
  -----------
  utils.c: mark some arguments a const

I left inet_stosockaddr alone for now, since it modifies the string.
We should fix that, since we pass in strings which might be const and in
readonly memory.


  Commit: 1c043c97238509e0c66467d2cac475c9969c3e39
      https://github.com/acassen/keepalived/commit/1c043c97238509e0c66467d2cac475c9969c3e39
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/include/vrrp_netlink.h
    M keepalived/vrrp/vrrp_netlink.c

  Log Message:
  -----------
  netlink_scope_n2a: mark return type as const


  Commit: c637ca49a356c2aba19c6a1d551b7f486aab8afe
      https://github.com/acassen/keepalived/commit/c637ca49a356c2aba19c6a1d551b7f486aab8afe
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/core/global_parser.c
    M keepalived/vrrp/vrrp_ipaddress.c
    M keepalived/vrrp/vrrp_iproute.c
    M keepalived/vrrp/vrrp_iprule.c
    M keepalived/vrrp/vrrp_sync.c
    M lib/parser.c
    M lib/vector.c
    M lib/vector.h

  Log Message:
  -----------
  vector->allocated is unsigned

Fixes a few of these:

vector.c:73:16: warning: comparison of integers of different signs:
'unsigned int' and 'int' [-Wsign-compare]
 if (v->active >= index + 1)
     ~~~~~~~~~ ^  ~~~~~~~~~


  Commit: 91d2c92fa2d9b810523047dd2f249adf1acb46ab
      https://github.com/acassen/keepalived/commit/91d2c92fa2d9b810523047dd2f249adf1acb46ab
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M lib/parser.c
    M lib/parser.h

  Log Message:
  -----------
  Mark more stuff as const


  Commit: 94990290f1755ea93d77e5b3a42a19897066d63d
      https://github.com/acassen/keepalived/commit/94990290f1755ea93d77e5b3a42a19897066d63d
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/vrrp/vrrp_notify.c

  Log Message:
  -----------
  notify_script_exec: mark a few arguments as const


  Commit: d1650a20891c1f56a39f49179f6f2fb5d43bf635
      https://github.com/acassen/keepalived/commit/d1650a20891c1f56a39f49179f6f2fb5d43bf635
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/vrrp/vrrp_print.c

  Log Message:
  -----------
  vscript_print: mark string as const


  Commit: dbee6e6650effdb412fb808fab88c036b2df82bb
      https://github.com/acassen/keepalived/commit/dbee6e6650effdb412fb808fab88c036b2df82bb
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/vrrp/vrrp_data.c
    M keepalived/vrrp/vrrp_print.c

  Log Message:
  -----------
  vector->allocted is unsigned


  Commit: b2df5307c3f1c8090e7364684fdf72dbdfe70681
      https://github.com/acassen/keepalived/commit/b2df5307c3f1c8090e7364684fdf72dbdfe70681
  Author: Ruben Kerkhof <[email protected]>
  Date:   2016-04-17 (Sun, 17 Apr 2016)

  Changed paths:
    M keepalived/vrrp/vrrp_data.c

  Log Message:
  -----------
  dump_vscript: mark str as const

vrrp_data.c:139:7: warning: assigning to 'char *' from 'const char [5]'
discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  str = "INIT"; break;
      ^ ~~~~~~
vrrp_data.c:141:7: warning: assigning to 'char *' from 'const char [10]'
discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  str = "INIT/GOOD"; break;
      ^ ~~~~~~~~~~~
vrrp_data.c:143:7: warning: assigning to 'char *' from 'const char [9]'
discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  str = "DISABLED"; break;
      ^ ~~~~~~~~~~
vrrp_data.c:145:7: warning: assigning to 'char *' from 'const char *'
discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  str = (vscript->result >= vscript->rise) ? "GOOD" : "BAD";
      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.


  Commit: e5dd41822e6ed0b9848b83d0905108f1731a66ef
      https://github.com/acassen/keepalived/commit/e5dd41822e6ed0b9848b83d0905108f1731a66ef
  Author: Alexandre Cassen <[email protected]>
  Date:   2016-04-18 (Mon, 18 Apr 2016)

  Changed paths:
    M keepalived/check/check_http.c
    M keepalived/check/ipvswrapper.c
    M keepalived/core/global_parser.c
    M keepalived/core/main.c
    M keepalived/core/pidfile.c
    M keepalived/include/check_http.h
    M keepalived/include/main.h
    M keepalived/include/pidfile.h
    M keepalived/include/vrrp_netlink.h
    M keepalived/vrrp/vrrp_data.c
    M keepalived/vrrp/vrrp_ipaddress.c
    M keepalived/vrrp/vrrp_iproute.c
    M keepalived/vrrp/vrrp_iprule.c
    M keepalived/vrrp/vrrp_netlink.c
    M keepalived/vrrp/vrrp_notify.c
    M keepalived/vrrp/vrrp_print.c
    M keepalived/vrrp/vrrp_sync.c
    M lib/parser.c
    M lib/parser.h
    M lib/timer.c
    M lib/utils.c
    M lib/utils.h
    M lib/vector.c
    M lib/vector.h

  Log Message:
  -----------
  Merge pull request #301 from rubenk/clang-fixes

Clang fixes


Compare: https://github.com/acassen/keepalived/compare/9b12e1ad0b8a...e5dd41822e6e

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z

_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.