IonicWind Software

Aurora Compiler => General Discussion => Topic started by: sapero on March 23, 2006, 01:44:20 PM

Title: method arguments limitation?
Post by: sapero on March 23, 2006, 01:44:20 PM
while porting MSWord typelibrary to include file, a method called Run with 29 arguments causes the parser to crash.#include "oleidl.inc"
#include "ocidl.inc"
interface IWordApplication/*_Application*/ : IDispatch {
/*cut*/
declare virtual Run(
BSTR *MacroName, VARIANT *varg1, VARIANT *varg2,
VARIANT *varg3, VARIANT *varg4, VARIANT *varg5,
VARIANT *varg6, VARIANT *varg7, VARIANT *varg8,
VARIANT *varg9, VARIANT *varg10, VARIANT *varg11,
VARIANT *varg12, VARIANT *varg13, VARIANT *varg14,
VARIANT *varg15, VARIANT *varg16, VARIANT *varg17,
VARIANT *varg18, VARIANT *varg19, VARIANT *varg20,
VARIANT *varg21, VARIANT *varg22, VARIANT *varg23,
VARIANT *varg24, VARIANT *varg25, VARIANT *varg26,
VARIANT *varg27, VARIANT *varg28, VARIANT *varg29,
VARIANT *varg30, /*out, retval*/ VARIANT *prop),HRESULT;
/*cut*/
}

removed three arguments ant it compiles fine.
I hope 354 methods is no problem for alpha ;D
// to try just remove base class IDispatch
Title: Re: method arguments limitation?
Post by: Parker on March 23, 2006, 01:58:52 PM
There are actually lots of limits, most if not all of which cap off at 100. For example, the number of CASE statements in a SELECT block, the number of nested include files, and the number of subroutine parameters.

What would be nice is if the stacks used changed to a linked list implementation and then the limits would only be based on how much memory you have.

Edit - in this case though, I think the yacc parser has an overflow that's not handled.
Title: Re: method arguments limitation?
Post by: Ionic Wind Support Team on March 23, 2006, 03:13:26 PM
Fixed for the next update.

Thanks,
Paul.
Title: Re: method arguments limitation?
Post by: sapero on March 28, 2006, 01:16:22 PM
compilling a source with errors, named "IPicture.Render().src" I got some errors in build window.
Double clicked in build window and got messagebox:
"D:\Aurora\temp\IPicture.Rende was not found".

I know that problem with errors in include files. Re-saving include file using "save as" helps, but here this trick failed.
Starting Aurora in current directory in /include. Aurora changes currend firectory every time you open a project or use "save as", or something else...

And often including files from default /include folder on error - doubleclick in build window tries to open file from /projects folder :D
Title: Re: method arguments limitation?
Post by: Parker on March 28, 2006, 01:54:20 PM
I've had the include problem before too, it should probably check
a) the project directory
b) the current source file's directory (could differ from project's)
c) the include directory
Title: Re: method arguments limitation?
Post by: sapero on April 15, 2006, 03:02:12 AM
Found another limitation in method name length- max 32 (or 31) characters. File wmsserver.hinterface IWMSPublishingPointCurtrentCounters /* : IDispatch */
{
declare virtual get_OutgoingDistributionAllocatedBandwidth(long *pVal),HRESULT;
}
Title: Re: method arguments limitation?
Post by: Parker on April 15, 2006, 10:12:56 AM
What is the error? The limit is 64 characters, more are allowed just chopped off.
Title: Re: method arguments limitation?
Post by: sapero on April 15, 2006, 10:41:20 AM
I get a crash every time it is parsed. Not only this method/interface.
After cutting method name to 32 characters it compiles.
Here compilation is used to test the conversion from C :)

http://www.sendspace.com/file/yw20il
here are all currently converted includes. Find the wmsserver.inc file, append to it on top #include "com.inc" and try to compile
Title: Re: method arguments limitation?
Post by: Parker on April 15, 2006, 11:08:30 AM
Aha, found it! The problem is not a limit of 32, it is because the class name + length of @ character + length of method name (stored internally as ClassName@MethodName) exceeds 64, and the length isn't checked for. Give me a minute and I'll see if my fix works.
Title: Re: method arguments limitation?
Post by: Ionic Wind Support Team on April 15, 2006, 10:06:53 PM
Fixed for the Alpha 3 update