Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
85 user(s) are online (44 user(s) are browsing Forums)

Members: 1
Guests: 84

BSzili, more...

Headlines

 
  Register To Post  

« 1 (2)
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
Here is a proto file from AWeb

#ifndef PROTO_AWEBJS_H
#define PROTO_AWEBJS_H

/*
**      $Id: awebjs.h,v 1.4 2005/01/25 19:09:29 falemagn Exp $
**      Includes Release 50.1
**
**      Prototype/inline/pragma header file combo
**
**      (C) Copyright 2003-2004 Amiga, Inc.
**          All Rights Reserved
*/

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef LIBRARIES_AWEBJS_H
#include <libraries/awebjs.h>
#endif

/****************************************************************************/

#ifndef __NOLIBBASE__
 #ifndef __USE_BASETYPE__
  
extern struct Library AWebJSBase;
 
#else
  
extern struct AWebJSBase AWebJSBase;
 
#endif /* __USE_BASETYPE__ */
#endif /* __NOLIBBASE__ */

/****************************************************************************/

#ifdef __amigaos4__
 #include <interfaces/awebjs.h>
 #ifdef __USE_INLINE__
  #include <inline4/awebjs.h>
 #endif /* __USE_INLINE__ */
 #ifndef CLIB_AWEBJS_PROTOS_H
  #define CLIB_AWEBJS_PROTOS_H 1
 #endif /* CLIB_AWEBJS_PROTOS_H */
 #ifndef __NOGLOBALIFACE__
  
extern struct AWebJSIFace *IAWebJS;
 
#endif /* __NOGLOBALIFACE__ */
#elif defined __AROS__
 #include <defines/awebjs.h>
#else
 #ifndef CLIB_AWEBJS_PROTOS_H
  #include <clib/awebjs_protos.h>
 #endif /* CLIB_AWEBJS_PROTOS_H */
 #if defined(__GNUC__)
  #ifndef __PPC__
   #include <inline/awebjs.h>
  #else
   #include <ppcinline/awebjs.h>
  #endif /* __PPC__ */
 #elif defined(__VBCC__)
  #ifndef __PPC__
   #include <inline/awebjs_protos.h>
  #endif /* __PPC__ */
 #else
  #include <pragmas/awebjs_pragmas.h>
 #endif /* __GNUC__ */
#endif /* __amigaos4__ */

/****************************************************************************/

#endif /* PROTO_AWEBJS_H */


I think it was auto generated but I can't remeber by what tool.

You need to create your 68k inlines etc with fd2prgama and your 0s4 inlines etc with idltool (use fd2pragma to make a xml file for idltool) your morphos ones with the appropriate tool (fd2pragma?))

Then replace the proto/file with one like the above. Works for all known operating systems ...


Go to top
Re: LibNode, iobsoletes, inlines vs protos
Just can't stay away
Just can't stay away


See User information
@broadblues

That is how idltool generated proto files look.

Personally I don't see what the problem is though with generating different includes for AOS 4.x, AOS 3.x, AROS, storing them in their own include directories and then simply setting in the compiler flags either of -Iinclude/ppc-aos, -Iinclude/m68k-aos, -Iinclude/aros depending on what target system you are compiling for.

Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@salas00
Quote:

Personally I don't see what the problem is though with generating different includes for AOS 4.x, AOS 3.x, AROS, storing them in their own include directories and then simply setting in the compiler flags either of -Iinclude/ppc-aos, -Iinclude/m68k-aos, -Iinclude/aros depending on what target system you are compiling for.


Yep, im going that way now:

1). via fd2pragma generate .sfd files from .fd ones (still with some manual typing, as fd2pragma sometime skips some functions)
2). via fdtrans generate .xml from .sfd
3). via idltool generate proto/etc from .xml
4) create "include/amigaos4/" directory in root of main code and put all the os4 specific stuff here
5) add -Iinclude/amigaos4/ to makefile

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@all
Is there any tool which will generate for me automatically library.l.main (so i can build native binaries and use 68k version of library from) ? I assume it is "fdtrans" with -s (generate ppc->m68k cross-call stubs), but if so, then what should i do with file which fdtrans will build for me, just compile it as object and rename to library.l.main ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: LibNode, iobsoletes, inlines vs protos
Just can't stay away
Just can't stay away


See User information
@kas1e

There's a guide on Thomas Rapp's homepage for generating .l.main files:
http://thomas-rapp.homepage.t-online.de/ppclib.html

What it doesn't mention is that you have to manually add VARARGS68K to any varargs functions (because fdtrans doesn't add it) or otherwise they won't work.

I seem to remember his guide mentioning to use idltool to generate library skeleton code from the .xml file and modify the Makefile from that but maybe he has updated it since then.

Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@salas00

Right, its almost the same as in Thomas's article, only with one difference: need rename "main_vectors" value to "main_v1_vectors". Seems also some kind of typo. I retested it with jpeg library and some simply-native test case: all works.

So then i go the same way for 68k version of original dopus5.library. Thats what i do for first tests:

1. create simple proto file with 1 single function from library:
Quote:

ULONG strConcat (char *buf, char *cat, lim);


2. create simply fd file with the same 1 single function and usuall stuff at top/bottom:
"dopus5.library"
##base _DopusBase
##bias 30
##public
StrConcat(s1,s2,len)(a0,a1,d0)
##end


3. Generate xml, vectors and includes:
Quote:

8/0.Work:dopus5_os4_work/test> fd2pragma my.fd clib proto.h special 140
SourceFile: my.fd
ResultFile: dopus.xml

8/0.Work:dopus5_os4_work/test> fd2pragma my.fd clib proto.h special 141
SourceFile: my.fd
ResultFile: dopus.c

8/0.Work:dopus5_os4_work/test> idltool -p -i -n -c dopus.xml


4. Add then in dopus.c including of interfaces/dopus.h, as well as rename main_vectors to main_v1_vectors, and compile dopus5.l.main:
Quote:

8/1.Work:dopus5_os4_work/test> gcc -Iinclude -nostartfiles dopus.c -o dopus5.l.main


5. compile such a simply test-case which should just strconcat (function from dopus5.library) 2 buffers and print them:
// gcc test.c -Iinclude


#include <proto/exec.h>
#include <proto/dopus.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct Library *DOpusBase;
struct DopusIFace *IDopus;

void main(int argc,char **argv)
{
    
char buffer[256] = "First part-";
    
char *concat "Second part";

    
// Need dopus library
    
if (!(DOpusBase=IExec->OpenLibrary("PROGDIR:dopus5.library",1L))) {
        
printf("cant library");
        exit(
10);
    };
    if (!(
IDopus=IExec->GetInterface((struct Library *)DOpusBase,"main",1L,NULL))) {
        
printf("cant interface");
       exit(
10);
   };

    
IDopus->StrConcat(bufferconcat36);
    
printf("Result=%s\n"buffer);

    
IExec->CloseLibrary(DOpusBase);
}


Run it, and it only show me first part of buffer (i.e. StrConcat do not runs from library). I then run in the same directory 1:1 the same test case but compiled for 68k (just no ifaces, etc), and it show me 2 buffers as it should.

Question is: wtf ? I mean, why it didn't works from native binary ? Did i miss something important like "you can't use one single function because you need to know offsets or blablabab" ? Or maybe numbers of pragmas for sasc (like in case with StrConcat its:
Quote:

#pragma libcall DOpusBase StrConcat 47a 09803


Can somehow make a differences of how i do FD/Clib file ?


Edited by kas1e on 2013/3/28 13:31:56
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
You need the sfd file or the fd file and the clib file

you can't just make an interface for one function (not without making a fake fd file anyway) as all the offsets will be wrong.

I suprised it did nothing, it ought to have crashed!



Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@Andy
Sure i use fd/sfd, and want to create a fake fd file with just one single function. dopus5 code do not have normal clib2 protos(only pragmas), so i must create all clib2 protos manually just with basing on fd, pragma and some prototypes which all chaotic in different includes.

So, for understanding how all of this to do, i need to test if all works with fake fd and just one single function. how can i do that ? how can i respect those offsets in fake fd ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: LibNode, iobsoletes, inlines vs protos
Just can't stay away
Just can't stay away


See User information
@kas1e

The fd/sfd formats are explained in the fd2pragma.guide file.

The ##bias in .fd (or ==bias in .sfd) sets the offset of the first library function (for a library this is usually 30). The value is the same as the _LVO value which is used in assembler programming only without the minus sign and as with the _LVO values it has to be a multiple of 6.

In an .sfd file you can also reserve space for future expansion or private functions by using the ==reserve keyword. Adding the line "==reserve 10" f.e. reserves 10 slots in the jumptable.


Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@Salas00

Thanks for hint!

So, as my StrConcat is 47a from pragmas, that mean:

1. 0x47a = 1146
2. 1146 / 6 = 191
3. 191 - 4 (i.e. 30/6 from begining 5, but 30 is our first one, so -4) = 187

Then it mean that 187 entry in jump table is my StrConcat (what prove and original fd file and pragma entry)

Then i play with fake fd (186 of aa()() and then StrConcat), with .sfd and ==reserve 186: and all is ok, i got it all working.

@all
Maybe someone will be in interest and google will find out that page someday: i can do that by 2 ways. I use default dopus_lib.fd (only rename it to dopus5_lib.fd to have all dopus5 names where is need it) + my proto with one single line:

Quote:

BOOL StrConcat(char *buf, char *cat, int lim);


So

First way: fdtrans + sfd

1. generate .sfd file:

Quote:

ram:> fd2pragma dopus5_lib.fd clib proto.h special 112


It bring a lot of warnings about all the function non present in protos, but our single one is added and sfd file looks like this after:

==id $Iddopus5_lib.sfd,v 1.0 2013/03/29 09:24:08 noname Exp $
"dopus5.library"
==base _DopusBase
==basetype struct Library *
==
libname dopus5.library
==bias 30
==public
==include <
exec/types.h>
==
reserve 186
BOOL StrConcat
(char s1char s2int len) (a0,a1,d0)
==
end


2. generate xml and ppc->68k crosscall stubs via fdtrans:

Quote:

ram:> fdtrans dopus5_lib.sfd -x -s


Change manually in the crosscall-stubs file (dopus5.c) "main_vectors" on "main_v1_vectors". No other changes need it, fdtrans automatically insert including of interface (while fd2pragma skip it).

3. generate proto/interface/inline (i.e. includes) and vectors:

Quote:

ram:> idltool -p -i -n -c dopus5.xml


4.. build dopus5.l.main
Quote:

ram:> gcc -Iinclude -nostartfiles dopus5.c -o dopus5.l.main


5. build test case:

#include <proto/exec.h>
#include <proto/dopus5.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct Library *DOpusBase;
struct DOpusIFace *IDOpus;

void main(int argc,char **argv)
{
    
char buffer[256] = "First part-";
    
char *concat "Second part";

    
// Need dopus library
    
if (!(DOpusBase=IExec->OpenLibrary("PROGDIR:dopus5.library",1L))) {
        
printf("cant library");
        exit(
10);
    };
    if (!(
IDOpus=IExec->GetInterface((struct Library *)DOpusBase,"main",1L,NULL))) {
        
printf("cant interface");
       exit(
10);
   };

    
IDOpus->StrConcat(bufferconcat36);
    
printf("Result=%s\n"buffer);

    
IExec->CloseLibrary(DOpusBase);
}


Quote:

ram:> gcc -Iinclude testcase-native-fdtrans.c
ram:> a.out
ram:> Result=First part-Second part


It works !

Second way: fd2pragma + fd

1. Create xml:

Quote:

ram:> fd2pragma dopus5_lib.fd clib proto.h special 140


2.generate ppc->68k crosscall stubs:

Quote:

fd2pragma dopus5_lib.fd clib proto.h special 141


Add in result file (dopus5.c) including of interfaces/dopus5.h and replace value "main_vectors" on "main_v1_vectors"

3. generate proto/interface/inline (i.e. includes) and vectors:

Quote:

ram:> idltool -p -i -n -c dopus5.xml


4. build dopus5.l.main

Quote:

ram:> gcc -Iinclude -nostartfiles dopus5.c -o dopus5.l.main


5. build test case (its a bit different in compare with one from fdtrans, because names of iface a bit different (big/small letters, 5 at end, etc) :

#include <proto/exec.h>
#include <proto/dopus5.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct Library *DOpusBase;
struct Dopus5IFace *IDopus5;

void main(int argc,char **argv)
{
    
char buffer[256] = "First part-";
    
char *concat "Second part";

    
// Need dopus library
    
if (!(DOpusBase=IExec->OpenLibrary("PROGDIR:dopus5.library",1L))) {
        
printf("cant library");
        exit(
10);
    };
    if (!(
IDopus5=IExec->GetInterface((struct Library *)DOpusBase,"main",1L,NULL))) {
        
printf("cant interface");
       exit(
10);
   };

    
IDopus5->StrConcat(bufferconcat36);
    
printf("Result=%s\n"buffer);

    
IExec->CloseLibrary(DOpusBase);
}


Then hard-reboot is need it in case you already run previous test case on dopus5.l.main done from fd2trans and which still in memory (as it can freeze os hard because of different code of the same stub libs), and then:

Quote:

ram:> gcc -Iinclude testcase-native-fd2pragma.c
ram:> a.out
ram:> Result=First part-Second part



It works as well !

Conclusion
What way better ? Imho fdtrans one. Because:

1). you need to change less (no need to manually include interfaces/dopus5.h file).
2). the code of stubs from fdtrans looks better and cleaner in compare with code of stubs from fd2pragma. For example such a even small moment as comments saying what value in hex mean your offset in jump table is pretty nice (expectually when you works manually with pragmas, where those hex offsets is present).
3). size of dopus.l.main done from fd2pragma output bigger (66.754 for my lib) in compare with size of dopus.l.main done from fdtrans output (6,011).

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@all
A bit stuck with Tags based functions.

For example i have in my FD file:
Quote:

OpenProgressWindow(tags)(a0)


So i make a proto entry for it:
Quote:

APTR OpenProgressWindow(struct TagItem *);


And tryed to generate .sfd file:
Quote:

ram:> fd2pragma test_tags.fd clib test_proto.h special 122

SourceFile: test_tags.fd
ResultFile: test_tags.sfd
Warning 26: Prototype for function "OpenProgressWindowTags" not found.


Wtf ? Why it want from me anything else and where it will be later put in jump-table ? (jumptable do not have such a function at all, only as proto in some include file)

I anyway add to that proto function like that:
Quote:

APTR OpenProgressWindowTags(Tag,...);


And fd2pragma convert it ok, and my .sfd file looks like this after:
Quote:

==id $Id: dopus5_lib.sfd,v 1.0 2013/03/29 20:52:44 noname Exp $
* "dopus5.library"
==base _DOpusBase
==basetype struct Library *
==libname dopus5.library
==bias 30
==public
==include <exec/types.h>
APTR OpenProgressWindow(struct TagItem * tags) (a0)
==varargs
APTR OpenProgressWindowTags(Tag tags, ...) (a0)
==end


Question is: is it ok ? I not sure why i need to make a such a simply prototypes expectually for XFunctionTags(), if it anyway that simply.. Where later autogeneration tools will put that "varargs" stuff ? Just in includes ? Just to have ability to do #define OpenProgressWindowTags IFace->OpenProgressWindowTags ?



Edited by kas1e on 2013/3/29 18:59:34
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@all

Another question about casting (i hope). I have such a line in the code:

Quote:

lsprintf(filename,"D5THEMES:%s",(char *)args->FA_Arguments[0]);


And gcc says for me on that:

Quote:

error: request for member 'FA_Arguments' in something not a structure or union


How to deal with it ? Our lsprintf looks like this:

#if defined(__amigaos3__)
extern ULONG GlobalStuffChar;
#define DOPUS_RAWFMTFUNC (APTR)&GlobalStuffChar
#else
#define DOPUS_RAWFMTFUNC NULL
#endif
 
#define lsprintf(buf,fmt,...) \
    
({ \
        IPTR args
[] = { __VA_ARGS__ }; \
        RawDoFmt
(fmt, &argsDOPUS_RAWFMTFUNCbuf); \
    
}) 


#if defined(__amigaos3__)
ULONG GlobalStuffChar 0x16c04e75;
#endif

void LSprintf(char *bufferchar *stringAPTR data)
{
    
RawDoFmt(stringdataDOPUS_RAWFMTFUNCbuffer);
}

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information

Does that arcane macro for lsprintf() work in other contexts?

If so, I'd guess that the issue is the name clash you have args in the macro and args in the call to the macro so you get a result looking something like

IPTR args[] = args->FA->Arguments[0]

maybe change the macro to __args


Go to top
Re: LibNode, iobsoletes, inlines vs protos
Just can't stay away
Just can't stay away


See User information
@kas1e

Quote:

lsprintf(filename,"D5THEMES:%s",(char *)args->FA_Arguments[0]);


The problem is that the args variable that your trying to dereference is being shadowed by another declaration of args inside your lsprintf() macro. Note that macro arguments are not passed by value but are simply replaced with whatever text you entered in the macro call so that the above macro call would expand to:
({  
        
IPTR args[] = { (char *)args->FA_Arguments[0] };  
        
RawDoFmt("D5THEMES:%s", &argsDOPUS_RAWFMTFUNCfilename);
    })


A simple solution would be to just rename the args variable in the macro to something less likely to cause name clashes like f.e.:
#define lsprintf(buf,fmt,...)  \
    
({  \
        IPTR _args
[] = { __VA_ARGS__ };  \
        RawDoFmt
(fmt, &_argsDOPUS_RAWFMTFUNCbuf); \
    
})

Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@Andy,Fredrik

Yep, that helps !

But as you all help pretty well with all that stuff, there is another problem i have now:

I tried to compile one of files of one of modules, and have that:

Quote:

config_buttons_support.c: In function `palette_editor_init':
config_buttons_support.c:1044: structure has no member named `stuff1'
config_buttons_support.c:1045: structure has no member named `stuff1'
config_buttons_support.c:1046: structure has no member named `stuff1'
config_buttons_support.c:1047: structure has no member named `stuff1'
config_buttons_support.c:1048: structure has no member named `stuff1'
config_buttons_support.c:1049: structure has no member named `stuff1'
config_buttons_support.c:1050: structure has no member named `stuff1'
config_buttons_support.c:1066: structure has no member named `stuff1'
config_buttons_support.c:1067: structure has no member named `stuff1'
config_buttons_support.c:1068: structure has no member named `stuff1'
config_buttons_support.c:1068: structure has no member named `stuff1'
config_buttons_support.c:1069: structure has no member named `stuff1'
config_buttons_support.c:1069: structure has no member named `stuff1'


config_buttons_support.c lines looks like this:

// Initialise palette editor startup
void palette_editor_init(PaletteBoxData *data)
{
    
short a,base;

    
// Fill out palette box data
    
data->newwin.dims=&_palette_box_window;
    
data->newwin.title=GetString(locale,MSG_SELECT_COLOURS);
    
data->newwin.locale=locale;
    
data->newwin.flags=WINDOW_VISITOR|WINDOW_REQ_FILL|WINDOW_AUTO_KEYS;

    
// Palette box tags
    
data->stuff1.palette_tags[0].ti_Tag=GTPA_NumColors;
    
data->stuff1.palette_tags[0].ti_Data=data->screen_data.pen_count+((GfxBase->LibNode.lib_Version>=39)?8:4);
    
data->stuff1.palette_tags[1].ti_Tag=GTPA_ColorTable;
    
data->stuff1.palette_tags[1].ti_Data=(ULONG)data->pen_array;
    
data->stuff1.palette_tags[2].ti_Tag=GTCustom_LayoutRel;
    
data->stuff1.palette_tags[2].ti_Data=GAD_PALETTE_LAYOUT;
    
data->stuff1.palette_tags[3].ti_Tag=TAG_END;

    
// Copy palette aray
    
for (base=0;base<4;base++)
        
data->pen_array[base]=base;
    if (
GfxBase->LibNode.lib_Version>=39)
    {
        for (
a=0;a<4;a++,base++)
            
data->pen_array[base]=252+a;
    }
    for (
a=0;a<data->screen_data.pen_count;a++,base++)
        
data->pen_array[base]=data->screen_data.pen_array[a];

    
// Palette box objects
    
CopyMem(
        (
char *)_palette_box_objects,
        (
char *)data->stuff1.object_def,
        
sizeof(data->stuff1.object_def));
    
data->stuff1.object_def[1].taglist=data->stuff1.palette_tags;
    
data->stuff1.object_def[2].taglist=data->stuff1.palette_tags;

    
// Libraries
    
data->DOpusBase=DOpusBase;
    
data->IntuitionBase=(struct Library *)IntuitionBase;
    
data->flags=0;
}


I.e. all the lines where data->stuff1.X is used fail. Then, i go to the .h file and there is:

typedef struct
{
    
NewConfigWindow            newwin;

    
union
    
{
        
struct
        
{
            
struct TagItem        palette_tags[4];
            
ObjectDef        object_def[4];
        } 
stuff1;

        
struct
        
{
            
char            gun_bits[3];
            
char            pad;
            
GL_Object        *palette_gadget[2];
        } 
stuff2;
    };

    
IPCData                *owner_ipc;

    
struct Library            *DOpusBase;
    
struct Library            *IntuitionBase;

    
unsigned long            flags;

    
DOpusScreenData            screen_data;
    
short                pen_array[18];

    
unsigned char            fgpen;
    
unsigned char            bgpen;

    
IPCData                *main_ipc;

    
short                pen_count;
    
short                pad;

    
struct TextAttr            *font;
    
struct Window            *window;
    
ObjectList            *list;

    
ULONG                pad1[2];
PaletteBoxData;


I.e. its seems here, just in some union.

And for that strange "struct" i have also warning:

Quote:

select_colours.h:19: warning: unnamed struct/union that defines no instances


Line 19 is end of stuff2;

Wtf ? Why it says that has no member named `stuff1' if stuff1 and stuff2 both in PaletteBoxData struct ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
Quote:


Wtf ? Why it says that has no member named `stuff1' if stuff1 and stuff2 both in PaletteBoxData struct ?



Because it hasn't and they aren't

The problem is the union inside the structure , it has no name, this is not valid C (perhaps SASC supports it as an extention?)
You need to name the embeded union (in the same way as the embeded structs are named) like so:
typedef struct 

    NewConfigWindow            newwin

    union 
    

        struct 
        

            struct TagItem        palette_tags[4]; 
            ObjectDef        object_def[4]; 
        } stuff1

        struct 
        

            char            gun_bits[3]; 
            char            pad
            GL_Object        *palette_gadget[2]; 
        } stuff2
    stuff 

    IPCData                *owner_ipc

    struct Library            *DOpusBase
    struct Library            *IntuitionBase

    unsigned long            flags

    DOpusScreenData            screen_data
    short                pen_array[18]; 

    unsigned char            fgpen
    unsigned char            bgpen

    IPCData                *main_ipc

    short                pen_count
    short                pad

    struct TextAttr            *font
    struct Window            *window
    ObjectList            *list; 

    ULONG                pad1[2]; 
}
 PaletteBoxData;


Then access like so:

    data->stuff.stuff1.object_def[2].taglist=data->stuff1.palette_tags;


I would suggest removing the union complete,as the data seems not to be data that can be interpreted in different ways withy the same data, but without studying the whole code it's hard to make that assertion for definite.

Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
According to some googling but without any testing you can switch support for this on by setting the

-fms-extensions

gcc option, but this is an extension do the standard C99 specification.

It may not work on older gccs, for portabailty and maintainabilty you'd be better of fixing the code.

Go to top
Re: LibNode, iobsoletes, inlines vs protos
Home away from home
Home away from home


See User information
@Andy
Thanks !

Yep, i just fixed the code, there was just few lines in whole module sources related to stuff1 and stuff2.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project