1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 04:57:45 +00:00

Merge pull request #471 from ebfe/fix-build-master

Fix build with rust master
This commit is contained in:
Alex Lyon 2014-12-10 22:52:52 -08:00
commit d3708f65c0
9 changed files with 24 additions and 2 deletions

View file

@ -96,7 +96,7 @@ pub fn uumain(args: Vec<String>) -> int {
} }
fn decode(input: &mut Reader, ignore_garbage: bool) { fn decode(input: &mut Reader, ignore_garbage: bool) {
let mut to_decode = match input.read_to_string() { let to_decode = match input.read_to_string() {
Ok(m) => m, Ok(m) => m,
Err(f) => panic!(f) Err(f) => panic!(f)
}; };

View file

@ -47,6 +47,8 @@ pub struct c_passwd {
pub pw_shell: *const c_char, pub pw_shell: *const c_char,
} }
impl Copy for c_passwd {}
#[cfg(any(target_os = "macos", target_os = "freebsd"))] #[cfg(any(target_os = "macos", target_os = "freebsd"))]
#[repr(C)] #[repr(C)]
pub struct utsname { pub struct utsname {
@ -68,6 +70,8 @@ pub struct utsname {
pub domainame: [c_char, ..65] pub domainame: [c_char, ..65]
} }
impl Copy for utsname {}
#[repr(C)] #[repr(C)]
pub struct c_group { pub struct c_group {
pub gr_name: *const c_char, // group name pub gr_name: *const c_char, // group name
@ -76,6 +80,8 @@ pub struct c_group {
pub gr_mem: *const *const c_char, // member list pub gr_mem: *const *const c_char, // member list
} }
impl Copy for c_group {}
#[repr(C)] #[repr(C)]
pub struct c_tm { pub struct c_tm {
pub tm_sec: c_int, /* seconds */ pub tm_sec: c_int, /* seconds */
@ -89,6 +95,8 @@ pub struct c_tm {
pub tm_isdst: c_int /* daylight saving time */ pub tm_isdst: c_int /* daylight saving time */
} }
impl Copy for c_tm {}
extern { extern {
pub fn getpwuid(uid: uid_t) -> *const c_passwd; pub fn getpwuid(uid: uid_t) -> *const c_passwd;
pub fn getpwnam(login: *const c_char) -> *const c_passwd; pub fn getpwnam(login: *const c_char) -> *const c_passwd;

View file

@ -31,6 +31,8 @@ pub enum Mode {
Version, Version,
} }
impl Copy for Mode {}
pub fn uumain(args: Vec<String>) -> int { pub fn uumain(args: Vec<String>) -> int {
let opts = [ let opts = [
optflag("h", "help", "display this help and exit"), optflag("h", "help", "display this help and exit"),

View file

@ -322,7 +322,7 @@ fn build_best_path<'a>(paths: &Vec<LineBreak<'a>>, active: &Vec<uint>) -> Vec<(&
// now, chase the pointers back through the break list, recording // now, chase the pointers back through the break list, recording
// the words at which we should break // the words at which we should break
loop { loop {
let next_best = paths[best_idx]; let ref next_best = paths[best_idx];
match next_best.linebreak { match next_best.linebreak {
None => return breakwords, None => return breakwords,
Some(prev) => { Some(prev) => {

View file

@ -42,6 +42,8 @@ pub enum Mode {
Version, Version,
} }
impl Copy for Mode {}
//currently rust libc interface doesn't include gethostid //currently rust libc interface doesn't include gethostid
extern { extern {
pub fn gethostid() -> c_long; pub fn gethostid() -> c_long;

View file

@ -52,6 +52,8 @@ pub enum Mode {
Version, Version,
} }
impl Copy for Mode {}
pub fn uumain(args: Vec<String>) -> int { pub fn uumain(args: Vec<String>) -> int {
let opts = [ let opts = [
optflag("h", "help", "display this help and exit"), optflag("h", "help", "display this help and exit"),

View file

@ -49,6 +49,8 @@ pub enum OverwriteMode {
Force, Force,
} }
impl Copy for OverwriteMode {}
#[deriving(Eq, PartialEq)] #[deriving(Eq, PartialEq)]
pub enum BackupMode { pub enum BackupMode {
NoBackup, NoBackup,
@ -57,6 +59,8 @@ pub enum BackupMode {
ExistingBackup, ExistingBackup,
} }
impl Copy for BackupMode {}
pub fn uumain(args: Vec<String>) -> int { pub fn uumain(args: Vec<String>) -> int {
let program = args[0].as_slice(); let program = args[0].as_slice();
let opts = [ let opts = [

View file

@ -27,6 +27,8 @@ enum InteractiveMode {
InteractiveAlways InteractiveAlways
} }
impl Copy for InteractiveMode {}
static NAME: &'static str = "rm"; static NAME: &'static str = "rm";
pub fn uumain(args: Vec<String>) -> int { pub fn uumain(args: Vec<String>) -> int {

View file

@ -199,6 +199,8 @@ enum Precedence {
UnOp UnOp
} }
impl Copy for Precedence {}
fn parse_expr(mut args: &[&[u8]], error: &mut bool) -> bool { fn parse_expr(mut args: &[&[u8]], error: &mut bool) -> bool {
if args.len() == 0 { if args.len() == 0 {
false false