mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: remove space in front of ? and ! (#14366)
This commit is contained in:
@@ -12,10 +12,10 @@ mut:
|
||||
fn main() {
|
||||
if os.args.len < 2 {
|
||||
eprintln('Usage: play_wav file1.wav file2.wav ...')
|
||||
play_sounds([os.resource_abs_path('uhoh.wav')]) ?
|
||||
play_sounds([os.resource_abs_path('uhoh.wav')])?
|
||||
exit(1)
|
||||
}
|
||||
play_sounds(os.args[1..]) ?
|
||||
play_sounds(os.args[1..])?
|
||||
}
|
||||
|
||||
fn play_sounds(files []string) ? {
|
||||
@@ -31,7 +31,7 @@ fn play_sounds(files []string) ? {
|
||||
eprintln('skipping "$f" (not a .wav file)')
|
||||
continue
|
||||
}
|
||||
player.play_wav_file(f) ?
|
||||
player.play_wav_file(f)?
|
||||
}
|
||||
player.stop()
|
||||
}
|
||||
@@ -67,7 +67,7 @@ fn (mut p Player) stop() {
|
||||
|
||||
fn (mut p Player) play_wav_file(fpath string) ? {
|
||||
println('> play_wav_file: $fpath')
|
||||
samples := read_wav_file_samples(fpath) ?
|
||||
samples := read_wav_file_samples(fpath)?
|
||||
p.finished = true
|
||||
p.samples << samples
|
||||
p.finished = false
|
||||
@@ -119,7 +119,7 @@ struct RIFFFormat {
|
||||
fn read_wav_file_samples(fpath string) ?[]f32 {
|
||||
mut res := []f32{}
|
||||
// eprintln('> read_wav_file_samples: $fpath -------------------------------------------------')
|
||||
mut bytes := os.read_bytes(fpath) ?
|
||||
mut bytes := os.read_bytes(fpath)?
|
||||
mut pbytes := &u8(bytes.data)
|
||||
mut offset := u32(0)
|
||||
rh := unsafe { &RIFFHeader(pbytes) }
|
||||
|
||||
Reference in New Issue
Block a user