PR# 13777 Some uses of constant 0x7FFFFFFF are wrong for 64-bit Eiffel

Problem Report Summary
Submitter: prestoat2000
Category: Runtime
Priority: Low
Date: 2007/12/18
Class: Bug
Severity: Non-critical
Number: 13777
Release: 6.1.71555
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.8.1.9) Gecko/20071111 Firefox/2.0.0.9 Solaris 10 on x86
Synopsis: Some uses of constant 0x7FFFFFFF are wrong for 64-bit Eiffel

Description
Some of the uses of constant 0x7FFFFFFF, intended to represent the maximum
integer or long integer, are incorrect for 64-bit Eiffel.  For example,
in garcol.c we have:

                        if (plsc_per < 0) {
                                        /* Overflow here, so restore back the m\ax positive integer value */
                                plsc_per = 0x7FFFFFFF;

Since the type of `plsc_per' is long, this is not the maximum long integer.

Similarly this is wrong (also in garcol.c):

              EIF_INTEGER max_size = 0, min_size = 0x7fffffff;

You should do a case-independent search for "0x7fffffff" (there are only 22
occurences) and review them to see which are incorrect.

I suggest #include <values.h> somewhere to make MAXINT and MAXLONG available
and use them instead of constants, assuming this is ANSI standard.  You can
add your own defines if necessary.

To Reproduce

										
Problem Report Interactions