Re: [cc65] c programm

Date view Thread view Subject view

From: stefan (carlosofcascade_at_gmx.net)
Date: 2003-02-05 22:00:14


on 06.02.2003 12:00 AM, Groepaz at groepaz_at_gmx.net wrote:

of course, i could pass a pointer, but the reason for doing this with a
struct, was that i can pass the parameter in a/x using __fastcall__

> On Wednesday 05 February 2003 22:22, Marc 'BlackJack' Rintsch wrote:
>> using anonymous structs (correct term?) but I remember vaguely that
>> cc65 can't pass structs as function parameters. So maybe you want to
>> rewrite it this way:
>> 
>> typedef struct{
>> char color1, color2;
>> } ROYWINCOL_T;
>> 
>> ROYWINCOL_T a;
>> 
>> void  setcharcolors(char c1, char c2) {
>> a.color1 = c1;
>> a.color2 = c2;
>> }
>> 
>> void main(void){
>> setcharcolors(1,0);
>> }
> 
> alternativly, pass a pointer to the struct (better if the struct has more than
> 2 members, since the argument stack wouldnt be used)


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-02-05 23:03:00 CET