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
SlavekB прокоментував(ла) 5 роки тому
Власник

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 роки тому
Власник

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 роки тому
Власник

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?
SlavekB прокоментував(ла) 5 роки тому
Власник

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 учасників
Сповіщення
Дата завершення

Термін виконання не встановлений.

Залежності

No dependencies set.

Reference: TDE/tdelibs#22
Завантаження…
Тут ще немає жодного змісту.