Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add empty [workspace] to Cargo.toml. #236

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

mutexlox-signal
Copy link
Contributor

This works around rust-lang/cargo#6745 and allows cubeb-coreaudio-rs to appear as a subdirectory of a workspace member in another project (for instance, cubeb-rs).

This works around rust-lang/cargo#6745 and
allows cubeb-coreaudio-rs to appear as a subdirectory of a workspace
member in another project (for instance, cubeb-rs).
@mutexlox-signal
Copy link
Contributor Author

cc @padenot - any chance of taking a look at this? thanks!

@padenot
Copy link
Collaborator

padenot commented Oct 2, 2024

@kinetiknz knows this better, my knowledge of workspaces is almost non-existent.

@mutexlox-signal
Copy link
Contributor Author

mutexlox-signal commented Oct 8, 2024

Quick update: Adding the needed unsafe markings to the functions in audio_unit.rs and audio_device_extensions.rs causes an explosion in the number of issues; there are 49 calls to these functions without proper unsafe blocks. I do not know whether it makes sense for me to annotate all of these with safety documentation and unsafe blocks, as I'm not familiar with this project.

I think for now, the right way forward might be to file a bug for the missing markers and to exclude the failing project from clippy analysis, with a fix for the missing unsafe annotations at your convenience.

$ cargo clippy
warning: redundant closure
  --> coreaudio-sys-utils/src/dispatch.rs:35:43
   |
35 |     get_serial_queue_singleton().run_sync(|| work()).unwrap()
   |                                           ^^^^^^^^^ help: replace the closure with the function itself: `work`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
   = note: `#[warn(clippy::redundant_closure)]` on by default

warning: redundant closure
  --> coreaudio-sys-utils/src/dispatch.rs:42:47
   |
42 |     match run_serially(|| panic::catch_unwind(|| work())) {
   |                                               ^^^^^^^^^ help: replace the closure with the function itself: `work`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: casting raw pointers to the same type and constness is unnecessary (`*mut u8` -> `*mut u8`)
   --> coreaudio-sys-utils/src/string.rs:105:13
    |
105 |             ptr::null_mut() as *mut u8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr::null_mut()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    = note: `#[warn(clippy::unnecessary_cast)]` on by default

warning: `coreaudio-sys-utils` (lib) generated 3 warnings (run `cargo clippy --fix --lib -p coreaudio-sys-utils` to apply 2 suggestions)
    Checking cubeb-coreaudio v0.1.0 (/Users/miriam/cubeb-coreaudio-rs)
error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_parameter` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:289:13
    |
289 |       let r = audio_unit_set_parameter(
    |  _____________^
290 | |         unit,
291 | |         kHALOutputParam_Volume,
292 | |         kAudioUnitScope_Global,
...   |
295 | |         0,
296 | |     );
    | |_____^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_parameter` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:308:13
    |
308 |       let r = audio_unit_get_parameter(
    |  _____________^
309 | |         unit,
310 | |         kHALOutputParam_Volume,
311 | |         kAudioUnitScope_Global,
312 | |         0,
313 | |         &mut volume,
314 | |     );
    | |_____^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:327:13
    |
327 |       let r = audio_unit_get_property(
    |  _____________^
328 | |         unit,
329 | |         kAUVoiceIOProperty_MuteOutput,
330 | |         kAudioUnitScope_Global,
...   |
333 | |         &mut mem::size_of::<u32>(),
334 | |     );
    | |_____^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:345:13
    |
345 |       let r = audio_unit_set_property(
    |  _____________^
346 | |         unit,
347 | |         kAUVoiceIOProperty_MuteOutput,
348 | |         kAudioUnitScope_Global,
...   |
351 | |         mem::size_of::<u32>(),
352 | |     );
    | |_____^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:372:13
    |
372 |       let r = audio_unit_get_property(
    |  _____________^
373 | |         unit,
374 | |         kAUVoiceIOProperty_VoiceProcessingEnableAGC,
375 | |         kAudioUnitScope_Global,
...   |
378 | |         &mut mem::size_of::<u32>(),
379 | |     );
    | |_____^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:390:17
    |
390 |           let r = audio_unit_set_property(
    |  _________________^
391 | |             unit,
392 | |             kAUVoiceIOProperty_VoiceProcessingEnableAGC,
393 | |             kAudioUnitScope_Global,
...   |
396 | |             mem::size_of::<u32>(),
397 | |         );
    | |_________^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:413:13
    |
413 |       let r = audio_unit_get_property(
    |  _____________^
414 | |         unit,
415 | |         kAUVoiceIOProperty_BypassVoiceProcessing,
416 | |         kAudioUnitScope_Global,
...   |
419 | |         &mut mem::size_of::<u32>(),
420 | |     );
    | |_____^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:431:17
    |
431 |           let r = audio_unit_set_property(
    |  _________________^
432 | |             unit,
433 | |             kAUVoiceIOProperty_BypassVoiceProcessing,
434 | |             kAudioUnitScope_Global,
...   |
437 | |             mem::size_of::<u32>(),
438 | |         );
    | |_________^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_render` is unsafe and requires unsafe function or block
   --> src/backend/mod.rs:540:22
    |
540 |           let status = audio_unit_render(
    |  ______________________^
541 | |             stm.core_stream_data.input_unit,
542 | |             flags,
543 | |             tstamp,
...   |
546 | |             &mut input_buffer_list,
547 | |         );
    | |_________^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property_info` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1102:10
     |
1102 |       rv = audio_unit_get_property_info(
     |  __________^
1103 | |         output_unit,
1104 | |         kAudioDevicePropertyPreferredChannelLayout,
1105 | |         kAudioUnitScope_Output,
...    |
1108 | |         None,
1109 | |     );
     | |_____^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1120:10
     |
1120 |       rv = audio_unit_get_property(
     |  __________^
1121 | |         output_unit,
1122 | |         kAudioDevicePropertyPreferredChannelLayout,
1123 | |         kAudioUnitScope_Output,
...    |
1126 | |         &mut size,
1127 | |     );
     | |_____^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property_info` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1145:10
     |
1145 |       rv = audio_unit_get_property_info(
     |  __________^
1146 | |         output_unit,
1147 | |         kAudioUnitProperty_AudioChannelLayout,
1148 | |         kAudioUnitScope_Output,
...    |
1151 | |         None,
1152 | |     );
     | |_____^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1163:10
     |
1163 |       rv = audio_unit_get_property(
     |  __________^
1164 | |         output_unit,
1165 | |         kAudioUnitProperty_AudioChannelLayout,
1166 | |         kAudioUnitScope_Output,
...    |
1169 | |         &mut size,
1170 | |     );
     | |_____^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_output_unit_start` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1197:18
     |
1197 |     let status = audio_output_unit_start(unit);
     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_output_unit_stop` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1207:18
     |
1207 |     let status = audio_output_unit_stop(unit);
     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1232:13
     |
1232 |             dispose_audio_unit(unit);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1237:13
     |
1237 |             dispose_audio_unit(unit);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1247:13
     |
1247 |             dispose_audio_unit(unit);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1252:13
     |
1252 |             dispose_audio_unit(unit);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1264:9
     |
1264 |         dispose_audio_unit(unit);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1339:18
     |
1339 |       let status = audio_unit_set_property(
     |  __________________^
1340 | |         unit,
1341 | |         kAudioOutputUnitProperty_EnableIO,
1342 | |         scope,
...    |
1345 | |         mem::size_of::<u32>(),
1346 | |     );
     | |_____^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1361:18
     |
1361 |       let status = audio_unit_set_property(
     |  __________________^
1362 | |         unit,
1363 | |         kAudioOutputUnitProperty_CurrentDevice,
1364 | |         kAudioUnitScope_Global,
...    |
1367 | |         mem::size_of::<AudioDeviceID>(),
1368 | |     );
     | |_____^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_device_extensions::audio_device_duck` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1419:21
     |
1419 |             let r = audio_device_duck(id, 1.0, ptr::null_mut(), 0.5);
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1445:18
     |
1445 |       let status = audio_unit_get_property(
     |  __________________^
1446 | |         unit,
1447 | |         kAudioDevicePropertyBufferFrameSize,
1448 | |         scope,
...    |
1451 | |         &mut size,
1452 | |     );
     | |_____^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1474:18
     |
1474 |       let status = audio_unit_set_property(
     |  __________________^
1475 | |         unit,
1476 | |         kAudioDevicePropertyBufferFrameSize,
1477 | |         scope,
...    |
1480 | |         mem::size_of_val(&frames),
1481 | |     );
     | |_____^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_add_property_listener` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1516:9
     |
1516 | /         audio_unit_add_property_listener(
1517 | |             unit,
1518 | |             kAudioDevicePropertyBufferFrameSize,
1519 | |             buffer_size_changed_callback,
1520 | |             pair_ptr,
1521 | |         ),
     | |_________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_remove_property_listener_with_user_data` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:1527:13
     |
1527 | /             audio_unit_remove_property_listener_with_user_data(
1528 | |                 unit,
1529 | |                 kAudioDevicePropertyBufferFrameSize,
1530 | |                 buffer_size_changed_callback,
1531 | |                 pair_ptr,
1532 | |             ),
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:2384:9
     |
2384 |         dispose_audio_unit(self.unit);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3455:25
     |
3455 |                         dispose_audio_unit(au);
     |                         ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3463:25
     |
3463 |                         dispose_audio_unit(au);
     |                         ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3504:25
     |
3504 |                         dispose_audio_unit(self.input_unit);
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3583:21
     |
3583 |               let r = audio_unit_get_property(
     |  _____________________^
3584 | |                 self.input_unit,
3585 | |                 kAudioUnitProperty_StreamFormat,
3586 | |                 if using_voice_processing_unit {
...    |
3597 | |                 &mut size,
3598 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3665:21
     |
3665 |               let r = audio_unit_set_property(
     |  _____________________^
3666 | |                 self.input_unit,
3667 | |                 kAudioUnitProperty_StreamFormat,
3668 | |                 kAudioUnitScope_Output,
...    |
3671 | |                 mem::size_of::<AudioStreamBasicDescription>(),
3672 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3682:21
     |
3682 |               let r = audio_unit_set_property(
     |  _____________________^
3683 | |                 self.input_unit,
3684 | |                 kAudioUnitProperty_MaximumFramesPerSlice,
3685 | |                 kAudioUnitScope_Global,
...    |
3688 | |                 mem::size_of::<u32>(),
3689 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3719:21
     |
3719 |               let r = audio_unit_set_property(
     |  _____________________^
3720 | |                 self.input_unit,
3721 | |                 kAudioOutputUnitProperty_SetInputCallback,
3722 | |                 kAudioUnitScope_Global,
...    |
3725 | |                 mem::size_of_val(&aurcbs_in),
3726 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3746:21
     |
3746 |               let r = audio_unit_set_property(
     |  _____________________^
3747 | |                 self.input_unit,
3748 | |                 kAudioUnitProperty_StreamFormat,
3749 | |                 kAudioUnitScope_Input,
...    |
3752 | |                 mem::size_of::<AudioStreamBasicDescription>(),
3753 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3787:21
     |
3787 |               let r = audio_unit_get_property(
     |  _____________________^
3788 | |                 self.output_unit,
3789 | |                 kAudioUnitProperty_StreamFormat,
3790 | |                 if using_voice_processing_unit {
...    |
3802 | |                 &mut size,
3803 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3836:25
     |
3836 |                   let r = audio_unit_set_property(
     |  _________________________^
3837 | |                     self.output_unit,
3838 | |                     kAudioUnitProperty_AudioChannelLayout,
3839 | |                     kAudioUnitScope_Input,
...    |
3842 | |                     mem::size_of::<AudioChannelLayout>(),
3843 | |                 );
     | |_________________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3940:21
     |
3940 |               let r = audio_unit_set_property(
     |  _____________________^
3941 | |                 self.output_unit,
3942 | |                 kAudioUnitProperty_StreamFormat,
3943 | |                 kAudioUnitScope_Input,
...    |
3946 | |                 mem::size_of::<AudioStreamBasicDescription>(),
3947 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3966:21
     |
3966 |               let r = audio_unit_set_property(
     |  _____________________^
3967 | |                 self.output_unit,
3968 | |                 kAudioUnitProperty_MaximumFramesPerSlice,
3969 | |                 kAudioUnitScope_Global,
...    |
3972 | |                 mem::size_of::<u32>(),
3973 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_set_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:3986:21
     |
3986 |               let r = audio_unit_set_property(
     |  _____________________^
3987 | |                 self.output_unit,
3988 | |                 kAudioUnitProperty_SetRenderCallback,
3989 | |                 kAudioUnitScope_Global,
...    |
3992 | |                 mem::size_of_val(&aurcbs_out),
3993 | |             );
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_initialize` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:4078:21
     |
4078 |             let r = audio_unit_initialize(self.input_unit);
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_initialize` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:4092:25
     |
4092 |                 let r = audio_unit_initialize(self.output_unit);
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_get_property` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:4106:16
     |
4106 |               if audio_unit_get_property(
     |  ________________^
4107 | |                 self.output_unit,
4108 | |                 kAudioUnitProperty_Latency,
4109 | |                 kAudioUnitScope_Global,
...    |
4112 | |                 &mut size,
4113 | |             ) == NO_ERR
     | |_____________^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_device_extensions::audio_device_duck` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:4143:29
     |
4143 |                     let r = audio_device_duck(id, 1.0, ptr::null_mut(), 0.5);
     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_uninitialize` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:4209:13
     |
4209 |             audio_unit_uninitialize(self.input_unit);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::audio_unit_uninitialize` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:4220:13
     |
4220 |             audio_unit_uninitialize(self.output_unit);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:4221:13
     |
4221 |             dispose_audio_unit(self.output_unit);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

error[E0133]: call to unsafe function `backend::coreaudio_sys_utils::audio_unit::dispose_audio_unit` is unsafe and requires unsafe function or block
    --> src/backend/mod.rs:4228:17
     |
4228 |                 dispose_audio_unit(self.input_unit);
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: consult the function's documentation for information on how to avoid undefined behavior

For more information about this error, try `rustc --explain E0133`.
error: could not compile `cubeb-coreaudio` (lib) due to 49 previous errors

@mutexlox-signal
Copy link
Contributor Author

Filed #237

@mutexlox-signal
Copy link
Contributor Author

On second thought, I think the approach I took with that last commit is not quite right; it might also break anyone running cargo clippy manually or on projects that depend on this crate. Perhaps instead we should fix the 'easy' findings and silence the more involved ones.

@mutexlox-signal
Copy link
Contributor Author

@kinetiknz this is ready for a re-review now :)

( @padenot - if you could please trigger a presubmit run so I can fix any lingering errors I missed locally, I'd appreciate it)

@mutexlox-signal
Copy link
Contributor Author

The last two commits should fix the issues, so if you're still online I would appreciate another run of the CI, @padenot . thank you!

Due to rust-lang/rust-clippy#13531, this
incorrectly applies here on nightly builds of clippy -- it should not,
since this project is on edition 2015 by default.
@mutexlox-signal
Copy link
Contributor Author

reformatted

@kinetiknz
Copy link
Contributor

Thanks!

@kinetiknz kinetiknz merged commit f70ef45 into mozilla:trailblazer Oct 10, 2024
4 checks passed
mutexlox-signal added a commit to mutexlox-signal/cubeb that referenced this pull request Oct 11, 2024
padenot pushed a commit to mozilla/cubeb that referenced this pull request Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants