Re: Array Warning... Need some help

From: d. hall (dhall@OOI.NET)
Date: 08/25/98

>>>>>> thus on Tue, 25 Aug 1998 15:35:02 EDT, Nick wrote:

> act.informative.c: In function `do_affects':
> act.informative.c:1902: warning: array subscript has type `char'

> That line is:

> ((GET_LEVEL(ch) >= 14 && af->location) ? apply_types[af->location] :
> "Something"),

"af->location" is type byte, which is typedef'ed from type char.  On what
OS and compiler are you using?  Win32?

You can probably change it to the following to get rid of the warning.

((GET_LEVEL(ch) >= 14 && af->location) ? apply_types[(int) af->location] : "Something"),

> I don't know a ton about arrays, so that could be part of the problem.

It has more to do with type casting then arrays.  Sounds more like your
compiler being finicky.


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST