[#8136] Confused exception handling in Continuation Context — "Robert Dober" <robert.dober@...>

Hi all

13 messages 2006/07/06

[#8248] One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...>

I just posted this to ruby-talk. But I would also like to discuss this

33 messages 2006/07/18
[#8264] Re: One-Click Installer: MinGW? or VC2005? — Charlie Savage <cfis@...> 2006/07/19

From my experience using both tool chains on Windows (for the ruby-prof

[#8266] Re: One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...> 2006/07/19

Tim, I'm going to top reply since your post was so long. I'm interested in

[#8267] Re: One-Click Installer: MinGW? or VC2005? — Charlie Savage <cfis@...> 2006/07/19

> Tim, I'm going to top reply since your post was so long. I'm interested in

[#8271] my sandboxing extension!! — why the lucky stiff <ruby-core@...>

I have (what feels like) very exciting news. I finally sat down to code up my

17 messages 2006/07/19

[#8430] Re: doc patch: weakref. — "Berger, Daniel" <Daniel.Berger@...>

> -----Original Message-----

19 messages 2006/07/28
[#8434] Re: doc patch: weakref. — Yukihiro Matsumoto <matz@...> 2006/07/29

Hi,

[#8436] Re: doc patch: weakref. — Daniel Berger <djberg96@...> 2006/07/29

Yukihiro Matsumoto wrote:

[#8437] Re: doc patch: weakref. — Mauricio Fernandez <mfp@...> 2006/07/29

On Sat, Jul 29, 2006 at 07:37:24PM +0900, Daniel Berger wrote:

[#8441] Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...>

I have the following code:

18 messages 2006/07/30
[#8442] Re: Inconsistency in scoping during module_eval? — nobu@... 2006/07/30

Hi,

[#8443] Re: Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...> 2006/07/30

Why does this:

[#8445] Re: Inconsistency in scoping during module_eval? — Yukihiro Matsumoto <matz@...> 2006/07/30

Hi,

[#8454] Re: Inconsistency in scoping during module_eval? — "Charles O Nutter" <headius@...> 2006/07/31

So to clarify...

[PATCH] ruby 1.9 HEAD 64 bit warnings clean up

From: ville.mattila@...
Date: 2006-07-03 10:04:45 UTC
List: ruby-core #8120
Hello,

This patch fixes the follwing  warnings sun studio 11 cc warnings. 
"../bignum.c", line 1252: warning: integer overflow detected: op "<<" 
"../bignum.c", line 1255: warning: integer overflow detected: op "<<"
"../time.c", line 1932: warning: integer overflow detected: op "<<" 
"../time.c", line 1997: warning: integer overflow detected: op "<<" 
"../time.c", line 2003: warning: integer overflow detected: op "<<"
"../st.c", line 571: warning: initializer does not fit or is out of range: 
0x811c9dc5 
"../string.c" 848: warning: initializer does not fit or is out of range: 
0x811c9dc5
"../regparse.c", line 56: warning: integer overflow detected: op "<<" 
"../regparse.c", line 56: warning: initializer does not fit or is out of 
range:\
 -2086665253 
The string.c, st.c and oniguruma.h  fixes should be reviewed carefully. 
They  seem to work ok for me.
there is also a fix for dl.c so that the sun studio compiler can compile 
it.

Btw, the "make test-all" is not update. Too many tests fails...


Attachments (1)

sun_studio_64_bit_warnings.patch (15.8 KB, text/x-diff)
? future-beat
? sun_studio_64_bit_warnings.patch
? sun_studio_cc_dl.patch
Index: bignum.c
===================================================================
RCS file: /src/ruby/bignum.c,v
retrieving revision 1.130
diff -u -p -r1.130 bignum.c
--- bignum.c	27 Jun 2006 16:15:22 -0000	1.130
+++ bignum.c	3 Jul 2006 09:57:26 -0000
@@ -1249,8 +1249,8 @@ bigdivrem(VALUE x, VALUE y, VALUE *divp,
 
     dd = 0;
     q = yds[ny-1];
-    while ((q & (1<<(BITSPERDIG-1))) == 0) {
-	q <<= 1;
+    while ((q & (1UL<<(BITSPERDIG-1))) == 0) {
+	q <<= 1UL;
 	dd++;
     }
     if (dd) {
Index: dir.c
===================================================================
RCS file: /src/ruby/dir.c,v
retrieving revision 1.152
diff -u -p -r1.152 dir.c
--- dir.c	9 Jun 2006 21:20:13 -0000	1.152
+++ dir.c	3 Jul 2006 09:57:32 -0000
@@ -921,7 +921,7 @@ sys_warning_1(const char* mesg)
     rb_sys_warning("%s", mesg);
 }
 
-#define GLOB_VERBOSE	(1 << (sizeof(int) * CHAR_BIT - 1))
+#define GLOB_VERBOSE	(1UL << (sizeof(int) * CHAR_BIT - 1))
 #define sys_warning(val) \
     ((flags & GLOB_VERBOSE) && rb_protect((VALUE (*)_((VALUE)))sys_warning_1, (VALUE)(val), 0))
 
Index: oniguruma.h
===================================================================
RCS file: /src/ruby/oniguruma.h,v
retrieving revision 1.15
diff -u -p -r1.15 oniguruma.h
--- oniguruma.h	10 May 2006 14:41:20 -0000	1.15
+++ oniguruma.h	3 Jul 2006 09:57:34 -0000
@@ -457,8 +457,8 @@ typedef unsigned int        OnigOptionTy
 #define ONIG_OPTION_DEFAULT            ONIG_OPTION_NONE
 
 /* options */
-#define ONIG_OPTION_NONE                 0
-#define ONIG_OPTION_IGNORECASE           1L
+#define ONIG_OPTION_NONE                 0U
+#define ONIG_OPTION_IGNORECASE           1U
 #define ONIG_OPTION_EXTEND               (ONIG_OPTION_IGNORECASE         << 1)
 #define ONIG_OPTION_MULTILINE            (ONIG_OPTION_EXTEND             << 1)
 #define ONIG_OPTION_SINGLELINE           (ONIG_OPTION_MULTILINE          << 1)
@@ -513,81 +513,81 @@ ONIG_EXTERN OnigSyntaxType*   OnigDefaul
 #define ONIG_SYNTAX_DEFAULT   OnigDefaultSyntax
 
 /* syntax (operators) */
-#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS    (1<<0)
-#define ONIG_SYN_OP_DOT_ANYCHAR                 (1<<1)   /* . */
-#define ONIG_SYN_OP_ASTERISK_ZERO_INF           (1<<2)   /* * */
-#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF       (1<<3)
-#define ONIG_SYN_OP_PLUS_ONE_INF                (1<<4)   /* + */
-#define ONIG_SYN_OP_ESC_PLUS_ONE_INF            (1<<5)
-#define ONIG_SYN_OP_QMARK_ZERO_ONE              (1<<6)   /* ? */
-#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE          (1<<7)
-#define ONIG_SYN_OP_BRACE_INTERVAL              (1<<8)   /* {lower,upper} */
-#define ONIG_SYN_OP_ESC_BRACE_INTERVAL          (1<<9)   /* \{lower,upper\} */
-#define ONIG_SYN_OP_VBAR_ALT                    (1<<10)   /* | */
-#define ONIG_SYN_OP_ESC_VBAR_ALT                (1<<11)  /* \| */
-#define ONIG_SYN_OP_LPAREN_SUBEXP               (1<<12)  /* (...)   */
-#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP           (1<<13)  /* \(...\) */
-#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR           (1<<14)  /* \A, \Z, \z */
-#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR  (1<<15)  /* \G     */
-#define ONIG_SYN_OP_DECIMAL_BACKREF             (1<<16)  /* \num   */
-#define ONIG_SYN_OP_BRACKET_CC                  (1<<17)  /* [...]  */
-#define ONIG_SYN_OP_ESC_W_WORD                  (1<<18)  /* \w, \W */
-#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END     (1<<19)  /* \<. \> */
-#define ONIG_SYN_OP_ESC_B_WORD_BOUND            (1<<20)  /* \b, \B */
-#define ONIG_SYN_OP_ESC_S_WHITE_SPACE           (1<<21)  /* \s, \S */
-#define ONIG_SYN_OP_ESC_D_DIGIT                 (1<<22)  /* \d, \D */
-#define ONIG_SYN_OP_LINE_ANCHOR                 (1<<23)  /* ^, $   */
-#define ONIG_SYN_OP_POSIX_BRACKET               (1<<24)  /* [:xxxx:] */
-#define ONIG_SYN_OP_QMARK_NON_GREEDY            (1<<25)  /* ??,*?,+?,{n,m}? */
-#define ONIG_SYN_OP_ESC_CONTROL_CHARS           (1<<26)  /* \n,\r,\t,\a ... */
-#define ONIG_SYN_OP_ESC_C_CONTROL               (1<<27)  /* \cx  */
-#define ONIG_SYN_OP_ESC_OCTAL3                  (1<<28)  /* \OOO */
-#define ONIG_SYN_OP_ESC_X_HEX2                  (1<<29)  /* \xHH */
-#define ONIG_SYN_OP_ESC_X_BRACE_HEX8            (1<<30)  /* \x{7HHHHHHH} */
-
-#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE        (1<<0)   /* \Q...\E */
-#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT         (1<<1)   /* (?...) */
-#define ONIG_SYN_OP2_OPTION_PERL                (1<<2)   /* (?imsx),(?-imsx) */
-#define ONIG_SYN_OP2_OPTION_RUBY                (1<<3)   /* (?imx), (?-imx)  */
-#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT     (1<<4)   /* ?+,*+,++ */
-#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL   (1<<5)   /* {n,m}+   */
-#define ONIG_SYN_OP2_CCLASS_SET_OP              (1<<6)   /* [...&&..[..]..] */
-#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP       (1<<7)   /* (?<name>...) */
-#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF        (1<<8)   /* \k<name> */
-#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL          (1<<9)   /* \g<name>, \g<n> */
-#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY     (1<<10)  /* (?@..),(?@<x>..) */
-#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL  (1<<11)  /* \C-x */
-#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META     (1<<12)  /* \M-x */
-#define ONIG_SYN_OP2_ESC_V_VTAB                 (1<<13)  /* \v as VTAB */
-#define ONIG_SYN_OP2_ESC_U_HEX4                 (1<<14)  /* \uHHHH */
-#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR         (1<<15)  /* \`, \' */
-#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY  (1<<16)  /* \p{...}, \P{...} */
-#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1<<17)  /* \p{^..}, \P{^..} */
-#define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS    (1<<18)  /* \p{IsXDigit} */
-#define ONIG_SYN_OP2_ESC_H_XDIGIT               (1<<19)  /* \h, \H */
-#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE         (1<<20)  /* \ */
+#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS    (1U<<0)
+#define ONIG_SYN_OP_DOT_ANYCHAR                 (1U<<1)   /* . */
+#define ONIG_SYN_OP_ASTERISK_ZERO_INF           (1U<<2)   /* * */
+#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF       (1U<<3)
+#define ONIG_SYN_OP_PLUS_ONE_INF                (1U<<4)   /* + */
+#define ONIG_SYN_OP_ESC_PLUS_ONE_INF            (1U<<5)
+#define ONIG_SYN_OP_QMARK_ZERO_ONE              (1U<<6)   /* ? */
+#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE          (1U<<7)
+#define ONIG_SYN_OP_BRACE_INTERVAL              (1U<<8)   /* {lower,upper} */
+#define ONIG_SYN_OP_ESC_BRACE_INTERVAL          (1U<<9)   /* \{lower,upper\} */
+#define ONIG_SYN_OP_VBAR_ALT                    (1U<<10)   /* | */
+#define ONIG_SYN_OP_ESC_VBAR_ALT                (1U<<11)  /* \| */
+#define ONIG_SYN_OP_LPAREN_SUBEXP               (1U<<12)  /* (...)   */
+#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP           (1U<<13)  /* \(...\) */
+#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR           (1U<<14)  /* \A, \Z, \z */
+#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR  (1U<<15)  /* \G     */
+#define ONIG_SYN_OP_DECIMAL_BACKREF             (1U<<16)  /* \num   */
+#define ONIG_SYN_OP_BRACKET_CC                  (1U<<17)  /* [...]  */
+#define ONIG_SYN_OP_ESC_W_WORD                  (1U<<18)  /* \w, \W */
+#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END     (1U<<19)  /* \<. \> */
+#define ONIG_SYN_OP_ESC_B_WORD_BOUND            (1U<<20)  /* \b, \B */
+#define ONIG_SYN_OP_ESC_S_WHITE_SPACE           (1U<<21)  /* \s, \S */
+#define ONIG_SYN_OP_ESC_D_DIGIT                 (1U<<22)  /* \d, \D */
+#define ONIG_SYN_OP_LINE_ANCHOR                 (1U<<23)  /* ^, $   */
+#define ONIG_SYN_OP_POSIX_BRACKET               (1U<<24)  /* [:xxxx:] */
+#define ONIG_SYN_OP_QMARK_NON_GREEDY            (1U<<25)  /* ??,*?,+?,{n,m}? */
+#define ONIG_SYN_OP_ESC_CONTROL_CHARS           (1U<<26)  /* \n,\r,\t,\a ... */
+#define ONIG_SYN_OP_ESC_C_CONTROL               (1U<<27)  /* \cx  */
+#define ONIG_SYN_OP_ESC_OCTAL3                  (1U<<28)  /* \OOO */
+#define ONIG_SYN_OP_ESC_X_HEX2                  (1U<<29)  /* \xHH */
+#define ONIG_SYN_OP_ESC_X_BRACE_HEX8            (1U<<30)  /* \x{7HHHHHHH} */
+
+#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE        (1U<<0)  /* \Q...\E */
+#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT         (1U<<1)  /* (?...) */
+#define ONIG_SYN_OP2_OPTION_PERL                (1U<<2)  /* (?imsx),(?-imsx) */
+#define ONIG_SYN_OP2_OPTION_RUBY                (1U<<3)  /* (?imx), (?-imx)  */
+#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT     (1U<<4)  /* ?+,*+,++ */
+#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL   (1U<<5)  /* {n,m}+   */
+#define ONIG_SYN_OP2_CCLASS_SET_OP              (1U<<6)  /* [...&&..[..]..] */
+#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP       (1U<<7)  /* (?<name>...) */
+#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF        (1U<<8)  /* \k<name> */
+#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL          (1U<<9)  /* \g<name>, \g<n> */
+#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY     (1U<<10) /* (?@..),(?@<x>..) */
+#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL  (1U<<11) /* \C-x */
+#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META     (1U<<12) /* \M-x */
+#define ONIG_SYN_OP2_ESC_V_VTAB                 (1U<<13) /* \v as VTAB */
+#define ONIG_SYN_OP2_ESC_U_HEX4                 (1U<<14) /* \uHHHH */
+#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR         (1U<<15) /* \`, \' */
+#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY  (1U<<16) /* \p{...}, \P{...} */
+#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
+#define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS    (1U<<18) /* \p{IsXDigit} */
+#define ONIG_SYN_OP2_ESC_H_XDIGIT               (1U<<19) /* \h, \H */
+#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE         (1U<<20) /* \ */
 
 /* syntax (behavior) */
-#define ONIG_SYN_CONTEXT_INDEP_ANCHORS           (1<<31) /* not implemented */
-#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS        (1<<0)  /* ?, *, +, {n,m} */
-#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS      (1<<1)  /* error or ignore */
-#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP    (1<<2)  /* ...)... */
-#define ONIG_SYN_ALLOW_INVALID_INTERVAL          (1<<3)  /* {??? */
-#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV       (1<<4)  /* {,n} => {0,n} */
-#define ONIG_SYN_STRICT_CHECK_BACKREF            (1<<5)  /* /(\1)/,/\1()/ ..*/
-#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND   (1<<6)  /* (?<=a|bc) */
-#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP        (1<<7)  /* see doc/RE */
-#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1<<8)  /* (?<x>)(?<x>) */
-#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY   (1<<9)  /* a{n}?=(?:a{n})? */
+#define ONIG_SYN_CONTEXT_INDEP_ANCHORS           (1U<<31) /* not implemented */
+#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS        (1U<<0)  /* ?, *, +, {n,m} */
+#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS      (1U<<1)  /* error or ignore */
+#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP    (1U<<2)  /* ...)... */
+#define ONIG_SYN_ALLOW_INVALID_INTERVAL          (1U<<3)  /* {??? */
+#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV       (1U<<4)  /* {,n} => {0,n} */
+#define ONIG_SYN_STRICT_CHECK_BACKREF            (1U<<5)  /* /(\1)/,/\1()/ ..*/
+#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND   (1U<<6)  /* (?<=a|bc) */
+#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP        (1U<<7)  /* see doc/RE */
+#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8)  /* (?<x>)(?<x>) */
+#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY   (1U<<9)  /* a{n}?=(?:a{n})? */
 
 /* syntax (behavior) in char class [...] */
-#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC      (1<<20) /* [^...] */
-#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC          (1<<21) /* [..\w..] etc.. */
-#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC         (1<<22)
-#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC     (1<<23) /* [0-9-a]=[0-9\-a] */
+#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC      (1U<<20) /* [^...] */
+#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC          (1U<<21) /* [..\w..] etc.. */
+#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC         (1U<<22)
+#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC     (1U<<23) /* [0-9-a]=[0-9\-a] */
 /* syntax (behavior) warning */
-#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED          (1<<24) /* [,-,] */
-#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT    (1<<25) /* (?:a*)+ */
+#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED          (1U<<24) /* [,-,] */
+#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT    (1U<<25) /* (?:a*)+ */
 
 /* meta character specifiers (onig_set_meta_char()) */
 #define ONIG_META_CHAR_ESCAPE               0
Index: st.c
===================================================================
RCS file: /src/ruby/st.c,v
retrieving revision 1.40
diff -u -p -r1.40 st.c
--- st.c	9 Jun 2006 21:20:10 -0000	1.40
+++ st.c	3 Jul 2006 09:57:43 -0000
@@ -568,14 +568,14 @@ st_foreach(st_table *table, int (*func)(
 static int
 strhash(register const char *string)
 {
-    register int hval = FNV1_32A_INIT;
+    register unsigned int hval = FNV1_32A_INIT;
 
     /*
      * FNV-1a hash each octet in the buffer
      */
     while (*string) {
 	/* xor the bottom with the current octet */
-	hval ^= (int)*string++;
+	hval ^= (unsigned int)*string++;
 
 	/* multiply by the 32 bit FNV magic prime mod 2^32 */
 	hval *= FNV_32_PRIME;
Index: string.c
===================================================================
RCS file: /src/ruby/string.c,v
retrieving revision 1.251
diff -u -p -r1.251 string.c
--- string.c	2 Jul 2006 16:20:16 -0000	1.251
+++ string.c	3 Jul 2006 09:57:46 -0000
@@ -845,14 +845,14 @@ rb_str_hash(VALUE str)
 {
     register long len = RSTRING(str)->len;
     register char *p = RSTRING(str)->ptr;
-    register int hval = FNV1_32A_INIT;
+    register unsigned int hval = FNV1_32A_INIT;
 
     /*
      * FNV-1a hash each octet in the buffer
      */
     while (len--) {
 	/* xor the bottom with the current octet */
-	hval ^= (int)*p++;
+	hval ^= (unsigned int)*p++;
 
 	/* multiply by the 32 bit FNV magic prime mod 2^32 */
 #if defined(FNV_GCC_OPTIMIZATION)
Index: time.c
===================================================================
RCS file: /src/ruby/time.c,v
retrieving revision 1.113
diff -u -p -r1.113 time.c
--- time.c	9 Jun 2006 21:20:10 -0000	1.113
+++ time.c	3 Jul 2006 09:57:47 -0000
@@ -1923,8 +1923,8 @@ time_mdump(VALUE time)
 
     if ((tm->tm_year & 0xffff) != tm->tm_year)
 	rb_raise(rb_eArgError, "year too big to marshal");
-
-    p = 0x1          << 31 | /*  1 */
+ 
+    p = 0x1UL          << 31 | /*  1 */
 	tobj->gmt    << 30 | /*  1 */
 	tm->tm_year  << 14 | /* 16 */
 	tm->tm_mon   << 10 | /*  4 */
@@ -1994,13 +1994,13 @@ time_mload(VALUE time, VALUE str)
 	s |= buf[i]<<(8*(i-4));
     }
 
-    if ((p & (1<<31)) == 0) {
+    if ((p & (1UL<<31)) == 0) {
         gmt = 0;
 	sec = p;
 	usec = s;
     }
     else {
-	p &= ~(1<<31);
+	p &= ~(1UL<<31);
 	gmt        = (p >> 30) & 0x1;
 	tm.tm_year = (p >> 14) & 0xffff;
 	tm.tm_mon  = (p >> 10) & 0xf;
Index: ext/dl/cfunc.c
===================================================================
RCS file: /src/ruby/ext/dl/cfunc.c,v
retrieving revision 1.5
diff -u -p -r1.5 cfunc.c
--- ext/dl/cfunc.c	30 Jun 2006 18:05:34 -0000	1.5
+++ ext/dl/cfunc.c	3 Jul 2006 09:57:48 -0000
@@ -229,6 +229,10 @@ rb_dlcfunc_inspect(VALUE self)
 #elif defined(_MSC_VER) || defined(__BORLANDC__)
 # define DECL_FUNC_CDECL(f,ret,args)  ret (__cdecl *f)(args)
 # define DECL_FUNC_STDCALL(f,ret,args)  ret (__stdcall *f)(args)
+#elif defined(__SUNPRO_C)
+# define DECL_FUNC(f,ret,args,calltype)  ret (*f)(args) 
+# define DECL_FUNC_CDECL(f,ret,args)  ret (*f)(args)
+# define DECL_FUNC_STDCALL(f,ret,args)  ret (*f)(args)
 #else
 # error "unsupported compiler."
 #endif
Index: ext/dl/dl.c
===================================================================
RCS file: /src/ruby/ext/dl/dl.c,v
retrieving revision 1.29
diff -u -p -r1.29 dl.c
--- ext/dl/dl.c	14 May 2005 20:59:06 -0000	1.29
+++ ext/dl/dl.c	3 Jul 2006 09:57:48 -0000
@@ -70,6 +70,13 @@ rb_dl_value2ptr(VALUE self, VALUE val)
 # define MIDST_DECL_STDCALL   __stdcall
 # define POST_DECL_CDECL
 # define POST_DECL_STDCALL
+#elif (__SUNPRO_C)
+# define PRE_DECL_CDECL
+# define PRE_DECL_STDCALL
+# define MIDST_DECL_CDECL   
+# define MIDST_DECL_STDCALL 
+# define POST_DECL_CDECL
+# define POST_DECL_STDCALL
 #else
 # error "unsupported compiler"
 #endif

In This Thread

Prev Next