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

병합
SlavekB feat/fix-if-else-cond 에서 master 로 1 commits 를 머지했습니다 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 left a comment
소유자

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 closed this pull request 5 년 전
SlavekB 삭제된 브랜치 feat/fix-if-else-cond 5 년 전
SlavekB R14.0.6 release 5 년 전 마일스톤을 추가하였습니다.
The pull request has been merged as dd6da7345a.
로그인하여 이 대화에 참여
No reviewers
마일스톤 없음
담당자 없음
참여자 3명
알림
마감일

마감일이 설정되지 않았습니다.

의존성

No dependencies set.

Reference: TDE/tdelibs#22
불러오는 중...
아직 콘텐츠가 없습니다.