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

已合併
SlavekB 將 1 次提交從 feat/fix-if-else-cond 合併至 master 5 年前
obache 已留言 5 年前
協作者

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

OSS MIDI API may be missing even if ALSA is enabled.
SlavekB 已審核 5 年前
SlavekB 留下了回應
擁有者

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
擁有者

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 ```
擁有者

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 ```
擁有者

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 年前
發布者
協作者

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 年前
發布者
協作者

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?
擁有者

Please give attention to my review – see comment above.

Please give attention to my review – see comment above.
obache 已留言 5 年前
發布者
協作者

Changed to coding style same as others.

Changed to coding style same as others.
SlavekB 關閉了這個合併請求 5 年前
SlavekB 刪除分支 feat/fix-if-else-cond 5 年前
SlavekB 新增到 R14.0.6 release 里程碑 5 年前
此合併請求已被合併為 dd6da7345a
登入 才能加入這對話。
沒有審核者
未選擇里程碑
沒有負責人
3 參與者
通知
截止日期

未設定截止日期。

先決條件

未設定先決條件。

參考: TDE/tdelibs#22
載入中…
尚未有任何內容