Another LLP64 problems

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

FIX2LONGe$B<~$j$NOC$r=|$1$P!"e([email protected]$Oe(B(e$B$?$V$se(B)e$B$3$le(B
e$B$,:G8e$G$9!#e(B

(1)
e$BA0$K$bEj$2$?5$$,$7$^$9$,!"e(Bintern.he$B$Ne(Bst_foreach_safe()[email protected](B
[email protected]$,Dj5A$H0[$J$j$^$9!#e(B
(2) sizeof(NODE*)
e$B$,e(B64bite$B$N$?$a!"e(BNODE_LMASKe$B$,e(B32bite$B$rD6$($^$9!#e(B
(3) missing/vsnprintf.ce$B$G;2>H$5$l$F$$$ke(B__uqtoa()e$B$,IaDL$O$J$5e(B
e$B$=$&$G$9!#e(B

Index: intern.h

RCS file: /home/cvs/ruby/intern.h,v
retrieving revision 1.196
diff -u -1 -p -r1.196 intern.h
— intern.h 11 Jul 2006 06:47:08 -0000 1.196
+++ intern.h 17 Jul 2006 17:08:52 -0000
@@ -22,2 +22,3 @@
#endif
+#include <st.h>

@@ -316,3 +317,3 @@ VALUE rb_gc_start(void);
/* hash.c /
-void st_foreach_safe(struct st_table , int ()(ANYARGS), unsigned
long);
+void st_foreach_safe(struct st_table , int ()(ANYARGS), st_data_t);
void rb_hash_foreach(VALUE, int (
)(ANYARGS), VALUE);
Index: node.h

RCS file: /home/cvs/ruby/node.h,v
retrieving revision 1.75
diff -u -1 -p -r1.75 node.h
— node.h 9 Jun 2006 21:20:12 -0000 1.75
+++ node.h 17 Jul 2006 17:08:52 -0000
@@ -168,3 +168,3 @@ typedef struct RNode {
#define NODE_LSHIFT (NODE_TYPESHIFT+7)
-#define NODE_LMASK (((long)1<<(sizeof(NODE*)CHAR_BIT-NODE_LSHIFT))-1)
+#define NODE_LMASK
(((SIGNED_VALUE)1<<(sizeof(NODE
)*CHAR_BIT-NODE_LSHIFT))-1)
#define nd_line(n) ((unsigned
int)(((RNODE(n))->flags>>NODE_LSHIFT)&NODE_LMASK))
Index: missing/vsnprintf.c

RCS file: /home/cvs/ruby/missing/vsnprintf.c,v
retrieving revision 1.17
diff -u -1 -p -r1.17 vsnprintf.c
— missing/vsnprintf.c 9 Jun 2006 21:20:00 -0000 1.17
+++ missing/vsnprintf.c 17 Jul 2006 17:08:52 -0000
@@ -351,2 +351,68 @@ BSD__sbprintf(register FILE *fp, const c

+#ifdef HAVE_SANE_QUAD
+/*

    • Convert an unsigned long long to ASCII for printf purposes,
      returning
    • a pointer to the first character of the string representation.
    • Octal numbers can be forced to have a leading zero; hex numbers
    • use the given digits.
  • */
    +static char *
    +BSD__uqtoa(register u_quad_t val, char *endp, int base, int octzero,
    char *xdigs)
    +{
  • register char *cp = endp;
  • register long sval;
  • /*
    • Handle the three cases separately, in the hope of getting
    • better/faster code.
  • */
  • switch (base) {
  • case 10:
  •   if (val < 10) {	/* many numbers are 1 digit */
    
  •   	*--cp = to_char(val);
    
  •   	return (cp);
    
  •   }
    
  •   /*
    
  •    * On many machines, unsigned arithmetic is harder than
    
  •    * signed arithmetic, so we do at most one unsigned mod and
    
  •    * divide; this is sufficient to reduce the range of
    
  •    * the incoming value to where signed arithmetic works.
    
  •    */
    
  •   if (val > LLONG_MAX) {
    
  •   	*--cp = to_char(val % 10);
    
  •   	sval = val / 10;
    
  •   } else
    
  •   	sval = val;
    
  •   do {
    
  •   	*--cp = to_char(sval % 10);
    
  •   	sval /= 10;
    
  •   } while (sval != 0);
    
  •   break;
    
  • case 8:
  •   do {
    
  •   	*--cp = to_char(val & 7);
    
  •   	val >>= 3;
    
  •   } while (val);
    
  •   if (octzero && *cp != '0')
    
  •   	*--cp = '0';
    
  •   break;
    
  • case 16:
  •   do {
    
  •   	*--cp = xdigs[val & 15];
    
  •   	val >>= 4;
    
  •   } while (val);
    
  •   break;
    
  • default: /* oops */
  •   /*
    
  •   abort();
    
  •   */
    
  •   break;	/* fjc 7-31-97.  Don't reference abort() here */
    
  • }
  • return (cp);
    +}
    +#endif /* HAVE_SANE_QUAD */

/*
@@ -869,3 +935,3 @@ number: if ((dprec = prec) >= 0)
if (uqval != 0 || prec != 0)

  •   			cp = __uqtoa(uqval, cp, base,
    
  •   			cp = BSD__uqtoa(uqval, cp, base,
      			    flags & ALT, xdigs);
    

e$B$=$l$G$O!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:29045] another LLP64 problems”
on Tue, 18 Jul 2006 02:11:43 +0900, “U.Nakamura”
[email protected] writes:

|FIX2LONGe$B<~$j$NOC$r=|$1$P!"e([email protected]$Oe(B(e$B$?$V$se(B)e$B$3$le(B
|e$B$,:G8e$G$9!#e(B
|
|(1) e$BA0$K$bEj$2$?5$$,$7$^$9$,!"e(Bintern.he$B$Ne(Bst_foreach_safe()[email protected](B
| [email protected]$,Dj5A$H0[$J$j$^$9!#e(B
|(2) sizeof(NODE*) e$B$,e(B64bite$B$N$?$a!"e(BNODE_LMASKe$B$,e(B32bite$B$rD6$($^$9!#e(B
|(3) missing/vsnprintf.ce$B$G;2>H$5$l$F$$$ke(B__uqtoa()e$B$,IaDL$O$J$5e(B
| e$B$=$&$G$9!#e(B

e$B%3%_%C%H$7$F$/[email protected]$5$$!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs