Skip to content

Commit

Permalink
chore: fix some comments (#2798)
Browse files Browse the repository at this point in the history
Signed-off-by: shandongbinzhou <shandongbinzhou@outlook.com>
Co-authored-by: shandongbinzhou <shandongbinzhou@outlook.com>
  • Loading branch information
Sun Bin and shandongbinzhou authored Apr 1, 2024
1 parent 0c32f2e commit fb39a30
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions bindgen-tests/tests/expectations/tests/enum-doc-bitfield.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bindgen-tests/tests/expectations/tests/enum-doc-mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bindgen-tests/tests/expectations/tests/enum-doc-rusty.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bindgen-tests/tests/expectations/tests/enum-doc.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bindgen-tests/tests/headers/enum-doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
enum B {
/// Document field with three slashes
VAR_A = 0,
/** Document field with preceeding star */
/** Document field with preceding star */
VAR_B = 1,
/*! Document field with preceeding exclamation */
/*! Document field with preceding exclamation */
VAR_C = 2,
VAR_D = 3, /**< Document field with following star */
VAR_E = 4, /*!< Document field with following exclamation */
/**
* Document field with preceeding star, with a loong long multiline
* Document field with preceding star, with a loong long multiline
* comment.
*
* Very interesting documentation, definitely.
Expand Down
4 changes: 2 additions & 2 deletions bindgen-tests/tests/headers/issue-537-repr-packed-n.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct AlignedToOne {
int i;
} __attribute__ ((packed,aligned(1)));

/// This should be be packed because Rust 1.33 has `#[repr(packed(N))]`.
/// This should be packed because Rust 1.33 has `#[repr(packed(N))]`.
struct AlignedToTwo {
int i;
} __attribute__ ((packed,aligned(2)));
Expand All @@ -25,7 +25,7 @@ struct PackedToOne {

#pragma pack(2)

/// This should be be packed because Rust 1.33 has `#[repr(packed(N))]`.
/// This should be packed because Rust 1.33 has `#[repr(packed(N))]`.
struct PackedToTwo {
int x;
int y;
Expand Down
2 changes: 1 addition & 1 deletion bindgen-tests/tests/headers/template-param-usage-7.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ class DoesNotUseU {
V v;
};

// The bool should go away becuase U is not used.
// The bool should go away because U is not used.
using Alias = DoesNotUseU<int, bool, char>;
2 changes: 1 addition & 1 deletion bindgen-tests/tests/headers/wrap-static-fns.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// bindgen-flags: --experimental --wrap-static-fns
// bindgen-parse-callbacks: wrap-as-variadic-fn

// to avoid poluting theexpectation tests we put the stdarg.h behind a conditional
// to avoid polluting the expectation tests we put the stdarg.h behind a conditional
// variable only used in bindgen-integration
#ifdef USE_VA_HEADER
#include <stdarg.h>
Expand Down
2 changes: 1 addition & 1 deletion bindgen/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2557,7 +2557,7 @@ impl CodeGenerator for CompInfo {
};
// Note we use `ptr::write_bytes()` instead of `mem::zeroed()` because the latter does
// not necessarily ensure padding bytes are zeroed. Some C libraries are sensitive to
// non-zero padding bytes, especially when forwards/backwards compatability is
// non-zero padding bytes, especially when forwards/backwards compatibility is
// involved.
result.push(quote! {
impl #generics Default for #ty_for_impl {
Expand Down
2 changes: 1 addition & 1 deletion bindgen/ir/analysis/has_type_param_in_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{HashMap, HashSet};
/// * If T is a type alias, a templated alias or an indirection to another type,
/// it has type parameter in array if the type T refers to has.
/// * If T is a compound type, it has array if any of base memter or field
/// has type paramter in array.
/// has type parameter in array.
/// * If T is an instantiation of an abstract template definition, T has
/// type parameter in array if any of the template arguments or template definition
/// has.
Expand Down
2 changes: 1 addition & 1 deletion bindgen/options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ options! {
},
as_args: "--wrap-unsafe-ops",
},
/// Patterns for functions whose ABI should be overriden.
/// Patterns for functions whose ABI should be overridden.
abi_overrides: HashMap<Abi, RegexSet> {
methods: {
regex_option! {
Expand Down
2 changes: 1 addition & 1 deletion book/src/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@ instance.assume_init_mut().method();
```

You can easily verify this fact if you provide a implementation for `MyClass`
and `method` that prints the the `this` pointer address. However, you can
and `method` that prints the `this` pointer address. However, you can
ignore this fact if you know that the original C++ code does not rely on the
instance address in its internal logic.
4 changes: 2 additions & 2 deletions book/src/using-unions.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ When using the `union` builtin type, there are two choices for initialization:
mod bindings_builtin_union;
fn union_builtin() {
// Initalize the union to zero
// Initialize the union to zero
let x = bindings_builtin_union::greek_t::default();
// If `--with-derive-default` option is not used, the following may be used
// to initalize the union to zero:
// to initialize the union to zero:
let x = unsafe { std::mem::zeroed::<bindings_builtin_union::greek_t>() };
// Or, it is possible to initialize exactly one variant of the enum:
Expand Down

0 comments on commit fb39a30

Please sign in to comment.