News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

unknown exception

Started by grv575, December 16, 2005, 02:35:25 AM

Previous topic - Next topic

280Z28

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:

280Z28

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:

280Z28

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:

thomas

#18
Maybe not necessary any more (rewriting TiX).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

thomas

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."

thomas

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."

280Z28

#21
Quote from: thomas 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 :)

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?
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
Check out The Sam Zone :cool:

rickg22

Quote from: 280Z28 on December 16, 2005, 03:39:13 PM
Should I add it to SourceForge too since I already posted it, but not in the right place?

Yes! VERY YES!

280Z28

Quote from: rickg22 on December 16, 2005, 05:16:16 PM
Quote from: 280Z28 on December 16, 2005, 03:39:13 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:

thomas

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."

280Z28

Quote from: thomas 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.

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:

thomas

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."

grv575

The wxChar* doesn't compile (it's expecting wxCharBuffer).  Anyway the following does:


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).

thomas

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."

280Z28

#29
Quote from: thomas 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.

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.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
Check out The Sam Zone :cool: