Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Google, DotBot, Yandex

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
621
KellieBusb
Today's Birthdays
Rane (42)
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,874
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 >>