I'm getting a compile error in Dev C++ which points me to this line which I added to item_tester_okay() in object1.c*
<code>
/* squelched or hidden items should be as good as non-existant */
if (squelch_hide_item(o_ptr)) return (FALSE);
</code>
I noticed that the declaration of o_ptr in item_tester_okay() says:
const object_type *o_ptr
and the declaration of o_ptr in squelch_hide_item() just says:
object_type *o_ptr
and I'm pretty sure the compile error has something to do with this.
I learned all I know of C from two sources: Beej's silly guide to C and the Angband code itself**. Beej's guide is a beginner's guide and doesn't mention "const", so what exactly does "const" do?
The weird thing about this is that Visual C++ compiles it just fine and doesn't give me this error. Usually Visual C++ has been a lot more picky about correct code than Dev C++.
(* FYI, my code is based on vanilla 3.0.9e)
(**EDIT: and some people here on the forums. You've been a big help. ..didn't want to seem ungrateful..)
<code>
/* squelched or hidden items should be as good as non-existant */
if (squelch_hide_item(o_ptr)) return (FALSE);
</code>
I noticed that the declaration of o_ptr in item_tester_okay() says:
const object_type *o_ptr
and the declaration of o_ptr in squelch_hide_item() just says:
object_type *o_ptr
and I'm pretty sure the compile error has something to do with this.
I learned all I know of C from two sources: Beej's silly guide to C and the Angband code itself**. Beej's guide is a beginner's guide and doesn't mention "const", so what exactly does "const" do?
The weird thing about this is that Visual C++ compiles it just fine and doesn't give me this error. Usually Visual C++ has been a lot more picky about correct code than Dev C++.
(* FYI, my code is based on vanilla 3.0.9e)
(**EDIT: and some people here on the forums. You've been a big help. ..didn't want to seem ungrateful..)
Comment