Skip to content
Snippets Groups Projects
Verified Commit 17778ba1 authored by jD91mZM2's avatar jD91mZM2
Browse files

Remove missing rustfmt.toml options

parent 9c016734
No related branches found
No related tags found
No related merge requests found
......@@ -419,6 +419,7 @@ dependencies = [
"platform 0.1.0",
"ralloc 1.0.0",
"rand 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"string 0.1.0",
"time 0.1.0",
"wchar 0.1.0",
]
......
#!/bin/bash
#!/usr/bin/env bash
ARGS=()
for crate in relibc $(find src -name Cargo.toml | cut -d '/' -f2 | grep -v template)
......
......@@ -9,19 +9,13 @@ fn_single_line = false
where_single_line = false
imports_indent = "Visual"
imports_layout = "Mixed"
reorder_extern_crates = true
reorder_extern_crates_in_group = true
reorder_imports = false
reorder_imported_names = true
spaces_within_parens_and_brackets = false
remove_blank_lines_at_start_or_end_of_block = true
fn_args_density = "Tall"
brace_style = "SameLineWhere"
trailing_comma = "Vertical"
blank_lines_upper_bound = 1
blank_lines_lower_bound = 0
force_explicit_abi = true
write_mode = "Overwrite"
disable_all_formatting = false
skip_children = false
hide_parse_errors = false
......
......@@ -27,7 +27,7 @@ const MB_LEN_MAX: c_int = 4;
#[repr(C)]
#[derive(Clone, Copy)]
pub struct mbstate_t {}
pub struct mbstate_t;
#[no_mangle]
pub unsafe extern "C" fn btowc(c: c_int) -> wint_t {
......@@ -38,7 +38,7 @@ pub unsafe extern "C" fn btowc(c: c_int) -> wint_t {
let uc = c as u8;
let c = uc as c_char;
let mut ps: mbstate_t = mbstate_t {};
let mut ps: mbstate_t = mbstate_t;
let mut wc: wchar_t = 0;
let saved_errno = platform::errno;
let status = mbrtowc(&mut wc, &c as (*const c_char), 1, &mut ps);
......@@ -52,7 +52,7 @@ pub unsafe extern "C" fn btowc(c: c_int) -> wint_t {
#[no_mangle]
pub unsafe extern "C" fn fputwc(wc: wchar_t, stream: *mut FILE) -> wint_t {
//Convert wchar_t to multibytes first
static mut INTERNAL: mbstate_t = mbstate_t {};
static mut INTERNAL: mbstate_t = mbstate_t;
let mut bytes: [c_char; MB_CUR_MAX as usize] = [0; MB_CUR_MAX as usize];
let amount = wcrtomb(bytes.as_mut_ptr(), wc, &mut INTERNAL);
......@@ -96,7 +96,7 @@ pub unsafe extern "C" fn mbsinit(ps: *const mbstate_t) -> c_int {
#[no_mangle]
pub unsafe extern "C" fn mbrlen(s: *const c_char, n: usize, ps: *mut mbstate_t) -> usize {
static mut INTERNAL: mbstate_t = mbstate_t {};
static mut INTERNAL: mbstate_t = mbstate_t;
mbrtowc(ptr::null_mut(), s, n, &mut INTERNAL)
}
......@@ -108,7 +108,7 @@ pub unsafe extern "C" fn mbrtowc(
n: usize,
ps: *mut mbstate_t,
) -> usize {
static mut INTERNAL: mbstate_t = mbstate_t {};
static mut INTERNAL: mbstate_t = mbstate_t;
if ps.is_null() {
let ps = &mut INTERNAL;
......@@ -131,7 +131,7 @@ pub unsafe extern "C" fn mbsnrtowcs(
dst_len: usize,
ps: *mut mbstate_t,
) -> usize {
static mut INTERNAL: mbstate_t = mbstate_t {};
static mut INTERNAL: mbstate_t = mbstate_t;
if ps.is_null() {
let ps = &mut INTERNAL;
......
//UTF implementation parts for wchar.h.
//Partially ported from the Sortix libc
#![no_std]
extern crate errno;
extern crate platform;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment