]> git.pond.sub.org Git - empserver/commitdiff
contact: Inline putcontact() into its only caller setcont()
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 23 Oct 2016 15:52:17 +0000 (17:52 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:20 +0000 (20:09 +0200)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/nat.h
src/lib/common/nat.c
src/lib/subs/rej.c

index 20f7ba88592b7d2f8ee1356f9de3a7d2f0b1f0c6..3a4e021be7395ced12a9f29611affb7f7d17d93c 100644 (file)
@@ -171,7 +171,6 @@ extern int getrejects(natid them, struct natstr *np);
 extern int getcontact(struct natstr *np, natid them);
 extern void putrel(struct natstr *np, natid them, int relate);
 extern void putreject(struct natstr *np, natid them, int how, int what);
-extern void putcontact(struct natstr *np, natid them, int contact);
 extern void agecontact(struct natstr *np);
 extern int influx(struct natstr *np);
 extern struct natstr *nat_reset(struct natstr *, natid, char *, char *,
index 2a42a38f08b3187e1d28c71f8e027f31f2317b67..f5372e785c027f0438967f79be93b5a32d57b54d 100644 (file)
@@ -128,18 +128,6 @@ putreject(struct natstr *np, natid them, int how, int what)
        np->nat_rejects[them] &= ~what;
 }
 
-void
-putcontact(struct natstr *np, natid them, int contact)
-{
-    if (CANT_HAPPEN(contact < 0))
-       contact = 0;
-    if (CANT_HAPPEN(contact > 255))
-       contact = 255;
-
-    if (np->nat_contact[them] < contact)
-       np->nat_contact[them] = contact;
-}
-
 int
 influx(struct natstr *np)
 {
index f90605604e726dcb00e63149e36038fbfa5d9ddc..de11e8171108282bf55eaef3f888e80b409ddb7f 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Dave Pare, 1994
- *     Markus Armbruster, 2005-2013
+ *     Markus Armbruster, 2005-2016
  */
 
 #include <config.h>
@@ -117,7 +117,14 @@ setcont(natid us, natid them, int contact)
 
     if (CANT_HAPPEN(!np))
        return;
-    putcontact(np, them, contact);
+
+    if (CANT_HAPPEN(contact < 0))
+       contact = 0;
+    if (CANT_HAPPEN(contact > 255))
+       contact = 255;
+
+    if (np->nat_contact[them] < contact)
+       np->nat_contact[them] = contact;
     putnat(np);
 }