Sheesh, a new record for me.. posting 2 msgs looking for help in the same
week! What's this world coming to? Maybe I'm just frying too many brain
cells between mud code and work code...

Anyways.. Using gcc with -Wcast-qual, -Wcast-align, and other C flags,
Rom2.4b6 and OLC2.01, I still have the following warnings remaining:
olc_act.c:4080: warning: cast discards qualifiers from pointer target type
olc_act.c:4775: warning: cast discards qualifiers from pointer target type
olc_act.c:4780: warning: cast discards qualifiers from pointer target type
screen.c:592: warning: cast discards qualifiers from pointer target type

I can kill all 4 of those out by changing ED_FUN & ED_FUN_DEC from:
typedef bool ED_FUN      args( ( char *, CHAR_DATA *, char *, void *, const 
void * ) );
#define ED_FUN_DEC(blah) bool blah ( char * n_fun, CHAR_DATA *ch, char 
*argument, void *arg, const void *par )

To:
typedef bool ED_FUN      args( ( char *, CHAR_DATA *, char *, void *, void * ) 
);
#define ED_FUN_DEC(blah) bool blah ( char *n_fun, CHAR_DATA *ch, char 
*argument, void *arg, void *par )

However, when I do this, I open up new warnings in olc.c (multiples, but here's 
one):
olc.c:1538: warning: passing arg 5 of pointer to function discards qualifiers 
from pointer target type

bool process_olc_command( CHAR_DATA *ch, char *argument, const struct 
olc_comm_type * table )
{
int temp;
void * leader;
...
1538:> if( ( *table[temp].function ) ( table[temp].name, ch, argument, leader, 
table[temp].parameter ) && tArea )

sample from table: const struct olc_comm_type mob_olc_comm_table[]
56:>    {   "res",          (void *) &xMob.res_flags,       ed_flag_toggle,     
    res_flags       },

struct olc_comm_type:
{
    char *      name;
    void *      argument;
    ED_FUN *    function;
    const void * parameter;
}


Now, if I remove the 'const' from olc_comm_type, I open up another set of 
problems
on the the lines from the table (including the one I've given as an
example)
olc.c:56: warning: initialization discards qualifiers from pointer target type

Removing it from process_olc_command gives me a ton of other areas in
other functions (including void redit()).

I was hoping I wouldn't have to ask the list about this, since describing
the problem is kinda difficult, but after spending hours yesterday working
on, all night lastnight on it, a few too many cans of redbull and iced
tea, a couple packs of cigarettes and many many fried braincells from
watching everything I try just shoot up more errors, I gave in.

So, someone please, PLEASE spare my last braincell by giving me some sort
of viable suggestion (other than turning the compile flags off) or help
or something that'll solve this! Hopefully, I gave enough detail on it, I
didn't want this msg to get too long, but if not, let me know and I'll
post more.

Thanks!

--- RogueDragon @ A Merging of Fates MUD telnet://mud.merging.org:5454
icq: 2072355 (inactive atm), yim: roguedragon, aim: roguedragon69

This is your brain:             This is your brain
   **  **                       after MUD coding:
  ********
  ********                              *
  ********
   ******
    ****          Any questions?
---
Windows - Where do you want to go today?
Linux   - Where do you want to go tomorrow?
FreeBSD - When are they going to catch up?

Reply via email to