benign redefinition of type

B

Bonj

Hello
I am trying to compile a dll with the below code used to search through an
array of node structures.
I am getting the following warning unfortunately:

//wordsmain.c
#include <windows.h>
#include "resource.h"

typedef struct tagNODE
{
long StartCharNo,
EndCharNo,
NumChars,
NumChildren,
Type,
NextSibling;
char Chars[32];
long Children[24];
} NODE;


BOOL dataloaded = FALSE;
NODE* pData = NULL;

extern IMAGE_DOS_HEADER __ImageBase;
#define HMOD_THISCOMPONENT ((HMODULE)&__ImageBase)

void LoadData()
{
HRSRC hRsrc;
if(dataloaded) return;
hRsrc = FindResource(HMOD_THISCOMPONENT, MAKEINTRESOURCE(IDR_NODES),
"NODES");
if(hRsrc != NULL)
{
HGLOBAL hgData = LoadResource(HMOD_THISCOMPONENT, hRsrc);
if(hgData != NULL)
{
pData = (NODE*)LockResource(hgData);
dataloaded = TRUE;
}
} //hRsrc != NULL
}

long SearchMultipleNodes(long nodenum, char* test, long length, long* resm)
{
NODE* startnode = pData + nodenum;
while(nodenum != -1)
{
long relation = SearchNode(nodenum, test, length, resm);
if(relation > 0) return 1;
if(relation < 0) return -1;
nodenum = ((NODE*)(pData + nodenum))->NextSibling;
}
return -2;
}

long SearchNode(long nodenum, char* test, long length, long* res)
{ // ******* C4142 : benign redefinition of type occurs on this line
************
NODE* node = pData + nodenum;
long i, comp = 0;
for(i = node->StartCharNo; i <= node->EndCharNo; i++)
{
char ctest, cme;
if(i >= length) return 1;
ctest = test;
cme = node->Chars[i - node->StartCharNo];
if(ctest == cme) continue;
return (ctest < cme) ? -1 : 1;
}
if((node->Type != -1) && ((length - 1) == node->EndCharNo))
{
*res = node->Type;
return 0;
}
if(node->NumChildren > 0)
return SearchMultipleNodes(node->Children[0], test, length, res);
else return -2;
}

long GetWordType(char* test, long length)
{
long typeres,
res = SearchMultipleNodes(0, test, length, &typeres);
if(res == -2) return res;
else return typeres;
}

My compilation options are
cl /Zi /c /nologo wordsmain.c
should I be using more? it seems a pretty flimsy command line.
I can't find 'owt on't. tinternet about it.

Any other ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top