9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Updating an old port . Warning! long lines of code
@ 2008-06-29 11:32 Fernan Bolando
  2008-06-29 11:38 ` Pietro Gagliardi
  2008-06-29 13:38 ` erik quanstrom
  0 siblings, 2 replies; 4+ messages in thread
From: Fernan Bolando @ 2008-06-29 11:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1307 bytes --]

Hi all

I am updating an old port from 2002. I was able to clean a few of the simple
errors, but I need a bit of a hint on this one.

compile errors ****

/usr/fernan/tmp/scm/sys.c:628[sys.c:3613] initialization of incompatible
pointers: sfptob
IND FUNC(INT, IND STRUCT _7_) INT and IND FUNC(OLD, INT, LONG) INT
/usr/fernan/tmp/scm/sys.c:629[sys.c:3614] initialization of incompatible
pointers: sfptob
IND FUNC(IND CONST CHAR, IND STRUCT _7_) INT and IND FUNC(OLD, IND CHAR,
LONG) INT


The following are the relevant structure and code

typedef struct {
  char *name;
  SCM (*mark)P((SCM ptr));
  int (*free)P((FILE *p));
  int (*print)P((SCM exp, SCM port, int writing));
  SCM (*equalp)P((SCM, SCM));
  int (*fputc)P((int c, FILE *p));
/* int (*fputs)P((char *s, FILE *p)); */
/* sizet (*fwrite)P((char *s, sizet siz, sizet num, FILE *p)); */
  int (*fputs)P((const char *s, FILE *p));
  sizet (*fwrite)P((const void *s, sizet siz, sizet num, FILE *p));
  int (*fflush)P((FILE *stream));
  int (*fgetc)P((FILE *p));
  int (*fclose)P((FILE *p));
  int (*ungetc)P((int c, SCM p));
} ptobfuns;


static ptobfuns sfptob = {
  "soft",
  markcdr,
  noop0,
  0,
  0,
  sfputc,
  sfputs,
  sfwrite,
  sfflush,
  sfgetc,
  sfclose};


--
http://www.fernski.com

[-- Attachment #2: Type: text/html, Size: 1632 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Updating an old port . Warning! long lines of code
  2008-06-29 11:32 [9fans] Updating an old port . Warning! long lines of code Fernan Bolando
@ 2008-06-29 11:38 ` Pietro Gagliardi
  2008-06-29 13:11   ` Fernan Bolando
  2008-06-29 13:38 ` erik quanstrom
  1 sibling, 1 reply; 4+ messages in thread
From: Pietro Gagliardi @ 2008-06-29 11:38 UTC (permalink / raw)
  To: fernanbolando, Fans of the OS Plan 9 from Bell Labs

On Jun 29, 2008, at 7:32 AM, Fernan Bolando wrote:

> /* int (*fputs)P((char *s, FILE *p)); */
> /* sizet (*fwrite)P((char *s, sizet siz, sizet num, FILE *p)); */

Try uncommenting those two lines.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Updating an old port . Warning! long lines of code
  2008-06-29 11:38 ` Pietro Gagliardi
@ 2008-06-29 13:11   ` Fernan Bolando
  0 siblings, 0 replies; 4+ messages in thread
From: Fernan Bolando @ 2008-06-29 13:11 UTC (permalink / raw)
  To: Pietro Gagliardi; +Cc: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 572 bytes --]

On 6/29/08, Pietro Gagliardi <pietro10@mac.com> wrote:
>
> On Jun 29, 2008, at 7:32 AM, Fernan Bolando wrote:
>
>  /* int (*fputs)P((char *s, FILE *p)); */
>> /* sizet (*fwrite)P((char *s, sizet siz, sizet num, FILE *p)); */
>>
>
> Try uncommenting those two lines.
>
>
thanks, but that didn't work.

It's probably very simple. Maybe I just need to re-read the documentation.
Or maybe I maybe I made a mistake during the uncomment.

The good thing is I can now do this through 9vx intead of connecting to
9grid. very nice


--
http://www.fernski.com

[-- Attachment #2: Type: text/html, Size: 1057 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Updating an old port . Warning! long lines of code
  2008-06-29 11:32 [9fans] Updating an old port . Warning! long lines of code Fernan Bolando
  2008-06-29 11:38 ` Pietro Gagliardi
@ 2008-06-29 13:38 ` erik quanstrom
  1 sibling, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2008-06-29 13:38 UTC (permalink / raw)
  To: fernanbolando, 9fans

> /usr/fernan/tmp/scm/sys.c:628[sys.c:3613] initialization of incompatible
> pointers: sfptob
> IND FUNC(INT, IND STRUCT _7_) INT and IND FUNC(OLD, INT, LONG) INT
> /usr/fernan/tmp/scm/sys.c:629[sys.c:3614] initialization of incompatible
> pointers: sfptob
> IND FUNC(IND CONST CHAR, IND STRUCT _7_) INT and IND FUNC(OLD, IND CHAR,
> LONG) INT

in the first case, you're trying to assign
pointers of these types:

	IND FUNC(INT, IND STRUCT _7_) INT
	IND FUNC(OLD, INT, LONG) INT

these kenc's internal representation for

	int (*)(int, struct _7_*);
	int (*)(int, long);			/* pre-ansi declaration */

so the problem here is that you're mixing a pointer to
a structure with a long.

similarly,

	IND FUNC(IND CONST CHAR, IND STRUCT _7_) INT
	IND FUNC(OLD, IND CHAR, LONG) INT
is
	int (*)(const char*, struct _7_*);
	int (*)(char*, long);		/* pre-ansi declaration */

struct _7_ must be FILE, and the two functions must be fputc
fputs.  (but you knew that.)  so the solution would be to clean up the
declaration of sfputc and sfputs.

- erik




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-29 13:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-29 11:32 [9fans] Updating an old port . Warning! long lines of code Fernan Bolando
2008-06-29 11:38 ` Pietro Gagliardi
2008-06-29 13:11   ` Fernan Bolando
2008-06-29 13:38 ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).