Fix if-else syntax for the case missing OSS support #22

Birleştirildi
SlavekB 5 yıl önce feat/fix-if-else-cond içindeki 1 işlemeyi master ile birleştirdi
obache 5 yıl önce yorum yaptı
Katkıcı

OSS MIDI API may be missing even if ALSA is enabled.

OSS MIDI API may be missing even if ALSA is enabled.
SlavekB 5 yıl önce incelendi
SlavekB bir yorum yaptı
Sahibi

Please consider simplifying the code as suggested in the comment.

Please consider simplifying the code as suggested in the comment.
#endif
#ifdef HAVE_OSS_SUPPORT
_seqbufptr=0;
#endif
SlavekB 5 yıl önce yorum yaptı
Sahibi

The combination of nested #ifdef and if-else in the code looks hard to read. I propose simplification as follows:

#ifdef HAVE_ALSA_SUPPORT
  if (alsa)
  {
    ((AlsaOut *)device[default_dev])->seqbuf_clean();
    return;
  }
#endif
#ifdef HAVE_OSS_SUPPORT
  {
    _seqbufptr=0;
   return;
  }
#endif
The combination of nested #ifdef and if-else in the code looks hard to read. I propose simplification as follows: ``` #ifdef HAVE_ALSA_SUPPORT if (alsa) { ((AlsaOut *)device[default_dev])->seqbuf_clean(); return; } #endif #ifdef HAVE_OSS_SUPPORT { _seqbufptr=0; return; } #endif ```
MicheleC 5 yıl önce yorum yaptı
Sahibi

a simpler version is:

#ifdef HAVE_ALSA_SUPPORT
  if (alsa)
  {
    ((AlsaOut *)device[default_dev])->seqbuf_clean();
    return;
  }
#endif
#ifdef HAVE_OSS_SUPPORT
  _seqbufptr=0;
#endif
a simpler version is: ``` #ifdef HAVE_ALSA_SUPPORT if (alsa) { ((AlsaOut *)device[default_dev])->seqbuf_clean(); return; } #endif #ifdef HAVE_OSS_SUPPORT _seqbufptr=0; #endif ```
SlavekB 5 yıl önce yorum yaptı
Sahibi

Yes, of course, this can make the code even simpler. I chose the closed block also for OSS to make it clear if there will be added support for some other sound systems – for example, for Solaris 😸

Yes, of course, this can make the code even simpler. I chose the closed block also for OSS to make it clear if there will be added support for some other sound systems – for example, for Solaris :smile_cat:
obache 5 yıl önce yorum yaptı
Poster
Katkıcı

For multiple sound systems support, is it intend to be runtime switching or build time?

For multiple sound systems support, is it intend to be runtime switching or build time?
obache 5 yıl önce yorum yaptı
Poster
Katkıcı

For multiple sound systems support, is it intend to be runtime switching or build time?

For multiple sound systems support, is it intend to be runtime switching or build time?
SlavekB 5 yıl önce yorum yaptı
Sahibi

Please give attention to my review – see comment above.

Please give attention to my review – see comment above.
obache 5 yıl önce yorum yaptı
Poster
Katkıcı

Changed to coding style same as others.

Changed to coding style same as others.
SlavekB 5 yıl önce değişiklik isteğini kapattı
SlavekB feat/fix-if-else-cond dalı silindi 5 yıl önce
SlavekB 5 yıl önce R14.0.6 release kilometre taşına ekledi
Değişiklik isteği dd6da7345a olarak birleştirildi.
Bu konuşmaya katılmak için oturum aç.
Değerlendirici yok
Kilometre Taşı Yok
Atanan Kişi Yok
3 Katılımcı
Bildirimler
Bitiş Tarihi

Bitiş tarihi atanmadı.

Bağımlılıklar

Bağımlılık yok.

Referans: TDE/tdelibs#22
Yükleniyor…
Henüz bir içerik yok.