Re: [9fans] Plan9 development
On Saturday 06 of November 2010 03:20:55 Bruce Ellis wrote: > i can answer that one easily. that's why it's called mash rather than > "random marketting name". the intention was to replace plan9 rc with a > shell that was maintainable and had loadable modules. i wrote it in > limbo to show it works, damned well. the first requirement was a make > loadable. it's not built into mash, it's loadable. a few pages of code > that uses the shell rather than mk's builtin shell like stuff. Why loadable modules and what kind of modules were expected to be of frequent use? Also, would the modules only provide new commands, or could they add whole semantics and/or syntax constructs? -- dexen
[9fans] Auto-rejecting mails
I just tried to mail this list a few minutes ago, but all I got was an auto-rejection. Neither http://mail.9fans.net/listinfo/9fans nor http://plan9.bell-labs.com/wiki/plan9/mailing_lists/ mention any subscription requirement, so I assume this is a bug in the 9fans.net listserv. Hope this helps track down the bug. Regards, Carl-Daniel
[9fans] pcc limitation?
Hi, any idea why the code below causes an error message from pcc? I'm trying to port flashrom to Plan 9, but I've been fighting the compiler for the last few hours. /usr/glenda/flashrom/test3.c:20[stdin:45] constructor must be a structure /usr/glenda/flashrom/test3.c:25[stdin:50] constructor must be a structure Regards, Carl-Daniel #include #define JEDEC_WREN 0x06 #define JEDEC_WREN_OUTSIZE 0x01 #define JEDEC_CE_C7 0xc7 #define JEDEC_CE_C7_OUTSIZE 0x01 struct spi_command { unsigned int writecnt; unsigned int readcnt; const unsigned char *writearr; unsigned char *readarr; }; void spi_chip_erase_c7(void) { struct spi_command cmds[] = { { .writecnt = JEDEC_WREN_OUTSIZE, .writearr = (const unsigned char[]){ JEDEC_WREN }, .readcnt= 0, .readarr= NULL, }, { .writecnt = JEDEC_CE_C7_OUTSIZE, .writearr = (const unsigned char[]){ JEDEC_CE_C7 }, .readcnt= 0, .readarr= NULL, }, { .writecnt = 0, .writearr = NULL, .readcnt= 0, .readarr= NULL, }}; }
Re: [9fans] pcc limitation?
the syntax (){} is for structures, like (Point){0, 0} or something, so you don't need the braces there, just the cast .writearr = (const unsigned char*)JEDEC_WREN, On Sat, Nov 6, 2010 at 9:56 PM, Carl-Daniel Hailfinger wrote: > Hi, > > any idea why the code below causes an error message from pcc? I'm trying > to port flashrom to Plan 9, but I've been fighting the compiler for the > last few hours. > /usr/glenda/flashrom/test3.c:20[stdin:45] constructor must be a structure > /usr/glenda/flashrom/test3.c:25[stdin:50] constructor must be a structure > > Regards, > Carl-Daniel > > #include > > #define JEDEC_WREN 0x06 > #define JEDEC_WREN_OUTSIZE 0x01 > #define JEDEC_CE_C7 0xc7 > #define JEDEC_CE_C7_OUTSIZE 0x01 > > struct spi_command { > unsigned int writecnt; > unsigned int readcnt; > const unsigned char *writearr; > unsigned char *readarr; > }; > > void spi_chip_erase_c7(void) > { > struct spi_command cmds[] = { > { > .writecnt = JEDEC_WREN_OUTSIZE, > .writearr = (const unsigned char[]){ JEDEC_WREN }, > .readcnt = 0, > .readarr = NULL, > }, { > .writecnt = JEDEC_CE_C7_OUTSIZE, > .writearr = (const unsigned char[]){ JEDEC_CE_C7 }, > .readcnt = 0, > .readarr = NULL, > }, { > .writecnt = 0, > .writearr = NULL, > .readcnt = 0, > .readarr = NULL, > }}; > } > > > > -- Federico G. Benavento