Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
41 user(s) are online (25 user(s) are browsing Forums)

Members: 0
Guests: 41

more...

Support us!

Headlines

Report message:*
 

Re: Porting to AmigaOS4 thread

Subject: Re: Porting to AmigaOS4 thread
by jabirulo on 2020/11/22 15:03:51

@Raziel

Alas I don't know if crash/GR will be solved I updated utf8ToLocal() function/method:


...
        
//if (dstmib != CS_MIBENUM_INVALID) { 
        
if(dstmib != NULL) {
            
//LONG dstlen = FSGetByteSize((APTR)in, -1, CS_MIBENUM_UTF_8, dstmib); 
            
ULONG dstlen 0;//ICodesets->CodesetsStrLen(in, TAG_END);
            
STRPTR dst_str ICodesets->CodesetsConvertStr(CSA_SourceCodesetsrcmib,
                                                       
CSA_DestCodeset,   dstmib,
                                                       
CSA_Source,     in,
                                                       
CSA_DestLenPtr, &dstlen,
                                                      
TAG_DONE);
            if( (
dst_str!= NULL) {
                
char *out = (char *)malloc(dstlen 1); 
                if(
out) {
                    
strcpy(outdst_strdstlen);
                    
ICodesets->CodesetsFreeA(dst_strNULL);
IExec->DropInterface( (struct Interface *)ICodesets );
ICodesets NULL;
        
IExec->CloseLibrary(CodesetsBase);
CodesetsBase NULL;
                    return 
out
                }
                
free(out); 
            } 
        } 
...

NOTE: if you get an error with "STRPTR" definition doesn't exists, just change it to "char *"

Does the crash/GR happen too if you click on ASL's CANCEL button?

NOTE2: I suspect "out" will be freed when exit/destroying the Common class.

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project