PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/iptables-2.6/913-dead-code.patch

http://wl500g.googlecode.com/
Patch | 112 lines | 101 code | 11 blank | 0 comment | 0 complexity | a6b6a041af18fc179f830f8b0268c02e MD5 | raw file
Possible License(s): GPL-2.0
  1. From 7d91a2accc92d13bb32bf881831e9c9a8b4d7734
  2. From: Jan Engelhardt <jengelh@medozas.de>
  3. Date: Mon, 30 May 2011 01:39:54 +0200
  4. Subject: [PATCH] build: remove dead code parts
  5. gcc-4.6 has a new warning, -Wunused-but-set-variable, which flags
  6. no-op code.
  7. CC libiptc/libip4tc.lo
  8. In file included from libiptc/libip4tc.c:118:0:
  9. libiptc/libiptc.c: In function "iptcc_chain_index_delete_chain":
  10. libiptc/libiptc.c:611:32: warning: variable "index_ptr2" set but not used
  11. libiptc/libiptc.c: In function "alloc_handle":
  12. libiptc/libiptc.c:1282:9: warning: variable "len" set but not used
  13. CC libiptc/libip6tc.lo
  14. In file included from libiptc/libip6tc.c:113:0:
  15. libiptc/libiptc.c: In function "iptcc_chain_index_delete_chain":
  16. libiptc/libiptc.c:611:32: warning: variable "index_ptr2" set but not used
  17. libiptc/libiptc.c: In function "alloc_handle":
  18. libiptc/libiptc.c:1282:9: warning: variable "len" set but not used
  19. CC xtables_multi-iptables-xml.o
  20. iptables-xml.c: In function "do_rule_part":
  21. iptables-xml.c:376:8: warning: variable "thisChain" set but not used
  22. CC xtables_multi-ip6tables.o
  23. ip6tables.c: In function "print_firewall":
  24. ip6tables.c:552:10: warning: variable "flags" set but not used
  25. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
  26. ---
  27. ip6tables.c | 2 --
  28. iptables-xml.c | 3 ---
  29. libiptc/libiptc.c | 7 ++-----
  30. 3 files changed, 2 insertions(+), 10 deletions(-)
  31. diff --git a/ip6tables.c b/ip6tables.c
  32. index a74238c..4df73b8 100644
  33. --- a/ip6tables.c
  34. +++ b/ip6tables.c
  35. @@ -549,7 +549,6 @@ print_firewall(const struct ip6t_entry *fw,
  36. {
  37. struct xtables_target *target = NULL;
  38. const struct ip6t_entry_target *t;
  39. - u_int8_t flags;
  40. char buf[BUFSIZ];
  41. if (!ip6tc_is_chain(targname, handle))
  42. @@ -559,7 +558,6 @@ print_firewall(const struct ip6t_entry *fw,
  43. XTF_LOAD_MUST_SUCCEED);
  44. t = ip6t_get_target((struct ip6t_entry *)fw);
  45. - flags = fw->ipv6.flags;
  46. if (format & FMT_LINENUMBERS)
  47. printf(FMT("%-4u ", "%u "), num);
  48. diff --git a/iptables-xml.c b/iptables-xml.c
  49. index dc3cd4f..aa98f75 100644
  50. --- a/iptables-xml.c
  51. +++ b/iptables-xml.c
  52. @@ -373,7 +373,6 @@ do_rule_part(char *leveltag1, char *leveltag2, int part, int argc,
  53. {
  54. int arg = 1; // ignore leading -A
  55. char invert_next = 0;
  56. - char *thisChain = NULL;
  57. char *spacer = ""; // space when needed to assemble arguments
  58. char *level1 = NULL;
  59. char *level2 = NULL;
  60. @@ -397,8 +396,6 @@ do_rule_part(char *leveltag1, char *leveltag2, int part, int argc,
  61. } else printf("%s<%s ", (leveli ## LEVEL), (level ## LEVEL)); \
  62. } while(0)
  63. - thisChain = argv[arg++];
  64. -
  65. if (part == 1) { /* skip */
  66. /* use argvattr to tell which arguments were quoted
  67. to avoid comparing quoted arguments, like comments, to -j, */
  68. diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
  69. index d3b1c51..0b6d5e3 100644
  70. --- a/libiptc/libiptc.c
  71. +++ b/libiptc/libiptc.c
  72. @@ -608,7 +608,7 @@ static int iptcc_chain_index_rebuild(struct xtc_handle *h)
  73. */
  74. static int iptcc_chain_index_delete_chain(struct chain_head *c, struct xtc_handle *h)
  75. {
  76. - struct list_head *index_ptr, *index_ptr2, *next;
  77. + struct list_head *index_ptr, *next;
  78. struct chain_head *c2;
  79. unsigned int idx, idx2;
  80. @@ -628,7 +628,7 @@ static int iptcc_chain_index_delete_chain(struct chain_head *c, struct xtc_handl
  81. * is located in the same index bucket.
  82. */
  83. c2 = list_entry(next, struct chain_head, list);
  84. - index_ptr2 = iptcc_bsearch_chain_index(c2->name, &idx2, h);
  85. + iptcc_bsearch_chain_index(c2->name, &idx2, h);
  86. if (idx != idx2) {
  87. /* Rebuild needed */
  88. return iptcc_chain_index_rebuild(h);
  89. @@ -1279,11 +1279,8 @@ static int iptcc_compile_table(struct xtc_handle *h, STRUCT_REPLACE *repl)
  90. static struct xtc_handle *
  91. alloc_handle(const char *tablename, unsigned int size, unsigned int num_rules)
  92. {
  93. - size_t len;
  94. struct xtc_handle *h;
  95. - len = sizeof(STRUCT_TC_HANDLE) + size;
  96. -
  97. h = malloc(sizeof(STRUCT_TC_HANDLE));
  98. if (!h) {
  99. errno = ENOMEM;
  100. --
  101. 1.7.2.5