i figured it don't worry
[quoted text, click to view] "Bonj" <benjtaylor at hotpop d0t com> wrote in message
news:O7EUbcuvEHA.3276@TK2MSFTNGP15.phx.gbl...
> 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[i];
> 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?
>
>