>>Ever since my previous question, I've been running into two issues with my SDL_mixer bindings. The first, is that I get a warning message whenever I use the function Mix_GetError() (the definition for this function may be found here: https://github.com/d4v3y5c0n3s/Goldelish-Engine/blob/master/source/SDL2/SDL_mixer.sats). The warning is as follows:
g_audio_dats.c: In function 'audio_sound_play': /home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:35: warning: assignment discards 'const' qualifier fr om pointer target type [-Wdiscarded-qualifiers] #define ATSINSmove(tmp, val) (tmp = val) While this is only a warning, I would still like to know what is going wrong here. I looked at ATS-contrib's SDL binding, and found that the SDL_GetError() function there had the exact same problem. (The file for this function definition may be found here: https://github.com/githwxi/ATS-Postiats-contrib/blob/master/contrib/SDL2/SATS/SDL_error.sats ) Here is my guess: Mx_GetError() returns a const string; but it is assigned to a variable (tmp) which is not declared to be a const. I did the following: #define atscntrb_SDL2_SDL_GetError SDL_GetError which should probably be changed to the following: #define atscntrb_SDL2_SDL_GetError() ((char*)(SDL_GetError())) so as to suppress warnings like the one you encountered. --Hongwei On Tue, Apr 28, 2020 at 6:59 AM d4v3y_5c0n3s <tmj9...@gmail.com> wrote: > Ever since my previous question, I've been running into two issues > with my SDL_mixer bindings. The first, is that I get a warning message > whenever I use the function Mix_GetError() (the definition for this > function may be found here: > https://github.com/d4v3y5c0n3s/Goldelish-Engine/blob/master/source/SDL2/SDL_mixer.sats). > The warning is as follows: > > g_audio_dats.c: In function 'audio_sound_play': > /home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:35: > warning: > assignment discards 'const' qualifier fr > om pointer target type [-Wdiscarded-qualifiers] > #define ATSINSmove(tmp, val) (tmp = val) > > While this is only a warning, I would still like to know what is going > wrong here. I looked at ATS-contrib's SDL binding, and found that the > SDL_GetError() function there had the exact same problem. (The file for > this function definition may be found here: > https://github.com/githwxi/ATS-Postiats-contrib/blob/master/contrib/SDL2/SATS/SDL_error.sats > ) > > The second issue that I'm running into has to do with my > Mix_FadeInMusic() function (which is defined here: > https://github.com/d4v3y5c0n3s/Goldelish-Engine/blob/master/source/SDL2/SDL_mixer.sats). > When I use this function, I get the following error message: > > g_audio_dats.c: In function 'audio_music_play': > g_audio_dats.c:931:11: error: storage size of 'tmpref41' isn't known > ATStmpdec(tmpref41, Mix_Music) ; > ^~~~~~~~ > /home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:209:33: > note: > in definition of macro 'ATStmpdec' > #define ATStmpdec(tmp, hit) hit tmp > ^~~ > /home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:217:29: > error: > dereferencing pointer to incomplete type ' > Mix_Music' {aka 'struct _Mix_Music'} > #define ATSderef(pmv, hit) (*(hit*)pmv) > > > The file *where I've been receiving these errors* is available here: > https://github.com/d4v3y5c0n3s/Goldelish-Engine/blob/master/source/g_audio.dats. > My full source code is available on Github here: > https://github.com/d4v3y5c0n3s/Goldelish-Engine. > > Any help is appreciated, and if you'd like me to provide any more > information, please ask for it. Also, if anyone knows of a great resource > for understanding how the internals of ATS work, please let me know. I > have a feeling that if I better understood how ATS worked, I would also > better understand what to do when I encounter error messages such as these. > > -- > You received this message because you are subscribed to the Google Groups > "ats-lang-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ats-lang-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ats-lang-users/e3db4fac-0969-406f-aaa5-02b3b2145a84%40googlegroups.com > <https://groups.google.com/d/msgid/ats-lang-users/e3db4fac-0969-406f-aaa5-02b3b2145a84%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqNG4P5EyxGLVWRDVPhZq-a_W2cOBORE-x16Rhb_0LxUg%40mail.gmail.com.