Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not OK: perl 5.00560 on i586-linux-thread 2.1.125 [PATCH] #327

Closed
p5pRT opened this issue Aug 3, 1999 · 1 comment
Closed

Not OK: perl 5.00560 on i586-linux-thread 2.1.125 [PATCH] #327

p5pRT opened this issue Aug 3, 1999 · 1 comment

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Aug 3, 1999

Migrated from rt.perl.org#1153 (status was 'resolved')

Searchable as RT1153$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Aug 3, 1999

From skimo@kotnet.org

perl5.005_60.diff
diff -ru orig/perl5.005_60/doio.c perl5.005_60/doio.c
--- orig/perl5.005_60/doio.c	Mon Aug  2 18:07:39 1999
+++ perl5.005_60/doio.c	Tue Aug  3 11:00:46 1999
@@ -792,7 +792,7 @@
     while (IoIFP(io)) {
 
         if (PerlIO_has_cntptr(IoIFP(io))) {	/* (the code works without this) */
-	    if (PerlIO_get_cnt(IoIFP(io)) > 0)	/* cheat a little, since */
+	    if (PerlIO_get_cnt(aTHX_ IoIFP(io)) > 0)	/* cheat a little, since */
 		return FALSE;			/* this is the most usual case */
         }
 
@@ -802,8 +802,8 @@
 	    return FALSE;
 	}
         if (PerlIO_has_cntptr(IoIFP(io)) && PerlIO_canset_cnt(IoIFP(io))) {
-	    if (PerlIO_get_cnt(IoIFP(io)) < -1)
-		PerlIO_set_cnt(IoIFP(io),-1);
+	    if (PerlIO_get_cnt(aTHX_ IoIFP(io)) < -1)
+		PerlIO_set_cnt(aTHX_ IoIFP(io),-1);
 	}
 	if (PL_op->op_flags & OPf_SPECIAL) { /* not necessarily a real EOF yet? */
 	    if (!nextargv(PL_argvgv))	/* get another fp handy */
diff -ru orig/perl5.005_60/iperlsys.h perl5.005_60/iperlsys.h
--- orig/perl5.005_60/iperlsys.h	Wed Jul 28 20:11:20 1999
+++ perl5.005_60/iperlsys.h	Tue Aug  3 11:01:34 1999
@@ -220,13 +220,13 @@
 	(*PL_StdIO->pClearerr)(PL_StdIO, (f))
 #define PerlIO_getc(f)							\
 	(*PL_StdIO->pGetc)(PL_StdIO, (f))
-#define PerlIO_get_base(f)						\
+#define PerlIO_get_base(mTHX_ f)						\
 	(*PL_StdIO->pGetBase)(PL_StdIO, (f))
-#define PerlIO_get_bufsiz(f)						\
+#define PerlIO_get_bufsiz(mTHX_ f)						\
 	(*PL_StdIO->pGetBufsiz)(PL_StdIO, (f))
-#define PerlIO_get_cnt(f)						\
+#define PerlIO_get_cnt(mTHX_ f)						\
 	(*PL_StdIO->pGetCnt)(PL_StdIO, (f))
-#define PerlIO_get_ptr(f)						\
+#define PerlIO_get_ptr(mTHX_ f)						\
 	(*PL_StdIO->pGetPtr)(PL_StdIO, (f))
 #define PerlIO_putc(f,c)						\
 	(*PL_StdIO->pPutc)(PL_StdIO, (f),(c))
@@ -252,9 +252,9 @@
 	(*PL_StdIO->pSetBuf)(PL_StdIO, (f), (b))
 #define PerlIO_setvbuf(f,b,t,s)						\
 	(*PL_StdIO->pSetVBuf)(PL_StdIO, (f),(b),(t),(s))
-#define PerlIO_set_cnt(f,c)						\
+#define PerlIO_set_cnt(mTHX_ f,c)						\
 	(*PL_StdIO->pSetCnt)(PL_StdIO, (f), (c))
-#define PerlIO_set_ptrcnt(f,p,c)					\
+#define PerlIO_set_ptrcnt(mTHX_ f,p,c)					\
 	(*PL_StdIO->pSetPtrCnt)(PL_StdIO, (f), (p), (c))
 #define PerlIO_setlinebuf(f)						\
 	(*PL_StdIO->pSetlinebuf)(PL_StdIO, (f))
@@ -425,22 +425,22 @@
 extern int	PerlIO_canset_cnt	(PerlIO *);
 #endif
 #ifndef PerlIO_get_ptr
-extern STDCHAR * PerlIO_get_ptr		(PerlIO *);
+extern STDCHAR * PerlIO_get_ptr		(pTHX_ PerlIO *);
 #endif
 #ifndef PerlIO_get_cnt
-extern int	PerlIO_get_cnt		(PerlIO *);
+extern int	PerlIO_get_cnt		(pTHX_ PerlIO *);
 #endif
 #ifndef PerlIO_set_cnt
-extern void	PerlIO_set_cnt		(PerlIO *,int);
+extern void	PerlIO_set_cnt		(pTHX_ PerlIO *,int);
 #endif
 #ifndef PerlIO_set_ptrcnt
-extern void	PerlIO_set_ptrcnt	(PerlIO *,STDCHAR *,int);
+extern void	PerlIO_set_ptrcnt	(pTHX_ PerlIO *,STDCHAR *,int);
 #endif
 #ifndef PerlIO_get_base
-extern STDCHAR * PerlIO_get_base	(PerlIO *);
+extern STDCHAR * PerlIO_get_base	(pTHX_ PerlIO *);
 #endif
 #ifndef PerlIO_get_bufsiz
-extern int	PerlIO_get_bufsiz	(PerlIO *);
+extern int	PerlIO_get_bufsiz	(pTHX_ PerlIO *);
 #endif
 #ifndef PerlIO_tmpfile
 extern PerlIO *	PerlIO_tmpfile		(void);
diff -ru orig/perl5.005_60/perl.h perl5.005_60/perl.h
--- orig/perl5.005_60/perl.h	Mon Aug  2 22:21:56 1999
+++ perl5.005_60/perl.h	Tue Aug  3 10:38:47 1999
@@ -184,10 +184,13 @@
 #    define dTHXa(a)	pTHX = (PerlInterpreter *)a
 #    define dTHX	dTHXa(PERL_GET_INTERP)
 #  endif
+#  define mTHX		macro_argument
 #  define pTHX_		pTHX,
 #  define _pTHX		,pTHX
 #  define aTHX_		aTHX,
 #  define _aTHX		,aTHX
+#  define mTHX_		mTHX,
+#  define _mTHX		,mTHX
 #endif
 
 #define STATIC static
@@ -220,6 +223,9 @@
 #  define aTHX
 #  define aTHX_
 #  define _aTHX
+#  define mTHX
+#  define mTHX_
+#  define _mTHX
 #  define dTHXa(a)	dNOOP
 #  define dTHX		dNOOP
 #endif
diff -ru orig/perl5.005_60/perlio.c perl5.005_60/perlio.c
--- orig/perl5.005_60/perlio.c	Tue Jul 20 19:18:07 1999
+++ perl5.005_60/perlio.c	Tue Aug  3 11:17:05 1999
@@ -141,9 +141,9 @@
 
 #undef PerlIO_set_cnt
 void
-PerlIO_set_cnt(PerlIO *f, int cnt)
+PerlIO_set_cnt(pTHX_ PerlIO *f, int cnt)
 {
- if (cnt < -1 && ckWARN_s(WARN_INTERNAL))
+ if (cnt < -1 && ckWARN_d(WARN_INTERNAL))
   Perl_warner(aTHX_ WARN_INTERNAL, "Setting cnt to %d\n",cnt);
 #if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE)
  FILE_cnt(f) = cnt;
@@ -154,14 +154,14 @@
 
 #undef PerlIO_set_ptrcnt
 void
-PerlIO_set_ptrcnt(PerlIO *f, STDCHAR *ptr, int cnt)
+PerlIO_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR *ptr, int cnt)
 {
 #ifdef FILE_bufsiz
  STDCHAR *e = FILE_base(f) + FILE_bufsiz(f);
  int ec = e - ptr;
- if (ptr > e + 1 && ckWARN_s(WARN_INTERNAL))
+ if (ptr > e + 1 && ckWARN_d(WARN_INTERNAL))
   Perl_warner(aTHX_ WARN_INTERNAL, "Setting ptr %p > end+1 %p\n", ptr, e + 1);
- if (cnt != ec && ckWARN_s(WARN_INTERNAL))
+ if (cnt != ec && ckWARN_d(WARN_INTERNAL))
   Perl_warner(aTHX_ WARN_INTERNAL, "Setting cnt to %d, ptr implies %d\n",cnt,ec);
 #endif
 #if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE)
@@ -178,7 +178,7 @@
 
 #undef PerlIO_get_cnt
 int 
-PerlIO_get_cnt(PerlIO *f)
+PerlIO_get_cnt(pTHX_ PerlIO *f)
 {
 #ifdef FILE_cnt
  return FILE_cnt(f);
@@ -190,7 +190,7 @@
 
 #undef PerlIO_get_bufsiz
 int 
-PerlIO_get_bufsiz(PerlIO *f)
+PerlIO_get_bufsiz(pTHX_ PerlIO *f)
 {
 #ifdef FILE_bufsiz
  return FILE_bufsiz(f);
@@ -202,7 +202,7 @@
 
 #undef PerlIO_get_ptr
 STDCHAR *
-PerlIO_get_ptr(PerlIO *f)
+PerlIO_get_ptr(pTHX_ PerlIO *f)
 {
 #ifdef FILE_ptr
  return FILE_ptr(f);
@@ -214,7 +214,7 @@
 
 #undef PerlIO_get_base
 STDCHAR *
-PerlIO_get_base(PerlIO *f)
+PerlIO_get_base(pTHX_ PerlIO *f)
 {
 #ifdef FILE_base
  return FILE_base(f);
@@ -279,7 +279,7 @@
 
 #undef PerlIO_getname
 char *
-PerlIO_getname(PerlIO *f, char *buf)
+PerlIO_getname(pTHX_ PerlIO *f, char *buf)
 {
 #ifdef VMS
  return fgetname(f,buf);
diff -ru orig/perl5.005_60/perlsdio.h perl5.005_60/perlsdio.h
--- orig/perl5.005_60/perlsdio.h	Sun Aug  1 22:47:44 1999
+++ perl5.005_60/perlsdio.h	Tue Aug  3 11:02:20 1999
@@ -49,7 +49,7 @@
 #  define PerlIO_read(f,buf,count)	(SSize_t)fread(buf,1,count,f)
 #endif
 #define PerlIO_eof(f)			feof(f)
-#define PerlIO_getname(f,b)		fgetname(f,b)
+#define PerlIO_getname(mTHX_ f,b)		fgetname(f,b)
 #define PerlIO_error(f)			ferror(f)
 #define PerlIO_fileno(f)		fileno(f)
 #define PerlIO_clearerr(f)		clearerr(f)
@@ -90,34 +90,34 @@
 
 #ifdef USE_STDIO_PTR
 #define PerlIO_has_cntptr(f)		1       
-#define PerlIO_get_ptr(f)		FILE_ptr(f)          
-#define PerlIO_get_cnt(f)		FILE_cnt(f)          
+#define PerlIO_get_ptr(mTHX_ f)		FILE_ptr(f)          
+#define PerlIO_get_cnt(mTHX_ f)		FILE_cnt(f)          
 
 #ifdef STDIO_CNT_LVALUE
 #define PerlIO_canset_cnt(f)		1      
 #ifdef STDIO_PTR_LVALUE
 #define PerlIO_fast_gets(f)		1        
 #endif
-#define PerlIO_set_cnt(f,c)		(FILE_cnt(f) = (c))          
+#define PerlIO_set_cnt(mTHX_ f,c)		(FILE_cnt(f) = (c))          
 #else
 #define PerlIO_canset_cnt(f)		0      
-#define PerlIO_set_cnt(f,c)		abort()
+#define PerlIO_set_cnt(mTHX_ f,c)		abort()
 #endif
 
 #ifdef STDIO_PTR_LVALUE
-#define PerlIO_set_ptrcnt(f,p,c)	(FILE_ptr(f) = (p), PerlIO_set_cnt(f,c))          
+#define PerlIO_set_ptrcnt(mTHX_ f,p,c)	(FILE_ptr(f) = (p), pTHX_ PerlIO_set_cnt(mTHX_ f,c))          
 #else
-#define PerlIO_set_ptrcnt(f,p,c)	abort()
+#define PerlIO_set_ptrcnt(mTHX_ f,p,c)	abort()
 #endif
 
 #else  /* USE_STDIO_PTR */
 
 #define PerlIO_has_cntptr(f)		0
 #define PerlIO_canset_cnt(f)		0
-#define PerlIO_get_cnt(f)		(abort(),0)
-#define PerlIO_get_ptr(f)		(abort(),(void *)0)
-#define PerlIO_set_cnt(f,c)		abort()
-#define PerlIO_set_ptrcnt(f,p,c)	abort()
+#define PerlIO_get_cnt(mTHX_ f)		(abort(),0)
+#define PerlIO_get_ptr(mTHX_ f)		(abort(),(void *)0)
+#define PerlIO_set_cnt(mTHX_ f,c)		abort()
+#define PerlIO_set_ptrcnt(mTHX_ f,p,c)	abort()
 
 #endif /* USE_STDIO_PTR */
 
@@ -128,12 +128,12 @@
 
 #ifdef FILE_base
 #define PerlIO_has_base(f)		1         
-#define PerlIO_get_base(f)		FILE_base(f)         
-#define PerlIO_get_bufsiz(f)		FILE_bufsiz(f)       
+#define PerlIO_get_base(mTHX_ f)		FILE_base(f)         
+#define PerlIO_get_bufsiz(mTHX_ f)		FILE_bufsiz(f)       
 #else
 #define PerlIO_has_base(f)		0
-#define PerlIO_get_base(f)		(abort(),(void *)0)
-#define PerlIO_get_bufsiz(f)		(abort(),0)
+#define PerlIO_get_base(mTHX_ f)		(abort(),(void *)0)
+#define PerlIO_get_bufsiz(mTHX_ f)		(abort(),0)
 #endif
 #else /* PERLIO_IS_STDIO */
 #ifdef PERL_CORE
diff -ru orig/perl5.005_60/perlsfio.h perl5.005_60/perlsfio.h
--- orig/perl5.005_60/perlsfio.h	Tue Jul 20 19:18:07 1999
+++ perl5.005_60/perlsfio.h	Tue Aug  3 11:01:34 1999
@@ -45,15 +45,15 @@
 /* Now our interface to equivalent of Configure's FILE_xxx macros */
 
 #define PerlIO_has_cntptr(f)		1       
-#define PerlIO_get_ptr(f)		((f)->next)
-#define PerlIO_get_cnt(f)		((f)->endr - (f)->next)
+#define PerlIO_get_ptr(mTHX_ f)		((f)->next)
+#define PerlIO_get_cnt(mTHX_ f)		((f)->endr - (f)->next)
 #define PerlIO_canset_cnt(f)		1      
 #define PerlIO_fast_gets(f)		1        
-#define PerlIO_set_ptrcnt(f,p,c)	((f)->next = (p))          
-#define PerlIO_set_cnt(f,c)		1
+#define PerlIO_set_ptrcnt(mTHX_ f,p,c)	((f)->next = (p))          
+#define PerlIO_set_cnt(mTHX_ f,c)		1
 
 #define PerlIO_has_base(f)		1         
-#define PerlIO_get_base(f)		((f)->data)
-#define PerlIO_get_bufsiz(f)		((f)->endr - (f)->data)
+#define PerlIO_get_base(mTHX_ f)		((f)->data)
+#define PerlIO_get_bufsiz(mTHX_ f)		((f)->endr - (f)->data)
 
 
diff -ru orig/perl5.005_60/pp_sys.c perl5.005_60/pp_sys.c
--- orig/perl5.005_60/pp_sys.c	Mon Aug  2 18:07:41 1999
+++ perl5.005_60/pp_sys.c	Tue Aug  3 11:01:15 1999
@@ -2946,15 +2946,15 @@
 		    RETPUSHNO;
 		else
 		    RETPUSHYES;
-	    if (PerlIO_get_cnt(IoIFP(io)) <= 0) {
+	    if (PerlIO_get_cnt(aTHX_ IoIFP(io)) <= 0) {
 		i = PerlIO_getc(IoIFP(io));
 		if (i != EOF)
 		    (void)PerlIO_ungetc(IoIFP(io),i);
 	    }
-	    if (PerlIO_get_cnt(IoIFP(io)) <= 0)	/* null file is anything */
+	    if (PerlIO_get_cnt(aTHX_ IoIFP(io)) <= 0)	/* null file is anything */
 		RETPUSHYES;
-	    len = PerlIO_get_bufsiz(IoIFP(io));
-	    s = (STDCHAR *) PerlIO_get_base(IoIFP(io));
+	    len = PerlIO_get_bufsiz(aTHX_ IoIFP(io));
+	    s = (STDCHAR *) PerlIO_get_base(aTHX_ IoIFP(io));
 	    /* sfio can have large buffers - limit to 512 */
 	    if (len > 512)
 		len = 512;
diff -ru orig/perl5.005_60/sv.c perl5.005_60/sv.c
--- orig/perl5.005_60/sv.c	Mon Aug  2 18:07:42 1999
+++ perl5.005_60/sv.c	Tue Aug  3 11:01:36 1999
@@ -3517,7 +3517,7 @@
 
     /* Here is some breathtakingly efficient cheating */
 
-    cnt = PerlIO_get_cnt(fp);			/* get count into register */
+    cnt = PerlIO_get_cnt(aTHX_ fp);			/* get count into register */
     (void)SvPOK_only(sv);		/* validate pointer */
     if (SvLEN(sv) - append <= cnt + 1) { /* make sure we have the room */
 	if (cnt > 80 && SvLEN(sv) > append) {
@@ -3533,13 +3533,13 @@
     else
 	shortbuffered = 0;
     bp = (STDCHAR*)SvPVX(sv) + append;  /* move these two too to registers */
-    ptr = (STDCHAR*)PerlIO_get_ptr(fp);
+    ptr = (STDCHAR*)PerlIO_get_ptr(aTHX_ fp);
     DEBUG_P(PerlIO_printf(Perl_debug_log,
 	"Screamer: entering, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
     DEBUG_P(PerlIO_printf(Perl_debug_log,
 	"Screamer: entering: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
-	       (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp), 
-	       (long)(PerlIO_has_base(fp) ? PerlIO_get_base(fp) : 0)));
+	       (long)PerlIO_get_ptr(aTHX_ fp), (long)PerlIO_get_cnt(aTHX_ fp), 
+	       (long)(PerlIO_has_base(fp) ? PerlIO_get_base(aTHX_ fp) : 0)));
     for (;;) {
       screamer:
 	if (cnt > 0) {
@@ -3570,21 +3570,21 @@
 
 	DEBUG_P(PerlIO_printf(Perl_debug_log,
 	    "Screamer: going to getc, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
-	PerlIO_set_ptrcnt(fp, ptr, cnt); /* deregisterize cnt and ptr */
+	PerlIO_set_ptrcnt(aTHX_ fp, ptr, cnt); /* deregisterize cnt and ptr */
 	DEBUG_P(PerlIO_printf(Perl_debug_log,
 	    "Screamer: pre: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
-	    (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp), 
-	    (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+	    (long)PerlIO_get_ptr(aTHX_ fp), (long)PerlIO_get_cnt(aTHX_ fp), 
+	    (long)(PerlIO_has_base (fp) ? PerlIO_get_base(aTHX_ fp) : 0)));
 	/* This used to call 'filbuf' in stdio form, but as that behaves like 
 	   getc when cnt <= 0 we use PerlIO_getc here to avoid introducing
 	   another abstraction.  */
 	i   = PerlIO_getc(fp);		/* get more characters */
 	DEBUG_P(PerlIO_printf(Perl_debug_log,
 	    "Screamer: post: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
-	    (long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp), 
-	    (long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
-	cnt = PerlIO_get_cnt(fp);
-	ptr = (STDCHAR*)PerlIO_get_ptr(fp);	/* reregisterize cnt and ptr */
+	    (long)PerlIO_get_ptr(aTHX_ fp), (long)PerlIO_get_cnt(aTHX_ fp), 
+	    (long)(PerlIO_has_base (fp) ? PerlIO_get_base(aTHX_ fp) : 0)));
+	cnt = PerlIO_get_cnt(aTHX_ fp);
+	ptr = (STDCHAR*)PerlIO_get_ptr(aTHX_ fp);	/* reregisterize cnt and ptr */
 	DEBUG_P(PerlIO_printf(Perl_debug_log,
 	    "Screamer: after getc, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
 
@@ -3611,11 +3611,11 @@
 	cnt += shortbuffered;
 	DEBUG_P(PerlIO_printf(Perl_debug_log,
 	    "Screamer: quitting, ptr=%ld, cnt=%ld\n",(long)ptr,(long)cnt));
-    PerlIO_set_ptrcnt(fp, ptr, cnt);	/* put these back or we're in trouble */
+    PerlIO_set_ptrcnt(aTHX_ fp, ptr, cnt);	/* put these back or we're in trouble */
     DEBUG_P(PerlIO_printf(Perl_debug_log,
 	"Screamer: end: FILE * thinks ptr=%ld, cnt=%ld, base=%ld\n",
-	(long)PerlIO_get_ptr(fp), (long)PerlIO_get_cnt(fp), 
-	(long)(PerlIO_has_base (fp) ? PerlIO_get_base(fp) : 0)));
+	(long)PerlIO_get_ptr(aTHX_ fp), (long)PerlIO_get_cnt(aTHX_ fp), 
+	(long)(PerlIO_has_base (fp) ? PerlIO_get_base(aTHX_ fp) : 0)));
     *bp = '\0';
     SvCUR_set(sv, bp - (STDCHAR*)SvPVX(sv));	/* set length */
     DEBUG_P(PerlIO_printf(Perl_debug_log,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant