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

Sapludināts
SlavekB sapludināja 1 revīzijas no feat/fix-if-else-cond uz master pirms 5 gadiem
Līdzstrādnieks

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

OSS MIDI API may be missing even if ALSA is enabled.
SlavekB recenzēja pirms 5 gadiem
SlavekB atstāja komentāru
Īpašnieks

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
Īpašnieks

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 ```
Īpašnieks

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 ```
Īpašnieks

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:
Autors
Līdzstrādnieks

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?
Autors
Līdzstrādnieks

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?
Īpašnieks

Please give attention to my review – see comment above.

Please give attention to my review – see comment above.
Autors
Līdzstrādnieks

Changed to coding style same as others.

Changed to coding style same as others.
SlavekB aizvēra šo izmaiņu pieprasījumu pirms 5 gadiem
SlavekB izdzēsa atzaru feat/fix-if-else-cond pirms 5 gadiem
SlavekB pievienoja atskaites punktu R14.0.6 release pirms 5 gadiem
Izmaiņu pieprasījums tika sapludināts ar revīziju dd6da7345a.
Pierakstieties, lai pievienotos šai sarunai.
Nav recenzentu
Nav atskaites punktu
Nav atbildīgo
3 dalībnieki
Paziņojumi
Izpildes termiņš

Izpildes termiņš nav uzstādīts.

Atkarības

Nav atkarību.

Atsaucas uz: TDE/tdelibs#22
Notiek ielāde…
Vēl nav satura.