Compiler throwing back warnings (enums + Cell Array)
Heh, it's been a while since I've been here :).
Can anyone explain why a code piece such as the following would cause the compiler to throw a tag mismatch error? For whatever reason, I keep receiving such warnings when using an enum to define a cell location in an array pointing to a Cell Array. Code:
The lines containing ArraySize and ArrayGetString functions throw warnings. However, doing something such as the following within a function works and compiles without warning/error. Code:
Am I not understanding how enums work, does Cell Array merely not like enums, or does the compiler simply hate me. |
Re: Compiler throwing back warnings (enums + Cell Array)
enum _:MOTD_FIELDS
|
Re: Compiler throwing back warnings (enums + Cell Array)
No..
@Lord_Destros: If you use an enum as structure, the proper way is : Code:
Code:
By the way, you should use trie to avoid to loop/get string/compare. |
Re: Compiler throwing back warnings (enums + Cell Array)
@xPaw: I already tried that but it didn't work.
@Arkshine: I tried setting Array tags within the enum but unfortunately all of the tag mismatch warnings remain. Also, I'm not sure I see if use of trie would help as, based on my current storage method, I require the location at which the Command string exists within the cellarray (which links it to the respective Name/Path values). |
Re: Compiler throwing back warnings (enums + Cell Array)
I've tested myself before posting, try again.
|
Re: Compiler throwing back warnings (enums + Cell Array)
Quote:
|
Re: Compiler throwing back warnings (enums + Cell Array)
You should cast only when you have no choice to do it like when a param of native/forward header doesn't have a tag and you would need to remove it.
You can read an interesting discussion here : http://forums.alliedmods.net/showthread.php?t=109853 |
All times are GMT -4. The time now is 20:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.