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
e2d79607
Commit
e2d79607
authored
24 years ago
by
Bryce McKinlay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-indent in preparation for diff.
From-SVN: r37115
parent
db50e427
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
36 deletions
+36
-36
libjava/java/util/BitSet.java
+36
-36
No files found.
libjava/java/util/BitSet.java
View file @
e2d79607
...
...
@@ -2,11 +2,11 @@
/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package
java
.
util
;
import
java.io.Serializable
;
...
...
@@ -22,9 +22,9 @@ import java.io.Serializable;
public
final
class
BitSet
implements
Cloneable
,
Serializable
{
public
void
and
(
BitSet
bs
)
public
void
and
(
BitSet
bs
)
{
int
max
=
Math
.
min
(
bits
.
length
,
bs
.
bits
.
length
);
int
max
=
Math
.
min
(
bits
.
length
,
bs
.
bits
.
length
);
int
i
;
for
(
i
=
0
;
i
<
max
;
++
i
)
bits
[
i
]
&=
bs
.
bits
[
i
];
...
...
@@ -32,44 +32,44 @@ public final class BitSet implements Cloneable, Serializable
bits
[
i
]
=
0
;
}
public
BitSet
()
public
BitSet
()
{
this
(
64
);
this
(
64
);
}
public
BitSet
(
int
nbits
)
public
BitSet
(
int
nbits
)
{
if
(
nbits
<
0
)
throw
new
NegativeArraySizeException
();
throw
new
NegativeArraySizeException
();
int
length
=
nbits
/
64
;
if
(
nbits
%
64
!=
0
)
++
length
;
bits
=
new
long
[
length
];
}
public
void
clear
(
int
pos
)
public
void
clear
(
int
pos
)
{
if
(
pos
<
0
)
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
bit
=
pos
%
64
;
int
offset
=
pos
/
64
;
ensure
(
offset
);
ensure
(
offset
);
bits
[
offset
]
&=
~(
1L
<<
bit
);
}
public
Object
clone
()
public
Object
clone
()
{
BitSet
bs
=
new
BitSet
(
bits
.
length
*
64
);
System
.
arraycopy
(
bits
,
0
,
bs
.
bits
,
0
,
bits
.
length
);
BitSet
bs
=
new
BitSet
(
bits
.
length
*
64
);
System
.
arraycopy
(
bits
,
0
,
bs
.
bits
,
0
,
bits
.
length
);
return
bs
;
}
public
boolean
equals
(
Object
obj
)
public
boolean
equals
(
Object
obj
)
{
if
(!(
obj
instanceof
BitSet
))
return
false
;
BitSet
bs
=
(
BitSet
)
obj
;
int
max
=
Math
.
min
(
bits
.
length
,
bs
.
bits
.
length
);
int
max
=
Math
.
min
(
bits
.
length
,
bs
.
bits
.
length
);
int
i
;
for
(
i
=
0
;
i
<
max
;
++
i
)
if
(
bits
[
i
]
!=
bs
.
bits
[
i
])
...
...
@@ -84,10 +84,10 @@ public final class BitSet implements Cloneable, Serializable
return
true
;
}
public
boolean
get
(
int
pos
)
public
boolean
get
(
int
pos
)
{
if
(
pos
<
0
)
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
bit
=
pos
%
64
;
int
offset
=
pos
/
64
;
...
...
@@ -98,7 +98,7 @@ public final class BitSet implements Cloneable, Serializable
return
(
bits
[
offset
]
&
(
1L
<<
bit
))
==
0
?
false
:
true
;
}
public
int
hashCode
()
public
int
hashCode
()
{
long
h
=
1234
;
for
(
int
i
=
bits
.
length
-
1
;
i
>=
0
;
--
i
)
...
...
@@ -106,32 +106,32 @@ public final class BitSet implements Cloneable, Serializable
return
(
int
)
((
h
>>
32
)
^
h
);
}
public
void
or
(
BitSet
bs
)
public
void
or
(
BitSet
bs
)
{
ensure
(
bs
.
bits
.
length
-
1
);
ensure
(
bs
.
bits
.
length
-
1
);
int
i
;
for
(
i
=
0
;
i
<
bs
.
bits
.
length
;
++
i
)
bits
[
i
]
|=
bs
.
bits
[
i
];
}
public
void
set
(
int
pos
)
public
void
set
(
int
pos
)
{
if
(
pos
<
0
)
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
bit
=
pos
%
64
;
int
offset
=
pos
/
64
;
ensure
(
offset
);
ensure
(
offset
);
bits
[
offset
]
|=
1L
<<
bit
;
}
public
int
size
()
public
int
size
()
{
return
bits
.
length
*
64
;
}
public
String
toString
()
public
String
toString
()
{
StringBuffer
result
=
new
StringBuffer
(
"{"
);
StringBuffer
result
=
new
StringBuffer
(
"{"
);
boolean
first
=
true
;
for
(
int
i
=
0
;
i
<
bits
.
length
;
++
i
)
{
...
...
@@ -142,32 +142,32 @@ public final class BitSet implements Cloneable, Serializable
if
((
word
&
bit
)
!=
0
)
{
if
(!
first
)
result
.
append
(
", "
);
result
.
append
(
64
*
i
+
j
);
result
.
append
(
", "
);
result
.
append
(
64
*
i
+
j
);
first
=
false
;
}
bit
<<=
1
;
}
}
return
result
.
append
(
"}"
).
toString
();
return
result
.
append
(
"}"
).
toString
();
}
public
void
xor
(
BitSet
bs
)
public
void
xor
(
BitSet
bs
)
{
ensure
(
bs
.
bits
.
length
-
1
);
ensure
(
bs
.
bits
.
length
-
1
);
int
i
;
for
(
i
=
0
;
i
<
bs
.
bits
.
length
;
++
i
)
bits
[
i
]
^=
bs
.
bits
[
i
];
}
// Make sure the vector is big enough.
private
final
void
ensure
(
int
lastElt
)
private
final
void
ensure
(
int
lastElt
)
{
if
(
lastElt
+
1
>
bits
.
length
)
{
long
[]
nd
=
new
long
[
lastElt
+
1
];
System
.
arraycopy
(
bits
,
0
,
nd
,
0
,
bits
.
length
);
System
.
arraycopy
(
bits
,
0
,
nd
,
0
,
bits
.
length
);
bits
=
nd
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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