Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, DotBot, Yahoo!

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » [FIXED] warning for Cronel's ...
Forum Rules | Mark all | Recent Posts

[FIXED] warning for Cronel's editor code
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Aug 4, 2009, 6:55 pm
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Here's the warning message:
editor.c: In function "char* finer_one_argument(char*, char*)"":
editor.c:1016: warning: comparison is always true due to limited range of data type


And here's the line in question:
while ( *argument != '\0' || ++count >= MAX_INPUT_LENGTH )


This is mostly just an annoyance factor and it's the only thing preventing me from getting a clean compile. So does anyone have any idea what I can do to get that warning to go away without killing the functionality of the finer_one_argument function? Or should I just grit my teeth and live with what is just an annoying warning that doesn't actually hurt anything?
       
Post is unread #2 Aug 4, 2009, 8:21 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

yep change it to
while( argument[0] != '\0' || ++count >= MAX_INPUT_LENGTH )

       
Post is unread #3 Aug 4, 2009, 8:51 pm
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Wow, I can't believe I didn't think of changing that one. But anyways, I fixed it. count was declared as a short so I just changed it to an int and away goes the error message.

Thanks Remcon.
       
Pages:<< prev 1 next >>