[mw-devel] [Git][arthur/mw][master] Add -Wtype-limits

Andrew Price welshbyte at sucs.org
Fri Mar 4 21:39:02 GMT 2016


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
769ee045 by Andrew Price at 2016-03-04T21:37:54+00:00
Add -Wtype-limits

And fix some issues it complains about. Also tweak one issue found by
adding -Wmissing-field-initializers temporarily (that warning is too
fussy to enable by default).

- - - - -


4 changed files:

- Makefile.common
- src/client/command.c
- src/client/mesg.c
- src/client/talker.c


Changes:

=====================================
Makefile.common
=====================================
--- a/Makefile.common
+++ b/Makefile.common
@@ -48,6 +48,7 @@ WARNINGS = \
 	-Wformat=2 \
 	-Wformat-security \
 	-Wformat-nonliteral \
+	-Wtype-limits \
 	-Wno-long-long \
 	-Wno-strict-aliasing \
 


=====================================
src/client/command.c
=====================================
--- a/src/client/command.c
+++ b/src/client/command.c
@@ -83,5 +83,5 @@ CommandList table[]={
 {"wiz",        0x002, 1, "Usage: wiz <message>", "Send message to all wizchat users", c_wiz, 1},
 {"wizchat",    0x002, 1, "Usage: wizchat on|off", "Toggle wizchat", c_wizchat, 1},
 {"write",      0x000, 0, "Usage: write", "Post a message to the current folder", c_write, 1},
-{NULL,         0x000, 0, NULL, NULL, 0}
+{NULL,         0x000, 0, NULL, NULL, NULL, 0}
 };


=====================================
src/client/mesg.c
=====================================
--- a/src/client/mesg.c
+++ b/src/client/mesg.c
@@ -20,7 +20,7 @@ extern struct user * const user;
 
 void inform_of_mail(char *to)
 {
-	if (ipc_send_to_username(to, IPC_NEWMAIL, NULL) < 0)
+	if (ipc_send_to_username(to, IPC_NEWMAIL, NULL) != 0)
 		printf(_("Cannot inform %s of new mail.\n"),to);
 }
 


=====================================
src/client/talker.c
=====================================
--- a/src/client/talker.c
+++ b/src/client/talker.c
@@ -260,14 +260,6 @@ void t_runaway(CommandList *cm, int argc, const char **argv, char *args)
 					return;
 				}
 			}
-			else
-			{
-				if (num < 0)
-				{
-					printf("Invalid Runaway. Must be positive (0 disables)\n");
-					return;
-				}
-			}
 			run_away = num;
 			if (run_away == 0) printf("Runaway disabled\n");
 			else printf("Runaway set to value: %lu\n", run_away);



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/769ee045c751432f5edeeae67ff5f6055ac2b2ce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20160304/b2c62fec/attachment.html>


More information about the mw-devel mailing list