Skip to content

Commit

Permalink
deps: Update to bitflags 2.x
Browse files Browse the repository at this point in the history
This also removes an old style macro_use / extern crate for
bitflags and makes all uses use the same syntax.
  • Loading branch information
waywardmonkeys committed Jun 17, 2024
1 parent 9e723ee commit 7baff6b
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions crates/parry2d-f64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ required-features = ["dim2", "f64"]
std = ["nalgebra/std", "slab", "rustc-hash", "simba/std", "arrayvec/std", "spade"]
dim2 = []
f64 = []
serde-serialize = ["serde", "nalgebra/serde-serialize", "arrayvec/serde"]
serde-serialize = ["serde", "nalgebra/serde-serialize", "arrayvec/serde", "bitflags/serde"]
rkyv-serialize = ["rkyv/validation", "nalgebra/rkyv-serialize", "simba/rkyv-serialize"]
bytemuck-serialize = ["bytemuck", "nalgebra/convert-bytemuck"]
simd-stable = ["simba/wide", "simd-is-enabled"]
Expand All @@ -41,7 +41,7 @@ required-features = ["required-features"]

[dependencies]
either = { version = "1", default-features = false }
bitflags = "1"
bitflags = "2"
downcast-rs = { version = "1", default-features = false }
num-traits = { version = "0.2", default-features = false }
smallvec = "1"
Expand Down
4 changes: 2 additions & 2 deletions crates/parry2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ required-features = ["dim2", "f32"]
std = ["nalgebra/std", "slab", "rustc-hash", "simba/std", "arrayvec/std", "spade"]
dim2 = []
f32 = []
serde-serialize = ["serde", "nalgebra/serde-serialize", "arrayvec/serde"]
serde-serialize = ["serde", "nalgebra/serde-serialize", "arrayvec/serde", "bitflags/serde"]
rkyv-serialize = ["rkyv/validation", "nalgebra/rkyv-serialize", "simba/rkyv-serialize"]
bytemuck-serialize = ["bytemuck", "nalgebra/convert-bytemuck"]
simd-stable = ["simba/wide", "simd-is-enabled"]
Expand All @@ -41,7 +41,7 @@ required-features = ["required-features"]

[dependencies]
either = { version = "1", default-features = false }
bitflags = "1"
bitflags = "2"
downcast-rs = { version = "1", default-features = false }
num-traits = { version = "0.2", default-features = false }
smallvec = "1"
Expand Down
4 changes: 2 additions & 2 deletions crates/parry3d-f64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ required-features = ["dim3", "f64"]
std = ["nalgebra/std", "slab", "rustc-hash", "simba/std", "arrayvec/std", "spade"]
dim3 = []
f64 = []
serde-serialize = ["serde", "nalgebra/serde-serialize"]
serde-serialize = ["serde", "nalgebra/serde-serialize", "bitflags/serde"]
rkyv-serialize = ["rkyv/validation", "nalgebra/rkyv-serialize", "simba/rkyv-serialize"]
bytemuck-serialize = ["bytemuck", "nalgebra/convert-bytemuck"]
simd-stable = ["simba/wide", "simd-is-enabled"]
Expand All @@ -41,7 +41,7 @@ required-features = ["required-features"]

[dependencies]
either = { version = "1", default-features = false }
bitflags = "1"
bitflags = "2"
downcast-rs = { version = "1", default-features = false }
num-traits = { version = "0.2", default-features = false }
smallvec = "1"
Expand Down
4 changes: 2 additions & 2 deletions crates/parry3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ required-features = ["dim3", "f32"]
std = ["nalgebra/std", "slab", "rustc-hash", "simba/std", "arrayvec/std", "spade"]
dim3 = []
f32 = []
serde-serialize = ["serde", "nalgebra/serde-serialize"]
serde-serialize = ["serde", "nalgebra/serde-serialize", "bitflags/serde"]
rkyv-serialize = ["rkyv/validation", "nalgebra/rkyv-serialize", "simba/rkyv-serialize"]
bytemuck-serialize = ["bytemuck", "nalgebra/convert-bytemuck"]

Expand All @@ -42,7 +42,7 @@ required-features = ["required-features"]

[dependencies]
either = { version = "1", default-features = false }
bitflags = "1"
bitflags = "2"
downcast-rs = { version = "1", default-features = false }
num-traits = { version = "0.2", default-features = false }
smallvec = "1"
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ extern crate core as std;
extern crate serde;
#[macro_use]
extern crate approx;
#[macro_use]
#[cfg(feature = "dim3")]
extern crate bitflags;
extern crate num_traits as num;

pub extern crate either;
Expand Down
5 changes: 2 additions & 3 deletions src/partitioning/qbvh/qbvh.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::bounding_volume::{Aabb, SimdAabb};
use crate::math::{Real, Vector};
use bitflags::bitflags;

use na::SimdValue;

Expand Down Expand Up @@ -80,14 +79,14 @@ impl NodeIndex {
}
}

bitflags! {
bitflags::bitflags! {
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[derive(Default)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
/// The status of a QBVH node.
pub struct QbvhNodeFlags: u8 {
/// If this bit is set, the node is a leaf.
Expand Down
8 changes: 4 additions & 4 deletions src/shape/heightfield3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use na::{Point3, Unit};
#[cfg(not(feature = "std"))]
use na::ComplexField;

bitflags! {
bitflags::bitflags! {
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self"),
)]
#[derive(Default)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
/// The status of the cell of an heightfield.
pub struct HeightFieldCellStatus: u8 {
/// If this bit is set, the concerned heightfield cell is subdivided using a Z pattern.
Expand All @@ -27,7 +27,7 @@ bitflags! {
/// If this bit is set, the rightmost triangle of the concerned heightfield cell is removed.
const RIGHT_TRIANGLE_REMOVED = 0b00000100;
/// If this bit is set, both triangles of the concerned heightfield cell are removed.
const CELL_REMOVED = Self::LEFT_TRIANGLE_REMOVED.bits | Self::RIGHT_TRIANGLE_REMOVED.bits;
const CELL_REMOVED = Self::LEFT_TRIANGLE_REMOVED.bits() | Self::RIGHT_TRIANGLE_REMOVED.bits();
}
}

Expand All @@ -39,7 +39,7 @@ bitflags::bitflags! {
archive(as = "Self"),
)]
#[repr(C)]
#[derive(Default)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
/// Flags controlling the behavior of some operations involving heightfields.
pub struct HeightFieldFlags: u8 {
/// If set, a special treatment will be applied to contact manifold calculation to eliminate
Expand Down
2 changes: 1 addition & 1 deletion src/shape/trimesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ bitflags::bitflags! {
archive(as = "Self"),
)]
#[repr(C)]
#[derive(Default)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
/// The status of the cell of an heightfield.
pub struct TriMeshFlags: u16 {
/// If set, the half-edge topology of the trimesh will be computed if possible.
Expand Down

0 comments on commit 7baff6b

Please sign in to comment.