7
1
Fork 0

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

Zusammengeführt
SlavekB hat 1 Commits von feat/fix-if-else-cond nach master vor 5 Jahren zusammengeführt
obache hat vor 5 Jahren kommentiert
Mitarbeiter

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

OSS MIDI API may be missing even if ALSA is enabled.
SlavekB hat vor 5 Jahren überprüft
SlavekB hat einen Kommentar hinterlassen
Besitzer

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 hat vor 5 Jahren kommentiert
Besitzer

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 hat vor 5 Jahren kommentiert
Besitzer

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 hat vor 5 Jahren kommentiert
Besitzer

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 hat vor 5 Jahren kommentiert
Ersteller
Mitarbeiter

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 hat vor 5 Jahren kommentiert
Ersteller
Mitarbeiter

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 hat vor 5 Jahren kommentiert
Besitzer

Please give attention to my review – see comment above.

Please give attention to my review – see comment above.
obache hat vor 5 Jahren kommentiert
Ersteller
Mitarbeiter

Changed to coding style same as others.

Changed to coding style same as others.
SlavekB hat diesen Pull-Request vor 5 Jahren geschlossen
SlavekB löschte die Branch feat/fix-if-else-cond vor 5 Jahren
SlavekB hat diesen Issue vor 5 Jahren zum R14.0.6 release Meilenstein hinzugefügt
Der Pull Request wurde als dd6da7345a gemergt.
Anmelden, um an der Diskussion teilzunehmen.
Keine Reviewer
Kein Meilenstein
Niemand zuständig
3 Beteiligte
Nachrichten
Fällig am

Kein Fälligkeitsdatum gesetzt.

Abhängigkeiten

Keine Abhängigkeiten gesetzt.

Referenz: TDE/tdelibs#22
Laden…
Hier gibt es bis jetzt noch keinen Inhalt.