Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
33d9bef5
Commit
33d9bef5
authored
Apr 26, 1993
by
Kresten Krab Thorup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed unsigned int to size_t when casting pointers to integers
From-SVN: r4233
parent
e312f965
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
30 deletions
+37
-30
gcc/objc/hash.h
+7
-3
gcc/objc/init.c
+1
-1
gcc/objc/objc.h
+1
-1
gcc/objc/sarray.c
+9
-9
gcc/objc/sarray.h
+14
-11
gcc/objc/selector.c
+2
-2
gcc/objc/sendmsg.c
+3
-3
No files found.
gcc/objc/hash.h
View file @
33d9bef5
...
...
@@ -27,7 +27,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef __hash_INCLUDE_GNU
#define __hash_INCLUDE_GNU
#ifdef IN_OBJC
#include "gstddef.h"
#else
#include <stddef.h>
#endif
/*
* This data structure is used to hold items
...
...
@@ -152,10 +156,10 @@ void *hash_value_for_key (cache_ptr cache, const void *key);
manipulation of the key pointer. (Use the lowest bits
except for those likely to be 0 due to alignment.) */
static
inline
unsigned
int
static
inline
unsigned
int
hash_ptr
(
cache_ptr
cache
,
const
void
*
key
)
{
return
((
unsigned
in
t
)
key
/
sizeof
(
void
*
))
&
cache
->
mask
;
return
((
size_
t
)
key
/
sizeof
(
void
*
))
&
cache
->
mask
;
}
...
...
gcc/objc/init.c
View file @
33d9bef5
...
...
@@ -241,7 +241,7 @@ __objc_init_protocols (struct objc_protocol_list* protos)
for
(
i
=
0
;
i
<
protos
->
count
;
i
++
)
{
if
(((
in
t
)((
id
)
protos
->
list
[
i
])
->
class_pointer
)
==
PROTOCOL_VERSION
)
if
(((
size_
t
)((
id
)
protos
->
list
[
i
])
->
class_pointer
)
==
PROTOCOL_VERSION
)
((
id
)
protos
->
list
[
i
])
->
class_pointer
=
proto_class
;
else
{
...
...
gcc/objc/objc.h
View file @
33d9bef5
...
...
@@ -485,7 +485,7 @@ extern __inline__ IMP
objc_msg_lookup
(
id
receiver
,
SEL
op
)
{
if
(
receiver
)
return
sarray_get
(
receiver
->
class_pointer
->
dtable
,
(
unsigned
in
t
)
op
);
return
sarray_get
(
receiver
->
class_pointer
->
dtable
,
(
size_
t
)
op
);
else
return
nil_method
;
}
...
...
gcc/objc/sarray.c
View file @
33d9bef5
...
...
@@ -46,10 +46,10 @@ sarray_at_put(struct sarray* array, sidx index, void* element)
struct
sindex
**
the_index
;
struct
sbucket
**
the_bucket
;
#ifdef OBJC_SPARSE3
unsigned
in
t
ioffset
;
size_
t
ioffset
;
#endif
unsigned
in
t
boffset
;
unsigned
in
t
eoffset
;
size_
t
boffset
;
size_
t
eoffset
;
#ifdef PRECOMPUTE_SELECTORS
union
sofftype
xx
;
xx
.
idx
=
index
;
...
...
@@ -139,9 +139,9 @@ struct sarray*
sarray_new
(
int
size
,
void
*
default_element
)
{
#ifdef OBJC_SPARSE3
unsigned
num_indices
=
((
size
-
1
)
/
(
INDEX_CAPACITY
))
+
1
;
size_t
num_indices
=
((
size
-
1
)
/
(
INDEX_CAPACITY
))
+
1
;
#else
/* OBJC_SPARSE2 */
unsigned
num_indices
=
((
size
-
1
)
/
BUCKET_SIZE
)
+
1
;
size_t
num_indices
=
((
size
-
1
)
/
BUCKET_SIZE
)
+
1
;
#endif
int
counter
;
struct
sarray
*
arr
;
...
...
@@ -314,9 +314,9 @@ sarray_realloc(struct sarray* array, int newsize)
void
sarray_free
(
struct
sarray
*
array
)
{
#ifdef OBJC_SPARSE3
unsigned
in
t
old_max_index
=
(
array
->
capacity
-
1
)
/
INDEX_CAPACITY
;
size_
t
old_max_index
=
(
array
->
capacity
-
1
)
/
INDEX_CAPACITY
;
#else
unsigned
in
t
old_max_index
=
(
array
->
capacity
-
1
)
/
BUCKET_SIZE
;
size_
t
old_max_index
=
(
array
->
capacity
-
1
)
/
BUCKET_SIZE
;
#endif
int
counter
=
0
;
...
...
@@ -393,9 +393,9 @@ struct sarray*
sarray_lazy_copy
(
struct
sarray
*
oarr
)
{
#ifdef OBJC_SPARSE3
unsigned
num_indices
=
((
oarr
->
capacity
-
1
)
/
INDEX_CAPACITY
)
+
1
;
size_t
num_indices
=
((
oarr
->
capacity
-
1
)
/
INDEX_CAPACITY
)
+
1
;
#else
/* OBJC_SPARSE2 */
unsigned
num_indices
=
((
oarr
->
capacity
-
1
)
/
BUCKET_SIZE
)
+
1
;
size_t
num_indices
=
((
oarr
->
capacity
-
1
)
/
BUCKET_SIZE
)
+
1
;
#endif
struct
sarray
*
arr
;
...
...
gcc/objc/sarray.h
View file @
33d9bef5
...
...
@@ -52,6 +52,9 @@ extern int idxsize;
#include <assert.h>
/* An unsigned integer of same size as a pointer */
#define SIZET_BITS (sizeof(size_t)*8)
#if defined(sparc) || defined(OBJC_SPARSE2)
#define PRECOMPUTE_SELECTORS
#endif
...
...
@@ -79,24 +82,24 @@ extern int idxsize;
#endif
/* OBJC_SPARSE2 */
typedef
unsigned
in
t
sidx
;
typedef
size_
t
sidx
;
#ifdef PRECOMPUTE_SELECTORS
struct
soffset
{
#ifdef OBJC_SPARSE3
unsigned
char
unused
;
unsigned
char
eoffset
;
unsigned
char
boffset
;
unsigned
char
ioffset
;
unsigned
int
unused
:
SIZET_BITS
/
4
;
unsigned
int
eoffset
:
SIZET_BITS
/
4
;
unsigned
int
boffset
:
SIZET_BITS
/
4
;
unsigned
int
ioffset
:
SIZET_BITS
/
4
;
#else
/* OBJC_SPARSE2 */
#ifdef sparc
unsigned
int
boffset
:
30
-
BUCKET_BITS
;
unsigned
int
boffset
:
(
SIZET_BITS
-
2
)
-
BUCKET_BITS
;
unsigned
int
eoffset
:
BUCKET_BITS
;
unsigned
int
unused
:
2
;
#else
unsigned
short
boffset
;
unsigned
short
eoffset
;
unsigned
int
boffset
:
SIZET_BITS
/
2
;
unsigned
int
eoffset
:
SIZET_BITS
/
2
;
#endif
#endif
/* OBJC_SPARSE2 */
};
...
...
@@ -165,7 +168,7 @@ soffset_decode(sidx index)
}
static
inline
sidx
soffset_encode
(
unsigned
in
t
offset
)
soffset_encode
(
size_
t
offset
)
{
union
sofftype
x
;
x
.
off
.
eoffset
=
offset
%
BUCKET_SIZE
;
...
...
@@ -180,14 +183,14 @@ soffset_encode(unsigned int offset)
#else
/* not PRECOMPUTE_SELECTORS */
static
inline
unsigned
in
t
static
inline
size_
t
soffset_decode
(
sidx
index
)
{
return
index
;
}
static
inline
sidx
soffset_encode
(
unsigned
in
t
offset
)
soffset_encode
(
size_
t
offset
)
{
return
offset
;
}
...
...
gcc/objc/selector.c
View file @
33d9bef5
...
...
@@ -95,8 +95,8 @@ sel_get_uid (const char *name)
const
char
*
sel_get_name
(
SEL
selector
)
{
if
((
soffset_decode
((
unsigned
)
selector
)
>
0
)
&&
(
soffset_decode
((
unsigned
)
selector
)
<=
__objc_selector_max_index
))
if
((
soffset_decode
((
sidx
)
selector
)
>
0
)
&&
(
soffset_decode
((
sidx
)
selector
)
<=
__objc_selector_max_index
))
return
sarray_get
(
__objc_selector_array
,
(
sidx
)
selector
);
else
return
NULL
;
...
...
gcc/objc/sendmsg.c
View file @
33d9bef5
...
...
@@ -68,10 +68,10 @@ __inline__ IMP
get_imp
(
Class_t
class
,
SEL
sel
)
{
#ifdef OBJC_SPARSE_LOOKUP
void
*
res
=
sarray_get
(
class
->
dtable
,
(
unsigned
in
t
)
sel
);
void
*
res
=
sarray_get
(
class
->
dtable
,
(
size_
t
)
sel
);
if
(
res
==
__objc_init_install_dtable
)
__objc_install_dispatch_table_for_class
(
class
);
return
sarray_get
(
class
->
dtable
,
(
unsigned
in
t
)
sel
);
return
sarray_get
(
class
->
dtable
,
(
size_
t
)
sel
);
#else
return
cache_get
(
class
,
sel
);
#endif
...
...
@@ -529,7 +529,7 @@ __objc_double_cache(Cache_t cache)
static
Cache_t
__objc_cache_insert
(
Cache_t
cache
,
SEL
op
,
IMP
imp
)
{
int
index
=
((
unsigned
in
t
)
op
)
&
(
cache
)
->
mask
;
int
index
=
((
size_
t
)
op
)
&
(
cache
)
->
mask
;
if
(
op
==
0
)
return
cache
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment