pipewire/spa/plugins/alsa
Konstantin Kharlamov ed9560fb03 alsa: fix "now.tv_sec maybe used uninitialized" warnings
Fixes a number of warnings that look like this:

    In file included from ../spa/include/spa/utils/result.h:37,
                     from ../spa/plugins/alsa/alsa-seq.c:35:
    In function ‘set_timers’,
        inlined from ‘do_reassign_follower’ at ../spa/plugins/alsa/alsa-seq.c:909:2:
    ../spa/include/spa/utils/defs.h:191:39: warning: ‘now.tv_sec’ may be used uninitialized [-Wmaybe-uninitialized]
      191 | #define SPA_TIMESPEC_TO_NSEC(ts) ((ts)->tv_sec * SPA_NSEC_PER_SEC + (ts)->tv_nsec)
          |                                   ~~~~^~~~~~~~
    ../spa/plugins/alsa/alsa-seq.c:840:28: note: in expansion of macro ‘SPA_TIMESPEC_TO_NSEC’
      840 |         state->next_time = SPA_TIMESPEC_TO_NSEC(&now);
          |                            ^~~~~~~~~~~~~~~~~~~~
    ../spa/plugins/alsa/alsa-seq.c: In function ‘do_reassign_follower’:
    ../spa/plugins/alsa/alsa-seq.c:836:25: note: ‘now’ declared here
      836 |         struct timespec now;
          |                         ^~~

The reason for these warnings is that spa_system_clock_gettime() may
fail if a version check fails, but the code in question didn't check for
the possible fail. If it failed, then execution would continue, and the
arguments that were passed to the macro will be used uninitialized.

Fix this by checking whether function succeeded.
2021-06-22 22:42:25 +03:00
..
acp alsa: strip and add the _alibpref from device names 2021-06-10 15:36:26 +02:00
mixer Expose output select for Soundblaster cards 2021-06-10 07:39:04 +00:00
90-pipewire-alsa.rules alsa: sync with pulseaudio 2021-05-31 13:03:52 +02:00
acp-tool.c treewide: replace !strcmp() with spa_streq() 2021-05-18 22:10:27 +10:00
alsa-acp-device.c acp: add hw-mute and hw-volume as properties 2021-06-09 09:41:49 +02:00
alsa-pcm-device.c treewide: replace strcmp() == 0 with spa_streq() 2021-05-18 22:10:27 +10:00
alsa-pcm-sink.c alsa,bluez5: handle SPA_PARAM_Latency in port_set_param 2021-06-05 17:52:40 +00:00
alsa-pcm-source.c alsa,bluez5: handle SPA_PARAM_Latency in port_set_param 2021-06-05 17:52:40 +00:00
alsa-pcm.c alsa: fix "now.tv_sec maybe used uninitialized" warnings 2021-06-22 22:42:25 +03:00
alsa-pcm.h alsa: refactory _io_position checking 2021-06-17 11:11:44 +02:00
alsa-seq-bridge.c alsa,bluez5: handle SPA_PARAM_Latency in port_set_param 2021-06-05 17:52:40 +00:00
alsa-seq.c alsa: fix "now.tv_sec maybe used uninitialized" warnings 2021-06-22 22:42:25 +03:00
alsa-seq.h alsa-seq: add port latency reporting 2021-05-27 15:26:09 +02:00
alsa-udev.c spa: save the old change_mask and restore when emitting full 2021-05-27 15:21:44 +02:00
alsa.c alsa-acp: Add libacp based card device 2020-07-06 12:20:09 +02:00
dll.h alsa: refactor dll code 2020-12-09 12:09:40 +01:00
meson.build alsa: depend on epoll-shim and libinotify on FreeBSD 2021-04-23 20:52:24 +03:00
test-timer.c spa: Fix a compiler warning caused by unchecked read() 2020-12-24 17:54:32 +02:00