mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
warning cleanup
This commit is contained in:
@@ -474,7 +474,7 @@ impl BitArray {
|
||||
*/
|
||||
pub fn setRange(&mut self, start: usize, end: usize) -> Result<(), Exceptions> {
|
||||
let mut end = end;
|
||||
if end < start || start < 0 || end > self.size {
|
||||
if end < start || end > self.size {
|
||||
return Err(Exceptions::IllegalArgumentException(
|
||||
"end < start || start < 0 || end > self.size".to_owned(),
|
||||
));
|
||||
@@ -518,7 +518,7 @@ impl BitArray {
|
||||
*/
|
||||
pub fn isRange(&self, start: usize, end: usize, value: bool) -> Result<bool, Exceptions> {
|
||||
let mut end = end;
|
||||
if end < start || start < 0 || end > self.size {
|
||||
if end < start || end > self.size {
|
||||
return Err(Exceptions::IllegalArgumentException(
|
||||
"end < start || start < 0 || end > self.size".to_owned(),
|
||||
));
|
||||
@@ -1035,11 +1035,11 @@ impl BitMatrix {
|
||||
width: u32,
|
||||
height: u32,
|
||||
) -> Result<(), Exceptions> {
|
||||
if top < 0 || left < 0 {
|
||||
return Err(Exceptions::IllegalArgumentException(
|
||||
"Left and top must be nonnegative".to_owned(),
|
||||
));
|
||||
}
|
||||
// if top < 0 || left < 0 {
|
||||
// return Err(Exceptions::IllegalArgumentException(
|
||||
// "Left and top must be nonnegative".to_owned(),
|
||||
// ));
|
||||
// }
|
||||
if height < 1 || width < 1 {
|
||||
return Err(Exceptions::IllegalArgumentException(
|
||||
"Height and width must be at least 1".to_owned(),
|
||||
@@ -1133,7 +1133,7 @@ impl BitMatrix {
|
||||
pub fn rotate180(&mut self) {
|
||||
let mut topRow = BitArray::with_size(self.width as usize);
|
||||
let mut bottomRow = BitArray::with_size(self.width as usize);
|
||||
let mut maxHeight = (self.height + 1) / 2;
|
||||
let maxHeight = (self.height + 1) / 2;
|
||||
for i in 0..maxHeight {
|
||||
//for (int i = 0; i < maxHeight; i++) {
|
||||
topRow = self.getRow(i, &topRow);
|
||||
@@ -1150,9 +1150,9 @@ impl BitMatrix {
|
||||
* Modifies this {@code BitMatrix} to represent the same but rotated 90 degrees counterclockwise
|
||||
*/
|
||||
pub fn rotate90(&mut self) {
|
||||
let mut newWidth = self.height;
|
||||
let mut newHeight = self.width;
|
||||
let mut newRowSize = (newWidth + 31) / 32;
|
||||
let newWidth = self.height;
|
||||
let newHeight = self.width;
|
||||
let newRowSize = (newWidth + 31) / 32;
|
||||
let mut newBits = vec![0; (newRowSize * newHeight).try_into().unwrap()];
|
||||
|
||||
for y in 0..self.height {
|
||||
|
||||
Reference in New Issue
Block a user