In 32-bite system, the size of long and point is 4 Bytes;
In 64-bite system, the size of long and point is 8 Bytes;
There is the key point.
Solution:
We still user the long as the type of address, but only the low four bytes is used actually.
1 Initial the long variable as zero.
2 In mem.c line 760
previous
unsigned long s2l(unsigned char *str)
{union {
unsigned long l;
unsigned char c[Intbytes];
} notype;
notype.c[0]=str[0];
notype.c[1]=str[1];
notype.c[2]=str[2];
notype.c[3]=str[3];
return(notype.l);
}
Modified
unsigned int s2l(unsigned char *str)
{union {
unsigned int l;
unsigned char c[Intbytes];
} notype;
notype.c[0]=str[0];
notype.c[1]=str[1];
notype.c[2]=str[2];
notype.c[3]=str[3];
return(notype.l);
}
3 In syn.h line 45
Previous
#define stol(x) (*((unsigned long *) (x)))
typedef struct wtnttype {
unsigned char* wtnts[Maxwtnts];
int from[Maxwtnts]; /*from pid or from scope*/
int wtntc;
struct wtnttype *more;
} wtnt_t;
Modified
#define stol(x) (*((unsigned int *) (x)))
typedef struct wtnttype {
unsigned int wtnts[Maxwtnts];
int from[Maxwtnts]; /*from pid or from scope*/
int wtntc;
struct wtnttype *more;
} wtnt_t;
4 In syn.c line 75 and 76
Previous
void grantlock(long lock, int toproc, int acqscope);
void grantbarr(long lock);
Modified
void grantlock(int lock, int toproc, int acqscope);
void grantbarr(int lock);