]> granicus.if.org Git - nethack/commitdiff
make a small change to sound interface
authornhmall <nhmall@nethack.org>
Sun, 22 Jan 2023 18:49:38 +0000 (13:49 -0500)
committernhmall <nhmall@nethack.org>
Sun, 22 Jan 2023 18:49:38 +0000 (13:49 -0500)
add a const

include/sndprocs.h
sound/windsound/windsound.c
src/sounds.c
win/Qt/qt_bind.cpp
win/Qt/qt_bind.h

index 682690dabf02a5d095acc6bfe918e77e4b6e4368..7c3dfac9cf6e7c0460e3a6a367de7b1fcea3ec25 100644 (file)
@@ -24,7 +24,7 @@
  *                            interface function pointer used to invoke it:
  *
  *                             void (*sound_hero_playnotes)(int32_t instrument,
- *                                                 char *str, int32_t volume);
+ *                                             const char *str, int32_t volume);
  *
  *      SNDCAP_ACHIEVEMENTS   Invoked by the core when an in-game achievement
  *                            is reached. The soundlib routines could play
@@ -105,7 +105,7 @@ struct sound_procs {
     void (*sound_exit_nhsound)(const char *);
     void (*sound_achievement)(schar, schar, int32_t);
     void (*sound_soundeffect)(char *desc, int32_t, int32_t volume);
-    void (*sound_hero_playnotes)(int32_t instrument, char *str, int32_t volume);
+    void (*sound_hero_playnotes)(int32_t instrument, const char *str, int32_t volume);
     void (*sound_play_usersound)(char *filename, int32_t volume, int32_t idx);
 };
 
index 9771b0a8306bb858c16a24e833f294f042338fd0..d6732bc44a1a74846b349b529095b41f684df638 100644 (file)
@@ -20,7 +20,7 @@ static void windsound_init_nhsound(void);
 static void windsound_exit_nhsound(const char *);
 static void windsound_achievement(schar, schar, int32_t);
 static void windsound_soundeffect(char *, int32_t, int32_t);
-static void windsound_hero_playnotes(int32_t instrument, char *str, int32_t volume);
+static void windsound_hero_playnotes(int32_t instrument, const char *str, int32_t volume);
 static void windsound_play_usersound(char *, int32_t, int32_t);
 
 struct sound_procs windsound_procs = {
@@ -77,7 +77,7 @@ windsound_soundeffect(char *desc, int32_t seid, int32_t volume)
 #define WAVEMUSIC_SOUNDS
 
 void
-windsound_hero_playnotes(int32_t instrument, char *str, int32_t volume)
+windsound_hero_playnotes(int32_t instrument, const char *str, int32_t volume)
 {
 #ifdef WAVEMUSIC_SOUNDS
     int reslt = 0;
index 6d06063d211970d528b78f8273013e232dcabd9c..f5ae0c16137b764fc47f0c8b7b7f2d0fae5aeeb9 100644 (file)
@@ -1753,7 +1753,7 @@ struct sound_procs nosound_procs = {
     (void (*)(const char *)) 0,             /* exit_nhsound    */
     (void (*)(schar, schar, int32_t)) 0,    /* achievement     */
     (void (*)(char *, int32_t, int32_t)) 0, /* sound effect    */
-    (void (*)(int32_t, char *, int32_t)) 0, /* hero_playnotes  */
+    (void (*)(int32_t, const char *, int32_t)) 0, /* hero_playnotes  */
     (void (*)(char *, int32_t, int32_t)) 0, /* play_usersound  */
 };
 
index f6a83c9d249825d3cd56c2f71bc74df938bcd0c6..17dc354a51c408d9f4b5131364c95f195bb02b94 100644 (file)
@@ -1056,7 +1056,7 @@ void NetHackQtBind::qtsound_soundeffect(char *desc UNUSED, int32_t seid UNUSED,
 {
 }
 
-void NetHackQtBind::qtsound_hero_playnotes(int32_t instrument UNUSED, char *str UNUSED, int32_t volume UNUSED)
+void NetHackQtBind::qtsound_hero_playnotes(int32_t instrument UNUSED, const char *str UNUSED, int32_t volume UNUSED)
 {
 }
 #endif
index 98bf252a1ae18abc74705dc86909584dcbe32734..3bb7d0a8b0b430408d22e4acdc9f897213f51b71 100644 (file)
@@ -100,7 +100,7 @@ public:
         static void qtsound_exit_nhsound(const char *);
         static void qtsound_achievement(schar, schar, int32_t);
         static void qtsound_soundeffect(char *, int32_t, int32_t);
-        static void qtsound_hero_playnotes(int32_t instrument, char *str, int32_t volume);
+        static void qtsound_hero_playnotes(int32_t instrument, const char *str, int32_t volume);
         static void qtsound_play_usersound(char *, int32_t, int32_t);
 #endif