Skip to content

Commit

Permalink
Make use of the crate's prelude
Browse files Browse the repository at this point in the history
This step was performed automatically with the following:

```sh
#!/bin/bash

set -eux

files=()
prelude_types=(
    c_char
    c_int
    c_longlong
    c_long
    c_short
    c_uchar
    c_uint
    c_ulonglong
    c_ulong
    c_ushort
    c_void
    intptr_t
    size_t
    ssize_t
    Clone
    Copy
    Option
)

# Generate a list of all files excluding `lib.rs` (since the prelude being
# defined there makes string matching weird).
while IFS= read -r -d '' file; do
    files+=("$file")
done < <(find src -name '*.rs' -not -name 'lib.rs' -print0)

for file in "${files[@]}"; do
    for ty in "${prelude_types[@]}"; do
        # If the type isn't imported or used by path, skip it
        if ! rg -qU "(crate::$ty|use crate::(\{\n)?.*$ty)" $file; then
            continue
        fi

        # Check if the prelude already exists and if not, add it
        if ! rg -q "use crate::prelude::\*" $file; then
            perl -pi -0777 -e 's/(use crate::)/use crate::prelude::*;\n$1/' "$file"
        fi

        # Remove simple imports `use crate::ty;`
        TY="$ty" perl -pi -0777 -e 's/use crate::($ENV{TY});//g' "$file"

        # Replace pathed `crate::ty`
        TY="$ty" perl -pi -0777 -e 's/crate::($ENV{TY})\b/$1/g' "$file"

        # Remove the type if it is part of a group import
        TY="$ty" perl -pi -0777 -e 's/(use crate::\{?(.*|(\n.*){1,2}))\b$ENV{TY}\b,? ?/$1/g' "$file"
    done

    rustfmt $file
done
```

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Wed Nov 27 13:11:46 2024 -0500
#
# On branch crate-prelude
# Changes to be committed:
#	modified:   src/fuchsia/aarch64.rs
#	modified:   src/fuchsia/mod.rs
#	modified:   src/fuchsia/riscv64.rs
#	modified:   src/fuchsia/x86_64.rs
#	modified:   src/hermit.rs
#	modified:   src/solid/mod.rs
#	modified:   src/unix/aix/mod.rs
#	modified:   src/unix/aix/powerpc64.rs
#	modified:   src/unix/bsd/apple/b32/mod.rs
#	modified:   src/unix/bsd/apple/b64/aarch64/mod.rs
#	modified:   src/unix/bsd/apple/b64/mod.rs
#	modified:   src/unix/bsd/apple/b64/x86_64/mod.rs
#	modified:   src/unix/bsd/apple/mod.rs
#	modified:   src/unix/bsd/freebsdlike/dragonfly/mod.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/aarch64.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/arm.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/mod.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/powerpc.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/riscv64.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/x86.rs
#	modified:   src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
#	modified:   src/unix/bsd/freebsdlike/mod.rs
#	modified:   src/unix/bsd/mod.rs
#	modified:   src/unix/bsd/netbsdlike/mod.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/aarch64.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/arm.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/mips.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/mod.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/powerpc.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/riscv64.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/sparc64.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/x86.rs
#	modified:   src/unix/bsd/netbsdlike/netbsd/x86_64.rs
#	modified:   src/unix/bsd/netbsdlike/openbsd/aarch64.rs
#	modified:   src/unix/bsd/netbsdlike/openbsd/mod.rs
#	modified:   src/unix/bsd/netbsdlike/openbsd/riscv64.rs
#	modified:   src/unix/bsd/netbsdlike/openbsd/x86.rs
#	modified:   src/unix/bsd/netbsdlike/openbsd/x86_64.rs
#	modified:   src/unix/haiku/mod.rs
#	modified:   src/unix/haiku/native.rs
#	modified:   src/unix/haiku/x86_64.rs
#	modified:   src/unix/hurd/b32.rs
#	modified:   src/unix/hurd/b64.rs
#	modified:   src/unix/hurd/mod.rs
#	modified:   src/unix/linux_like/android/b32/arm.rs
#	modified:   src/unix/linux_like/android/b32/mod.rs
#	modified:   src/unix/linux_like/android/b32/x86/mod.rs
#	modified:   src/unix/linux_like/android/b64/aarch64/mod.rs
#	modified:   src/unix/linux_like/android/b64/mod.rs
#	modified:   src/unix/linux_like/android/b64/riscv64/mod.rs
#	modified:   src/unix/linux_like/android/b64/x86_64/mod.rs
#	modified:   src/unix/linux_like/android/mod.rs
#	modified:   src/unix/linux_like/emscripten/lfs64.rs
#	modified:   src/unix/linux_like/emscripten/mod.rs
#	modified:   src/unix/linux_like/linux/arch/generic/mod.rs
#	modified:   src/unix/linux_like/linux/arch/mips/mod.rs
#	modified:   src/unix/linux_like/linux/arch/powerpc/mod.rs
#	modified:   src/unix/linux_like/linux/arch/sparc/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/arm/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/csky/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/mips/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/powerpc.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b32/x86/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/s390x.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs
#	modified:   src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs
#	modified:   src/unix/linux_like/linux/gnu/mod.rs
#	modified:   src/unix/linux_like/linux/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b32/arm/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b32/hexagon.rs
#	modified:   src/unix/linux_like/linux/musl/b32/mips/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b32/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b32/powerpc.rs
#	modified:   src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b32/x86/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b64/mips64.rs
#	modified:   src/unix/linux_like/linux/musl/b64/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b64/powerpc64.rs
#	modified:   src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
#	modified:   src/unix/linux_like/linux/musl/b64/s390x.rs
#	modified:   src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
#	modified:   src/unix/linux_like/linux/musl/lfs64.rs
#	modified:   src/unix/linux_like/linux/musl/mod.rs
#	modified:   src/unix/linux_like/linux/uclibc/arm/mod.rs
#	modified:   src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs
#	modified:   src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs
#	modified:   src/unix/linux_like/linux/uclibc/mips/mod.rs
#	modified:   src/unix/linux_like/linux/uclibc/mod.rs
#	modified:   src/unix/linux_like/linux/uclibc/x86_64/l4re.rs
#	modified:   src/unix/linux_like/linux/uclibc/x86_64/mod.rs
#	modified:   src/unix/linux_like/linux/uclibc/x86_64/other.rs
#	modified:   src/unix/linux_like/mod.rs
#	modified:   src/unix/mod.rs
#	modified:   src/unix/newlib/aarch64/mod.rs
#	modified:   src/unix/newlib/arm/mod.rs
#	modified:   src/unix/newlib/espidf/mod.rs
#	modified:   src/unix/newlib/generic.rs
#	modified:   src/unix/newlib/horizon/mod.rs
#	modified:   src/unix/newlib/mod.rs
#	modified:   src/unix/newlib/powerpc/mod.rs
#	modified:   src/unix/newlib/rtems/mod.rs
#	modified:   src/unix/newlib/vita/mod.rs
#	modified:   src/unix/nto/aarch64.rs
#	modified:   src/unix/nto/mod.rs
#	modified:   src/unix/nto/neutrino.rs
#	modified:   src/unix/nto/x86_64.rs
#	modified:   src/unix/nuttx/mod.rs
#	modified:   src/unix/redox/mod.rs
#	modified:   src/unix/solarish/compat.rs
#	modified:   src/unix/solarish/illumos.rs
#	modified:   src/unix/solarish/mod.rs
#	modified:   src/unix/solarish/solaris.rs
#	modified:   src/unix/solarish/x86.rs
#	modified:   src/unix/solarish/x86_64.rs
#	modified:   src/vxworks/mod.rs
#	modified:   src/wasi/mod.rs
#	modified:   src/wasi/p2.rs
#	modified:   src/windows/gnu/mod.rs
#	modified:   src/windows/mod.rs
#	modified:   src/windows/msvc/mod.rs
#
  • Loading branch information
tgross35 committed Nov 27, 2024
1 parent fa5e22a commit 9fc7bb2
Show file tree
Hide file tree
Showing 146 changed files with 256 additions and 244 deletions.
3 changes: 2 additions & 1 deletion src/fuchsia/aarch64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, c_long, c_uint, c_ulong, c_ulonglong, c_ushort, off_t, size_t};
use crate::off_t;
use crate::prelude::*;

pub type c_char = u8;
pub type __u64 = c_ulonglong;
Expand Down
2 changes: 1 addition & 1 deletion src/fuchsia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! More functions and definitions can be found in the more specific modules
//! according to the platform in question.
use crate::c_void;
use crate::prelude::*;

// PUB_TYPE

Expand Down
3 changes: 2 additions & 1 deletion src/fuchsia/riscv64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, c_long, c_ulong, c_ulonglong, c_ushort, off_t};
use crate::off_t;
use crate::prelude::*;

// From psABI Calling Convention for RV64
pub type c_char = u8;
Expand Down
3 changes: 2 additions & 1 deletion src/fuchsia/x86_64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, c_long, c_ulong, c_ulonglong, off_t, size_t};
use crate::off_t;
use crate::prelude::*;

pub type c_char = i8;
pub type wchar_t = i32;
Expand Down
2 changes: 1 addition & 1 deletion src/hermit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Hermit C type definitions
use crate::c_void;
use crate::prelude::*;

cfg_if! {
if #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] {
Expand Down
2 changes: 1 addition & 1 deletion src/solid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! [SOLID]: https://solid.kmckk.com/
use crate::c_void;
use crate::prelude::*;

pub type c_schar = i8;
pub type c_uchar = u8;
Expand Down
6 changes: 2 additions & 4 deletions src/unix/aix/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
c_double, c_int, c_longlong, c_short, c_uchar, c_uint, c_ulonglong, c_ushort, c_void, intptr_t,
size_t, ssize_t,
};
use crate::prelude::*;
use crate::{c_double, size_t, ssize_t};

pub type c_char = u8;
pub type caddr_t = *mut c_char;
Expand Down
6 changes: 2 additions & 4 deletions src/unix/aix/powerpc64.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
c_char, c_int, c_longlong, c_short, c_uint, c_ulonglong, c_ushort, c_void, off_t, size_t,
ssize_t,
};
use crate::prelude::*;
use crate::{off_t, ssize_t};

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/apple/b32/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! 32-bit specific Apple (ios/darwin) definitions
use crate::{c_char, c_int, c_uchar, c_ushort};
use crate::prelude::*;

pub type c_long = i32;
pub type c_ulong = u32;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/apple/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_int;
use crate::prelude::*;

pub type boolean_t = c_int;
pub type mcontext_t = *mut __darwin_mcontext64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/apple/b64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! 64-bit specific Apple (ios/darwin) definitions
use crate::{c_char, c_int, c_uchar, c_uint, c_ushort};
use crate::prelude::*;

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/apple/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_char, c_int, c_short, c_uint, c_void, size_t};
use crate::prelude::*;

pub type boolean_t = c_uint;
pub type mcontext_t = *mut __darwin_mcontext64;
Expand Down
6 changes: 2 additions & 4 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
//!
//! This covers *-apple-* triples currently

use crate::{
c_int, c_longlong, c_short, c_uchar, c_uint, c_ulonglong, c_ushort, c_void, cmsghdr, intptr_t,
off_t, size_t, ssize_t,
};
use crate::prelude::*;
use crate::{cmsghdr, off_t, size_t, ssize_t};

pub type c_char = i8;
pub type wchar_t = i32;
Expand Down
5 changes: 2 additions & 3 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{
c_int, c_short, c_uchar, c_uint, c_ushort, c_void, cmsghdr, intptr_t, off_t, size_t, ssize_t,
};
use crate::prelude::*;
use crate::{cmsghdr, off_t};

pub type dev_t = u32;
pub type c_char = i8;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/aarch64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_int, c_longlong, size_t};
use crate::prelude::*;

pub type c_char = u8;
pub type c_long = i64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/arm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_int, c_uint, c_void, size_t};
use crate::prelude::*;

pub type c_char = u8;
pub type c_long = i32;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_long, off_t};
use crate::off_t;
use crate::prelude::*;

#[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_long, off_t};
use crate::off_t;
use crate::prelude::*;

#[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
Expand Down
4 changes: 1 addition & 3 deletions src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::{
c_char, c_int, c_long, c_short, c_uchar, c_uint, c_ushort, c_void, intptr_t, size_t, ssize_t,
};
use crate::prelude::*;

// APIs that were changed after FreeBSD 11

Expand Down
6 changes: 2 additions & 4 deletions src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
c_char, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, off_t, size_t,
ssize_t,
};
use crate::prelude::*;
use crate::{off_t, ssize_t};

// APIs in FreeBSD 12 that have changed since 11.

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_int;
use crate::prelude::*;

pub const PROC_KPTI_CTL: c_int = crate::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: c_int = 1;
Expand Down
6 changes: 2 additions & 4 deletions src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
c_char, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, off_t, size_t,
ssize_t,
};
use crate::prelude::*;
use crate::{off_t, ssize_t};

// APIs in FreeBSD 13 that have changed since 11.

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_int;
use crate::prelude::*;

pub const PROC_KPTI_CTL: c_int = crate::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: c_int = 1;
Expand Down
6 changes: 2 additions & 4 deletions src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
c_char, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, off_t, size_t,
ssize_t,
};
use crate::prelude::*;
use crate::{off_t, ssize_t};

// APIs in FreeBSD 14 that have changed since 11.

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_int;
use crate::prelude::*;

pub const PROC_KPTI_CTL: c_int = crate::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: c_int = 1;
Expand Down
6 changes: 2 additions & 4 deletions src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
c_char, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, off_t, size_t,
ssize_t,
};
use crate::prelude::*;
use crate::{off_t, ssize_t};

// APIs in FreeBSD 15 that have changed since 11.

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_int;
use crate::prelude::*;

pub const PROC_KPTI_CTL: c_int = crate::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: c_int = 1;
Expand Down
5 changes: 2 additions & 3 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{
c_int, c_longlong, c_short, c_uchar, c_uint, c_ushort, c_void, cmsghdr, off_t, size_t, ssize_t,
};
use crate::prelude::*;
use crate::{cmsghdr, off_t};

pub type fflags_t = u32;

Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/powerpc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_int, size_t};
use crate::prelude::*;

pub type c_char = u8;
pub type c_long = i32;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_int, size_t};
use crate::prelude::*;

pub type c_char = u8;
pub type c_long = i64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/riscv64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_int, c_longlong, size_t};
use crate::prelude::*;

pub type c_char = u8;
pub type c_long = i64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/x86.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_int, size_t};
use crate::prelude::*;

pub type c_char = i8;
pub type c_long = i32;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_int, c_void, size_t};
use crate::prelude::*;

pub type c_char = i8;
pub type c_long = i64;
Expand Down
6 changes: 2 additions & 4 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
c_double, c_int, c_short, c_uchar, c_uint, c_ulonglong, c_ushort, c_void, off_t, size_t,
ssize_t,
};
use crate::prelude::*;
use crate::{c_double, off_t, ssize_t};

pub type mode_t = u16;
pub type pthread_attr_t = *mut c_void;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_double, c_int, c_short, c_uint, c_ushort, c_void, size_t, ssize_t};
use crate::c_double;
use crate::prelude::*;

pub type off_t = i64;
pub type useconds_t = u32;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/netbsdlike/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, c_short, c_uint, c_ushort, c_void, off_t, size_t, ssize_t};
use crate::off_t;
use crate::prelude::*;

pub type wchar_t = i32;
pub type time_t = i64;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/aarch64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, c_uchar, c_uint, PT_FIRSTMACH};
use crate::prelude::*;
use crate::PT_FIRSTMACH;

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/arm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, c_longlong, PT_FIRSTMACH};
use crate::prelude::*;
use crate::PT_FIRSTMACH;

pub type c_long = i32;
pub type c_ulong = u32;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/mips.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, c_longlong, PT_FIRSTMACH};
use crate::prelude::*;
use crate::PT_FIRSTMACH;

pub type c_long = i32;
pub type c_ulong = u32;
Expand Down
6 changes: 2 additions & 4 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{
c_int, c_short, c_uchar, c_uint, c_ulonglong, c_ushort, c_void, cmsghdr, intptr_t, off_t,
size_t, ssize_t,
};
use crate::prelude::*;
use crate::{cmsghdr, off_t, size_t, ssize_t};

pub type clock_t = c_uint;
pub type suseconds_t = c_int;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/powerpc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_double, c_int, PT_FIRSTMACH};
use crate::prelude::*;
use crate::{c_double, PT_FIRSTMACH};

pub type c_long = i32;
pub type c_ulong = u32;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/riscv64.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use PT_FIRSTMACH;

use crate::{c_double, c_int};
use crate::c_double;
use crate::prelude::*;

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/netbsd/sparc64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_uchar;
use crate::prelude::*;

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/netbsd/x86.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{c_int, c_uchar};
use crate::prelude::*;

pub type c_long = i32;
pub type c_ulong = u32;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/x86_64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, c_uchar, c_uint, PT_FIRSTMACH};
use crate::prelude::*;
use crate::PT_FIRSTMACH;

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/openbsd/aarch64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_int;
use crate::prelude::*;

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
5 changes: 2 additions & 3 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::prelude::*;
use crate::unix::bsd::O_SYNC;
use crate::{
c_int, c_longlong, c_short, c_uchar, c_uint, c_ushort, c_void, cmsghdr, off_t, size_t,
};
use crate::{cmsghdr, off_t};

pub type clock_t = i64;
pub type suseconds_t = c_long;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/openbsd/riscv64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_int;
use crate::prelude::*;

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/openbsd/x86.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::c_int;
use crate::prelude::*;

pub type c_long = i32;
pub type c_ulong = u32;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/netbsdlike/openbsd/x86_64.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_int, PT_FIRSTMACH};
use crate::prelude::*;
use crate::PT_FIRSTMACH;

pub type c_long = i64;
pub type c_ulong = u64;
Expand Down
5 changes: 2 additions & 3 deletions src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{
c_double, c_int, c_short, c_uchar, c_uint, c_ushort, c_void, intptr_t, size_t, ssize_t,
};
use crate::c_double;
use crate::prelude::*;

pub type rlim_t = crate::uintptr_t;
pub type sa_family_t = u8;
Expand Down
3 changes: 2 additions & 1 deletion src/unix/haiku/native.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{c_char, c_double, c_int, c_uint, c_ulong, c_void, off_t, size_t, ssize_t};
use crate::prelude::*;
use crate::{c_double, off_t};

// This module contains bindings to the native Haiku API. The Haiku API
// originates from BeOS, and it was the original way to perform low level
Expand Down
Loading

0 comments on commit 9fc7bb2

Please sign in to comment.