News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Backticks in Windows Shell/Code::Blocks?

Started by takeshimiya, January 16, 2006, 08:47:21 AM

Previous topic - Next topic

mandrav

Quote from: Takeshi Miya on January 16, 2006, 12:35:42 PM
I couldn't compile C::B on it yet (lot's of AngelScript errors, and it isn't #ifdef'ed...).

If you fix them, please send me a patch. It 'd be nice to make AngelScript 64bit compatible :)
Be patient!
This bug will be fixed soon...

takeshimiya

#16
No problem, just I don't know how to fix them properly (commenting some offending lines makes it compile more).

Because I don't know this kind of things (AngelScript):
currentObject = (void*)(int(currentObject) + sysFunc->baseOffset);

error: cast from 'void*' to 'int' loses precision

Or wxAUI (for what is a random string created??):
// if the pane's name identifier is blank, create a random string
if (pinfo.name.IsEmpty())
{
   pinfo.name.Printf(wxT("%08x%08x%08x%08x"),
             (unsigned int)pinfo.window, (unsigned int)time(NULL),
             (unsigned int)clock(), m_panes.GetCount());
}


error: cast from 'wxWindow*' to 'unsigned int' loses precision

More compiler errors (castings):
error: invalid conversion from 'void* (*)(size_t)throw ()' to 'void* (*)(asUINT)'

And linker errors (probably related to x86 optimizations of calling conventions for system functions?):
libcodeblocks.so: undefined reference to `PrepareSystemFunction(asCScriptFunction*, asSSystemFunctionInterface*, asCScriptEngine*)'
libcodeblocks.so: undefined reference to `CallSystemFunction(int, asCContext*, void*)'
libcodeblocks.so: undefined reference to `DetectCallingConvention(bool, asUPtr const&, int, asSSystemFunctionInterface*)'


And more fun :)

I just couldn't try more because I gave little space to the linux partition and soon became full.
I'll have to burn some data, and then resize the ntfs and give more to the reiserfs one.

280Z28

void* can be stored in a long or unsigned long without losing precision.

Edit: On 32bit and 64bit systems, long and ptr are the same size.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
Check out The Sam Zone :cool:

takeshimiya

int is not long.
int on 64 bits platform is 32 bits if I remember well.

tiwag

Quote from: mandrav on January 16, 2006, 12:25:14 PM
Here you go. Revision 1766.
Let us know of your progress :)

thanks i have a good application for using this !

rickg22

Just a question, why does angelscript deal with void* typecasting? O.o What dark and obscure magic does it use?

takeshimiya

#21
Quote from: rickg22 on January 19, 2006, 01:18:18 AM
Just a question, why does angelscript deal with void* typecasting? O.o What dark and obscure magic does it use?

It's filled with void* all over the place. :D
I guess it's the most fastest way to bind functions. There are other ways more elegant and correct (like the ones in boost::function and boost::bind), but aren't as fast.

Game_Ender

Quote from: Takeshi Miya on January 16, 2006, 01:27:02 PM
int is not long.
int on 64 bits platform is 32 bits if I remember well.

In most cases on 64 bit platforms long size = 64 bits = ptr size and on 32 bit platforms long size = 32 bits = ptr size.  So you could change all those int's to long's.  Or you could replace them with a typedef and have that controlled by a define like "PLATFORM_64_BIT".  That way on 32 bit it stays like it is and 64 bit it is proper.

thomas

#23
...and you could even insert

if(sizeof(long) != sizeof(void*))
    cbThrow(_T("Doom is upon us, the evil seed of pointer hacks spreads. Run! Run!"));


at an early point to be 100% sure you know why your code crashes if it does.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."