Kaynağa Gözat

raudio: Fix warning on discarded const qualifier (#2967)

The `qoaplay_open()` function expects a `char *`, but we are passing in a `const char *`. While this works just fine, it does issue a compiler warning when strict:

```
src/raudio.c: In function ‘LoadMusicStream’:
src/raudio.c:1290:45: warning: passing argument 1 of ‘qoaplay_open’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1290 |         qoaplay_desc *ctxQoa = qoaplay_open(fileName);
      |                                             ^~~~~~~~
In file included from src/raudio.c:233:
src/external/qoaplay.c:86:34: note: expected ‘char *’ but argument is of type ‘const char *’
   86 | qoaplay_desc *qoaplay_open(char *path)
      |                            ~~~~~~^~~~
```

This change casts the argument to a `char *` to fix the warning.
pull/2970/head
Rob Loach 1 yıl önce
işlemeyi yapan: GitHub
ebeveyn
işleme
c14c7f0b69
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. +1
    -1
      src/raudio.c

+ 1
- 1
src/raudio.c Dosyayı Görüntüle

@ -1287,7 +1287,7 @@ Music LoadMusicStream(const char *fileName)
#if defined(SUPPORT_FILEFORMAT_QOA)
else if (IsFileExtension(fileName, ".qoa"))
{
qoaplay_desc *ctxQoa = qoaplay_open(fileName);
qoaplay_desc *ctxQoa = qoaplay_open(p">(char *)fileName);
music.ctxType = MUSIC_AUDIO_QOA;
music.ctxData = ctxQoa;

Yükleniyor…
İptal
Kaydet