Author Topic: Backticks in Windows Shell/Code::Blocks?  (Read 17957 times)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #15 on: January 16, 2006, 12:48:06 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

  • Guest
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #16 on: January 16, 2006, 01:22:13 pm »
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.
« Last Edit: January 16, 2006, 01:24:35 pm by Takeshi Miya »

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #17 on: January 16, 2006, 01:23:47 pm »
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

  • Guest
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #18 on: January 16, 2006, 01:27:02 pm »
int is not long.
int on 64 bits platform is 32 bits if I remember well.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #19 on: January 16, 2006, 01:32:09 pm »
Here you go. Revision 1766.
Let us know of your progress :)

thanks i have a good application for using this !

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #20 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?

takeshimiya

  • Guest
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #21 on: January 19, 2006, 02:44:45 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.
« Last Edit: January 19, 2006, 02:46:27 am by Takeshi Miya »

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #22 on: January 19, 2006, 04:59:39 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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Backticks in Windows Shell/Code::Blocks?
« Reply #23 on: January 19, 2006, 05:10:35 pm »
...and you could even insert

Code
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.
« Last Edit: January 19, 2006, 05:12:15 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."