Ok. I found the wonderfully written snippet to add in object and room
programs to a code that has olc version 1.8(I think that is the version).

I THINK that my problem stems from the fact that I am putting it into a code
base with olc 1.71...

I have put everything in, and cleared all of the errors that I was able
to...but this one error  and one warning  are just giving me fits.


The warning, is this.

e:\rom24\src\act_comm.c(1798) : warning C4700: local variable 'victim' used
without having been initialized

This is in the DO_GROUP function.  The funny thing is, the function did not
change in the SLIGHTEST during the code changes that I can find....and I do
not get this warning when I compile the code without the changes...

I don't have the *nix utility on my windows machine to compare them exactly,
but I have put the old and new function side by side and can not find a
difference...has anyone else run up against this sort of thing?

The Error is this.

e:\rom24\src\db.c(1542) : error C2065: 'prog_list' : undeclared identifier

This is in the LOAD_MOBPROGS function, and has 4 warnings that I am fairly
sure are a direct result of this.

e:\rom24\src\db.c(1542) : warning C4047: '==' : 'int ' differs in levels of
indirection from 'void *'
e:\rom24\src\db.c(1543) : warning C4047: '=' : 'int ' differs in levels of
indirection from 'struct prog_code *'
e:\rom24\src\db.c(1546) : warning C4047: '=' : 'struct prog_code *' differs
in levels of indirection from 'int '
e:\rom24\src\db.c(1547) : warning C4047: '=' : 'int ' differs in levels of
indirection from 'struct prog_code *'

In the directions to put in the obj and room progs, it basically sais to go
to every instance of mprog_list and change it to prog_list....which I
did....

And that is basically the only real change that was made to this
function....well...let me post the old and new functions here....I just
can't understand why one compiles fine, and the other doesn't when the
difference is a few less "m" characters.  This makes me think that the whole
undeclared thing needs to be fixed elsewhere...but I really have no clue as
to where to look.  So, I am emailing this list in the hopes someone might be
able to give me an idea of where to look to fix this.

*THIS is the pre-change function, that compiles with no warnings.

void load_mobprogs( FILE *fp )
{
    MPROG_CODE *pMprog;

    if ( area_last == NULL )
    {
 bug( "Load_mobprogs: no #AREA seen yet.", 0 );
 exit( 1 );
    }

    for ( ; ; )
    {
 sh_int vnum;
 char letter;

 letter    = fread_letter( fp );
 if ( letter != '#' )
 {
     bug( "Load_mobprogs: # not found.", 0 );
     exit( 1 );
 }

 vnum   = fread_number( fp );
 if ( vnum == 0 )
     break;

 fBootDb = FALSE;
 if ( get_mprog_index( vnum ) != NULL )
 {
     bug( "Load_mobprogs: vnum %d duplicated.", vnum );
     exit( 1 );
 }
 fBootDb = TRUE;

 pMprog  = alloc_perm( sizeof(*pMprog) );
 pMprog->vnum   = vnum;
 pMprog->code   = fread_string( fp );
/*this mprog_list changed to prog_list is what is giving me the trouble*/
 if ( mprog_list == NULL )
     mprog_list = pMprog;
 else
 {
     pMprog->next = mprog_list;
     mprog_list  = pMprog;
 }
 top_mprog_index++;
    }
    return;
}


*THIS is the after-change function, that is giving me this error and 4
warnings.

void load_mobprogs( FILE *fp )
{
    PROG_CODE *pMprog;

    if ( area_last == NULL )
    {
 bug( "Load_mobprogs: no #AREA seen yet.", 0 );
 exit( 1 );
    }

    for ( ; ; )
    {
 sh_int vnum;
 char letter;

 letter    = fread_letter( fp );
 if ( letter != '#' )
 {
     bug( "Load_mobprogs: # not found.", 0 );
     exit( 1 );
 }

 vnum   = fread_number( fp );
 if ( vnum == 0 )
     break;

 fBootDb = FALSE;
 if ( get_prog_index( vnum, PRG_MPROG ) != NULL )
 {
     bug( "Load_mobprogs: vnum %d duplicated.", vnum );
     exit( 1 );
 }
 fBootDb = TRUE;

 pMprog  = alloc_perm( sizeof(*pMprog) );
 pMprog->vnum   = vnum;
 pMprog->code   = fread_string( fp );

/*it is giving me the error about this next prog_list in the 'if' check*/
if ( prog_list == NULL )
     prog_list = pMprog;
 else
 {
     pMprog->next = prog_list;
     prog_list  = pMprog;
 }
 top_mprog_index++;
    }
    return;
}

Reply via email to