Skip to content

Commit

Permalink
Merge pull request #464 from DenisBiryukov91/dev/1.0.0
Browse files Browse the repository at this point in the history
cargo fmt fix for PR #463
  • Loading branch information
milyin authored Jun 17, 2024
2 parents 755e448 + 91dcb79 commit 0e2b8f7
Showing 1 changed file with 40 additions and 10 deletions.
50 changes: 40 additions & 10 deletions src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,70 +359,100 @@ pub extern "C" fn z_bytes_serialize_from_double(this: *mut MaybeUninit<z_owned_b
/// Deserializes into an unsigned integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_uint8(this: &z_loaned_bytes_t, dst: &mut u8) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_uint8(
this: &z_loaned_bytes_t,
dst: &mut u8,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<u8>(this, dst)
}

/// Deserializes into an unsigned integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_uint16(this: &z_loaned_bytes_t, dst: &mut u16) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_uint16(
this: &z_loaned_bytes_t,
dst: &mut u16,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<u16>(this, dst)
}

/// Deserializes into an unsigned integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_uint32(this: &z_loaned_bytes_t, dst: &mut u32) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_uint32(
this: &z_loaned_bytes_t,
dst: &mut u32,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<u32>(this, dst)
}

/// Deserializes into an unsigned integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_uint64(this: &z_loaned_bytes_t, dst: &mut u64) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_uint64(
this: &z_loaned_bytes_t,
dst: &mut u64,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<u64>(this, dst)
}

/// Deserializes into a signed integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_int8(this: &z_loaned_bytes_t, dst: &mut i8) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_int8(
this: &z_loaned_bytes_t,
dst: &mut i8,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<i8>(this, dst)
}

/// Deserializes into a signed integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_int16(this: &z_loaned_bytes_t, dst: &mut i16) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_int16(
this: &z_loaned_bytes_t,
dst: &mut i16,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<i16>(this, dst)
}

/// Deserializes into a signed integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_int32(this: &z_loaned_bytes_t, dst: &mut i32) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_int32(
this: &z_loaned_bytes_t,
dst: &mut i32,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<i32>(this, dst)
}

/// Deserializes into a signed integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_int64(this: &z_loaned_bytes_t, dst: &mut i64) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_int64(
this: &z_loaned_bytes_t,
dst: &mut i64,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<i64>(this, dst)
}

/// Deserializes into a float.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_float(this: &z_loaned_bytes_t, dst: &mut f32) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_float(
this: &z_loaned_bytes_t,
dst: &mut f32,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<f32>(this, dst)
}

/// Deserializes into a signed integer.
/// @return 0 in case of success, negative error code otherwise.
#[no_mangle]
pub extern "C" fn z_bytes_deserialize_into_double(this: &z_loaned_bytes_t, dst: &mut f64) -> z_error_t {
pub extern "C" fn z_bytes_deserialize_into_double(
this: &z_loaned_bytes_t,
dst: &mut f64,
) -> z_error_t {
z_bytes_deserialize_into_arithmetic::<f64>(this, dst)
}

Expand Down

0 comments on commit 0e2b8f7

Please sign in to comment.