Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

benign redefinition of type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bonj - 31 Oct 2004 02:15 GMT
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?
Bonj - 31 Oct 2004 03:39 GMT
i figured it don't worry

> Hello
> I am trying to compile a dll with the below code used to search through an
[quoted text clipped - 92 lines]
>
> Any other ideas?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.