Welcome, Guest. Please login or register.

Author Topic: We need an iBrowse replacement for 68k!!!  (Read 75318 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #539 from previous page: February 27, 2015, 11:01:50 AM »
Quote from: matthey;785455
I wonder if there is a parsing bug in your version of GCC.


I doubt it.  There would be many more problems than this if there was.

Quote
I believe these are optional inlines instead of using the default stubs so if you can't format the function so GCC will accept it then try commenting it out.


Just get errors about there being no NewObject function.

I think all that is required is to tell GCC that the varargs are used so it doesn't optimise them away.  I can't figure out how to do that though.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline utri007

Re: We need an iBrowse replacement for 68k!!!
« Reply #540 on: February 27, 2015, 07:09:21 PM »
Maybe PeterK can help with scaling/dithering etc stuff? If I remember correctly he has offered his code to other projects with similar problems? He is a creator of new version of icon.library
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #541 on: February 27, 2015, 10:46:01 PM »
Quote from: chris;785519
I doubt it.  There would be many more problems than this if there was.


GCC used to have minor parsing bugs. My GCC NOTES-3.4.0 has this:

Quote

Another bug exists with explicit regsister arguments and function pointers:

void (*testfunc) (void (*)(int) __asm("a3));

The compiler says:

error: parse error before ')' token

However, if the above is rewritten like this:

void (*testfunc) (void (*dummy)(int) __asm("a3));

then everything works. This bug was found by Fabio Alemagna in the GCC 3.3 port and is still present.


It's interesting as this is the same parse error you get when the brackets appear to match.

Quote from: chris;785519

Just get errors about there being no NewObject function.

I think all that is required is to tell GCC that the varargs are used so it doesn't optimise them away.  I can't figure out how to do that though.


The define is defining a normal function. You could try:

Code: [Select]

#define NewObject(classPtr, classID, tags...) \
({\
ULONG _tags[] = {tags};\
NewObjectA((classPtr), (classID), (const struct TagItem *) _tags);\
})


More lines may help to find what the compiler doesn't like if the line the error is on is given. If this doesn't work, maybe it would be possible to make NewObject into a regular function:

Code: [Select]

NewObject(classPtr, classID, tags...)
{
ULONG _tags[] = {tags};
NewObjectA(classPtr, classID, (const struct TagItem *) _tags);
}


I'm hoping that either the different formatting or an error message with a line number would help pinpoint the problem or, perhaps, the error would go away.
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #542 on: February 27, 2015, 11:30:48 PM »
Quote from: matthey;785561
More lines may help to find what the compiler doesn't like if the line the error is on is given. If this doesn't work, maybe it would be possible to make NewObject into a regular function:

Code: [Select]
NewObject(classPtr, classID, tags...)
{
ULONG _tags[] = {tags};
NewObjectA(classPtr, classID, (const struct TagItem *) _tags);
}

I'm hoping that either the different formatting or an error message with a line number would help pinpoint the problem or, perhaps, the error would go away.

I'd tried that already (as an inline function though) and it complained that classPtr, ClassID etc weren't defined, which is an even stranger error.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #543 on: February 28, 2015, 12:23:44 AM »
Quote from: chris;785563
I'd tried that already (as an inline function though) and it complained that classPtr, ClassID etc weren't defined, which is an even stranger error.

That is strange. The function arguments shouldn't need defining in the function. The function needs defining which it already is in os-include/clib/inution_protos,h with the argument types given.

You do have to be careful with "inline" functions (especially "extern inline") as C99 requires handling which may be incompatible with earlier versions of C. This is a really excellent article:

http://www.drdobbs.com/the-new-c-inline-functions/184401540

The NetSurf compiler options use -std=c99 so GCC will try to follow the standard instead of it's normal non-strict forgiving C standard mode. I wouldn't think this would be a problem in this case but I have had problems with this before. An easy way to check if this is a problem is to remove the "inline".
« Last Edit: February 28, 2015, 12:26:35 AM by matthey »
 

Offline Joloo

Re: We need an iBrowse replacement for 68k!!!
« Reply #544 on: February 28, 2015, 12:02:43 PM »
Variadic functions of Intuition were always trouble makers for different versions of GCC compilers and m68k.
Instead of creating inline code use the amiga.lib provided code, which works flawlessly for Intuition/MUI/ReAction.

Code: [Select]

#include <proto/...>
#include <proto/...>
#if defined(__GNUC__) && !defined(__amigaos4__)
#define NO_INLINE_STDARG /* Take f.e. NewObject() from amiga.lib for gcc m68k */
#include <clib/intuition_protos.h>
#include <proto/intuition.h>
#undef NO_INLINE_STDARG
#else
#include <proto/intuition.h> /* Take/Create inline code f.e. for NewObject() */
#endif
#include <proto/...>
#include <proto/...>
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #545 on: February 28, 2015, 12:25:45 PM »
Quote from: Joloo;785604
Variadic functions of Intuition were always trouble makers for different versions of GCC compilers and m68k.
Instead of creating inline code use the amiga.lib provided code, which works flawlessly for Intuition/MUI/ReAction.

Code: [Select]

#include <proto/...>
#include <proto/...>
#if defined(__GNUC__) && !defined(__amigaos4__)
#define NO_INLINE_STDARG /* Take f.e. NewObject() from amiga.lib for gcc m68k */
#include <clib/intuition_protos.h>
#include <proto/intuition.h>
#undef NO_INLINE_STDARG
#else
#include <proto/intuition.h> /* Take/Create inline code f.e. for NewObject() */
#endif
#include <proto/...>
#include <proto/...>


That might have worked, had clib2 actually had NewObject in libamiga.

I suppose I could use a different libamiga.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #546 on: February 28, 2015, 12:31:59 PM »
Quote from: matthey;785572
That is strange. The function arguments shouldn't need defining in the function. The function needs defining which it already is in os-include/clib/inution_protos,h with the argument types given.


I think it's because "ULONG tags..." isn't a valid definition for a proper function.

I'm getting errors even when the #define is just:
Code: [Select]

({ \
})


"syntax error before ')'" and "unterminated argument list".

Code: [Select]

if((arexx_obj = ARexxObj,
AREXX_HostName,"NETSURF",
AREXX_Commands,Commands,
AREXX_NoSlot,TRUE,
AREXX_ReplyHook,NULL,
AREXX_DefExtension,"nsrx",
End))
{
...etc...


When ArexxObj is:
Code: [Select]

#define ARexxObj NewObject(ARexxClass, NULL


And End is the standard one from reaction_macros which IIRC is "TAG_END)"
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #547 on: February 28, 2015, 04:58:13 PM »
Quote from: chris;785609
I think it's because "ULONG tags..." isn't a valid definition for a proper function.

I'm getting errors even when the #define is just:
Code: [Select]
({ \
})

"syntax error before ')'" and "unterminated argument list".

It's not possible to have all the arguments as varargs. Also, "ULONG tags ..." is not allowed with C99. C99 only allows "..." but the default GCC compile mode may have a GCCism extension which allows for better type checking. The NetSurf makefile sets C99 mode for compiling perhaps turning off the extension which allows "ULONG tags ..." and restricting varargs use to C99 "...". This would also mean that the os-includes are using GCCisms which are not compatible with C99 and possibly the reason for the tag list bugs. At least for your little test, you could try rewriting as C99 compliant varargs functions. There is more info here:

http://en.wikipedia.org/wiki/Variadic_function
http://en.wikipedia.org/wiki/Stdarg.h
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #548 on: March 01, 2015, 11:30:32 AM »
Quote from: matthey;785630
It's not possible to have all the arguments as varargs. Also, "ULONG tags ..." is not allowed with C99. C99 only allows "..." but the default GCC compile mode may have a GCCism extension which allows for better type checking.

I think it's fine for a #define, just not for a function, the two work differently.  If it wasn't then all the other varargs stub inlines would be broken too.

I've uploaded a version with the libraries built for 68020, to see whether that makes any speed difference.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline utri007

Re: We need an iBrowse replacement for 68k!!!
« Reply #549 on: March 01, 2015, 06:00:35 PM »
This one seems to almost work with my Amigas. It started quite well until it stopped here :

https://zjolha.bl3301.livefilestore.com/y2p_oTIJO0NUuJ3ccjcUASlWshjv9dsvY9BFZ11bRcqoUdsE1BtTbocsb-8KBFLSAfOcJFsz-ZdWTOEw7vfI4RrOIi0ZlrPby9VnUHKbcdouTpsHWpx1A59Sf5gN1OEqf6N7ZVe4whtDPWAdB7EyxuuBQ/WP_20150301_003.jpg

Few seconds more and computer crashes. Are those .otag fonts outlined fonts? Do I need to remove them?

Second time it also gave  me this :

https://zjolha.bl3301.livefilestore.com/y2pYWs2LVj2nr5kyGzs1o5hPC5VLK-DQZxSLVNryGCjNVK7Xx4bSJ4JOCijdMMgwsbW1yesdbjea6mCt-yB1QMFs1OmXs09JJ9-nkMPnPDlMjnhtfB7WA-TsIVb2Eks_bty15b1Je2B3JYSPzldbyEeww/WP_20150301_002.jpg

With Jump RTS I could continue until first error repeated.
ACube Sam 440ep Flex 800mhz, 1gb ram and 240gb hd and OS4.1FE
A1200 Micronic tower, OS3.9, Apollo 060 66mhz, xPert Merlin, Delfina Lite and Micronic Scandy, 500Gb hd, 66mb ram, DVD-burner and WLAN.
A1200 desktop, OS3.9, Blizzard 060 66mhz, 66mb ram, Ide Fix Express with 160Gb HD and WLAN
A500 OS2.1, GVP+HD8 with 4mb ram, 1mb chip ram and 4gb HD
Commodore CDTV KS3.1, 1mb chip, 4mb fast ram and IDE HD
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #550 on: March 01, 2015, 07:21:23 PM »
Quote from: chris;785676
I think it's fine for a #define, just not for a function, the two work differently.  If it wasn't then all the other varargs stub inlines would be broken too.

Most of the other inline defines are assigning registers to arguments which is like a more complete function definition. The NewObject() define is defining a complete function. It's confusing because they are both macros and using the pre-processor makes it more difficult to see what the result is. I still believe there is a small chance that the c99 strict mode (-std=c99) may disable some GCC specific functionality to better conform with the C99 spec. It might work with (-std=gnu99) but it would take some time to test.

Quote from: chris;785676
I've uploaded a version with the libraries built for 68020, to see whether that makes any speed difference.

The NetSurf archive I downloaded today is 3104254 bytes which is the same as the one I downloaded on February 23. The executable is also the same size.

Quote from: utri007;785695
This one seems to almost work with my Amigas. It started quite well until it stopped here :

That 1st attempt made it pretty far.

Quote from: utri007;785695
Few seconds more and computer crashes. Are those .otag fonts outlined fonts? Do I need to remove them?

The .otag files in FONTS: have some info but the main font data is in FONTS:_Bullet_Outlines. I have many outline fonts installed and everything is working for me. Since I have a working system, let's start by checking your library versions. I am using:

diskfont.library 45.7 (01/26/02)
bullet.library 44.1 (05/01/99)

If the libraries match, you might try creating a font directory somewhere, copying a subset of the fonts you are using now into it and doing an "ASSIGN FONTS: MYHD:fonts" and then use Sys:System/FixFonts. Rebooting should restore your previous FONTS: assignment. It's possible that some corrupt font data or definitions are causing a problem.
« Last Edit: March 01, 2015, 07:43:56 PM by matthey »
 

Offline wawrzon

Re: We need an iBrowse replacement for 68k!!!
« Reply #551 on: March 01, 2015, 07:37:31 PM »
Quote from: utri007;785695
This one seems to almost work with my Amigas. It started quite well until it stopped here :

https://zjolha.bl3301.livefilestore.com/y2p_oTIJO0NUuJ3ccjcUASlWshjv9dsvY9BFZ11bRcqoUdsE1BtTbocsb-8KBFLSAfOcJFsz-ZdWTOEw7vfI4RrOIi0ZlrPby9VnUHKbcdouTpsHWpx1A59Sf5gN1OEqf6N7ZVe4whtDPWAdB7EyxuuBQ/WP_20150301_003.jpg

Few seconds more and computer crashes. Are those .otag fonts outlined fonts? Do I need to remove them?

Second time it also gave  me this :

https://zjolha.bl3301.livefilestore.com/y2pYWs2LVj2nr5kyGzs1o5hPC5VLK-DQZxSLVNryGCjNVK7Xx4bSJ4JOCijdMMgwsbW1yesdbjea6mCt-yB1QMFs1OmXs09JJ9-nkMPnPDlMjnhtfB7WA-TsIVb2Eks_bty15b1Je2B3JYSPzldbyEeww/WP_20150301_002.jpg

With Jump RTS I could continue until first error repeated.

im not sure if i see a difference here, these are errors you have reported last time and if matt is right then the version you downloaded might be still the old one.
what concerns the fonts, this is what i would definitely do. no need to ask, try to narrow down the problem on your own. the log entry is not very clear if the presence or absence of the font is the problem, therefore i expected it to be absence (return value seems to be 0), but maybe too big size may be an issue.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #552 on: March 01, 2015, 08:58:39 PM »
Quote from: wawrzon;785701
... but maybe too big size may be an issue.


I wonder if the size could be an issue on low memory Amigas. Scalable font sizes have to be created when requested unless a size was created with SYS:System/Intellifont and already exists (creating sizes is an option for users with adequate HD space but not enough memory). I wonder how many scalable fonts are opened still with the mapping to bitmap fonts in Choices?
 

Offline wawrzon

Re: We need an iBrowse replacement for 68k!!!
« Reply #553 on: March 01, 2015, 09:29:15 PM »
yes, but i would expect rather ttf fonts in this respect, like dejavu collection, few 100kb each.
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #554 on: March 01, 2015, 09:56:29 PM »
Quote from: matthey;785708
I wonder how many scalable fonts are opened still with the mapping to bitmap fonts in Choices?

If you've set the fonts to be bitmap ones, then none :-)

Quote
The NetSurf archive I downloaded today is 3104254 bytes which is the same as the one I downloaded on February 23. The executable is also the same size.

I've re-uploaded it.  Not sure what happened last time but it should be there now.

Quote from: utri007
Few seconds more and computer crashes. Are those .otag fonts outlined fonts? Do I need to remove them?

Try running FixFonts.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz