From: Frank K. <fbk...@at...> - 2003-06-13 18:52:27
|
Alexei A. Frounze wrote: [fbk] >>One thing I can see that will have to go is the "//" style comments. (I >>told ya we were quaint!). That's something I think I can fix myself :) > > Weird. Include a ... either syntax policy or something or a beautifier to > the NASM package then :) Okay. Write one up :) >>More troubling is the fact that if I do "nasm -f bin -o incbin.com >>incbin.asm" - no "-I" switch at all - Nasm segfaults! This is with a >>djgpp build of Nasm. I haven't tried other builds, or tried to track it >>down much. I'll look for it - just wanted to let you know I *did* find a >>problem. > > Damn! I lost one pointer check and I got away with it under w2k, though it > appeared in DOS7. > This is how it should be done: > > char** > pp_get_include_path_ptr (char **pPrevPath) > { > #define GetMemberOffset(StructType,MemberName)\ > ((size_t)&((StructType*)0)->MemberName) > IncPath *i; > > if (pPrevPath == NULL) > { > if (ipath != NULL) > return &ipath->path; > else > return NULL; > } > > i = (IncPath*) ((char*)pPrevPath - GetMemberOffset(IncPath,path)); > i = i->next; > if (i != NULL) > return &i->path; > else > return NULL; > #undef GetMemberOffset > } Yep! That seems to get it. Thanks, Alexei! Anyone else got comments on this? Are Alexei and I the only ones who think this is a good idea? Anyone think it's a bad idea? > P.S. Sorry, it was unintentional. I shouldn't be doing programming at night > time, it's not working good that way :) Can you program in the daytime??? Must try that. :) Best, Frank |