[Pkg-wmaker-commits] [wmppp.app] 77/120: wmppp.app: Switch ifs to #ifs for macros.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 27 12:04:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmppp.app.

commit 299a2ad44b473be0c8dc3214e72bcff340e99833
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Tue May 19 22:30:59 2015 -0500

    wmppp.app: Switch ifs to #ifs for macros.
    
    Fixes "warning: null argument where non-null required" compiler warnings by
    not passing NULL to strdup and "(warning) Conversion of string literal to
    bool always evaluates to true" found by cppcheck.
---
 wmppp.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/wmppp.c b/wmppp.c
index 10e3ebe..57d81cf 100644
--- a/wmppp.c
+++ b/wmppp.c
@@ -187,10 +187,11 @@
  /* Defines */
 /***********/
 
-#define START_ACTION (NULL)
-#define STOP_ACTION (NULL)
-#define SPEED_ACTION (NULL)
-#define IFDOWN_ACTION (NULL)
+/* Fill in and uncomment the hardcoded actions. */
+/* #define START_ACTION (NULL) */
+/* #define STOP_ACTION (NULL) */
+/* #define SPEED_ACTION (NULL) */
+/* #define IFDOWN_ACTION (NULL) */
 
 #define STAMP_FILE_PRE "/var/run/wmppp."
 
@@ -408,14 +409,22 @@ void wmppp_routine(int argc, char **argv) {
 	get_statistics(active_interface, &ppp_rl, &ppp_sl, &ppp_orbytes, &ppp_osbytes);
 
 	/* Scan through ~/.wmifsrc for the mouse button actions. */
-	if (START_ACTION) start_action = strdup(START_ACTION);
-	if (STOP_ACTION) stop_action = strdup(STOP_ACTION);
-	if (SPEED_ACTION) speed_action = strdup(SPEED_ACTION);
-	if (IFDOWN_ACTION) ifdown_action = strdup(IFDOWN_ACTION);
-	if (STAMP_FILE_PRE) {
+	#ifdef START_ACTION
+	    start_action = strdup(START_ACTION);
+	#endif
+	#ifdef STOP_ACTION
+	    stop_action = strdup(STOP_ACTION);
+	#endif
+	#ifdef SPEED_ACTION
+	    speed_action = strdup(SPEED_ACTION);
+	#endif
+	#ifdef IFDOWN_ACTION
+	    ifdown_action = strdup(IFDOWN_ACTION);
+	#endif
+	#ifdef STAMP_FILE_PRE
            sprintf (temp, "%s%s", STAMP_FILE_PRE, active_interface);
            stamp_file = strdup (temp);
-	}
+	#endif
 
 
 	strcpy(temp, "/etc/wmppprc");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmppp.app.git



More information about the Pkg-wmaker-commits mailing list