Author Topic: unknown exception  (Read 38442 times)

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: unknown exception
« Reply #15 on: December 16, 2005, 09:26:41 am »
I'm working on it but... not getting anywhere.  :?
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: unknown exception
« Reply #16 on: December 16, 2005, 09:44:15 am »
Ok I got it to compile in Unicode. My dear....

Now, I wonder if I fixed that bug... probably not. :o
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: unknown exception
« Reply #17 on: December 16, 2005, 10:13:16 am »
OK I fixed this.

All that's left now is getting a Unicode enabled XML library. I can convert TinyXML, but is there something faster?

It's a pretty easy conversion really.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: unknown exception
« Reply #18 on: December 16, 2005, 11:43:55 am »
Maybe not necessary any more (rewriting TiX).
« Last Edit: December 16, 2005, 01:36:41 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: unknown exception
« Reply #19 on: December 16, 2005, 01:36:14 pm »
Regarding the CRC calculation (which is definitely the reason for the exception), I am rather sure it will work if const char* is replaced by const wxChar* in crc32.cpp, line 96.
That's because wxCharBuffer uses wchar in Unicode, so the pointer arithmetic inside the CRC calculation is not good.

However, I have no way to test it because Code::Blocks wx-Unicode won't link on my machine.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: unknown exception
« Reply #20 on: December 16, 2005, 01:54:14 pm »
I have modified crc32.cpp in HEAD accordingly even though I can't test if that fixes the bug.

It is not worse in any case, and if that was the cause, the problem is fixed now :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: unknown exception
« Reply #21 on: December 16, 2005, 03:39:13 pm »
I have modified crc32.cpp in HEAD accordingly even though I can't test if that fixes the bug.

It is not worse in any case, and if that was the cause, the problem is fixed now :)

I fixed that error already, and not like that. That wasn't the problem...... I can send a patch once the dialog positioning code is checked in??

Edit: Where did I post my patch? I can't find it loolll!! Maybe it's still just here on my desktop.  :x

Edit: It's in my final post in the thread about it. I am sorry. :( Should I add it to SourceForge too since I already posted it, but not in the right place?
« Last Edit: December 16, 2005, 03:43:20 pm by 280Z28 »
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: unknown exception
« Reply #22 on: December 16, 2005, 05:16:16 pm »
Should I add it to SourceForge too since I already posted it, but not in the right place?

Yes! VERY YES!

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: unknown exception
« Reply #23 on: December 16, 2005, 05:19:51 pm »
Should I add it to SourceForge too since I already posted it, but not in the right place?

Yes! VERY YES!

Already done a while ago :) Hopefully I remember in the future :oops:
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: unknown exception
« Reply #24 on: December 16, 2005, 05:28:42 pm »
Why do you keep telling that... I have been looking both under "bugs" and under "patches". It is not there.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: unknown exception
« Reply #25 on: December 16, 2005, 05:51:21 pm »
Why do you keep telling that... I have been looking both under "bugs" and under "patches". It is not there.

Ohhhhh I was talking about the positioning patch. It's the only one I've submitted because it's going to very hard to isolate the others while the diff shows 50 files were changed. I'm waiting for that one and then I have 5 or so more patches in a row I'll put of SF. ;)
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: unknown exception
« Reply #26 on: December 16, 2005, 06:14:59 pm »
Well you know... bluntly speaking, the positioning patch is really not important. Those are cosmetics.

Grv575 cannot use Code::Blocks because of the bug in the CRC calculation - this is a showstopper.
It effectively prevents him from using Code::Blocks alltogether (and not him alone, many people who use Unicode).

So if you have really solved that problem, then it would maybe a good idea if you made this patch a number 1 priority. Or you could at least describe what is wrong, then we can patch it by hand. You know, reading "I have fixed it long ago" over and over is quite annoying if it does not work for you personally...  put yourself into that position.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: unknown exception
« Reply #27 on: December 16, 2005, 06:15:50 pm »
The wxChar* doesn't compile (it's expecting wxCharBuffer).  Anyway the following does:

Code: [Select]
unsigned long wxCrc32::FromString(const wxString& text)
{
    static unsigned long *crc_table = NULL;
    unsigned long crc = 0;
    ///const char* p = text.mb_str(wxConvUTF8);
    int i = 0;
    ///const wxCharBuffer wxcb = text.mb_str(wxConvUTF8);

    if (text)
    {
        // Get the crc table, on first call, generate, otherwise do nothing
        crc_table = GetCRC32Table( crc_table ) ;

        // Do we have a crc table?
        if ( crc_table )
        {
            // Calculate the checksum
            crc = 0xFFFFFFFFUL;
            while (text[i])
                { crc = (crc>>8) ^ crc_table[ (crc^(text[i++])) & 0xFF ]; }

            crc ^= 0xFFFFFFFFUL ;
        }
    }

    // If we have a crc table, delete it from memory
    if ( crc_table ) { delete[] crc_table; }

    // Set it to a null pointer, the have it (re)created on next calls to this
    // function
    crc_table = NULL;

    // Return the checksum result
    return( crc ) ;
}

But that's not the whole cause.  Set a breakpoint (pending bps are $$$ btw) and trace to:
   if ( crc_table )
and it crashes.  Must be something in the crc table funcion above (and I must admit, I'm not wx unicode expert).

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: unknown exception
« Reply #28 on: December 16, 2005, 06:18:05 pm »
I am not getting Code::Blocks to link with Unicode. It does not find various XRC related stuff :(

So I cannot work on this, sorry.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: unknown exception
« Reply #29 on: December 16, 2005, 06:26:06 pm »
Well you know... bluntly speaking, the positioning patch is really not important. Those are cosmetics.

Grv575 cannot use Code::Blocks because of the bug in the CRC calculation - this is a showstopper.
It effectively prevents him from using Code::Blocks alltogether (and not him alone, many people who use Unicode).

So if you have really solved that problem, then it would maybe a good idea if you made this patch a number 1 priority. Or you could at least describe what is wrong, then we can patch it by hand. You know, reading "I have fixed it long ago" over and over is quite annoying if it does not work for you personally...  put yourself into that position.

Please, all I ask is you patch the one single patch I posted already so I can get a diff of this one. :( I'm not trying to be a ***** about it. Seriously, it's just that there are a lot of files that show up in "svn status" and then I have to do a diff on every single one to find the interspersed other patches. With the dialog patch committed, "svn status" will return a much smaller number of files and I'll be able to easily post patches for the other issues. I posted another patch just now actually... a 2-liner. I'm at work and don't have my SF password so it says I'm a nobody lol. It's the auto-complete spacing patch on SF. But yes the one I'm stuck on for svn status is the dialog one.
« Last Edit: December 16, 2005, 06:29:09 pm by 280Z28 »
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool: