Yea, so, the reason that the suggestion you had for Mix_GetError() wasn't working for me was that in the function definition I put "... = "mac#Mix_GetError"" at the end which was causing the macro to not apply to the function. To fix this, I changed it to "... = "mac#%"", which caused it to work without a hitch. I will see if the same issue is partially behind the issue I am having with Mix_FadeInMusic().
On Wednesday, April 29, 2020 at 5:54:42 PM UTC-4, d4v3y_5c0n3s wrote: > > Actually, I think I've figured out (at least partially) what's wrong with > my code. I will post my results once I get the opportunity to test my > theory out. > > On Wednesday, April 29, 2020 at 7:31:27 AM UTC-4, d4v3y_5c0n3s wrote: >> >> So, I made the changes which you suggested, but unfortunately, this >> didn't resolve the issues. First, I tried modifying the macro for >> Mix_GetError() in the SDL_mixer.cats file to what you suggested, but this >> didn't seem to change the error message. Perhaps I missed something, >> because I don't have a solid understanding of more complex C macros. My >> changes can be seen here: >> https://github.com/d4v3y5c0n3s/Goldelish-Engine/blob/master/source/SDL2/SDL_local.cats >> >> Next, I tried modifying the function definition for >> Mix_FadeInMusic() in SDL_mixer.sats to match your suggested modifacation, >> but this didn't fix the issue. Your suggestion is actually how I had >> previously written the function, but I had changed it while experimenting >> to find the cause of the issue I was encountering. When I pushed my >> changes to Github, I forgot to revert that function to what it had been >> previously. My changes can be seen here: >> https://github.com/d4v3y5c0n3s/Goldelish-Engine/blob/master/source/SDL2/SDL_mixer.sats >> >> I appreciate the help, so thank you. >> >> *Here are the errors which I am currently getting after incorporating the >> changes you suggested:* >> >> In file included from g_audio_dats.c:15: >> 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 from pointer target type >> [-Wdiscarded-qualifiers] >> #define ATSINSmove(tmp, val) (tmp = val) >> ^ >> g_audio_dats.c:753:1: note: in expansion of macro 'ATSINSmove' >> ATSINSmove(tmp36, Mix_GetError()) ; >> ^~~~~~~~~~ >> 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) >> /home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:37: >> note: in definition of macro 'ATSINSmove' >> #define ATSINSmove(tmp, val) (tmp = val) >> ^~~ >> g_audio_dats.c:960:22: note: in expansion of macro 'ATSSELrecsin' >> ATSINSmove(tmpref41, ATSSELrecsin(ATSderef(arg0, Mix_Music), Mix_Music, >> atslab__handle)) ; >> ^~~~~~~~~~~~ >> g_audio_dats.c:960:35: note: in expansion of macro 'ATSderef' >> ATSINSmove(tmpref41, ATSSELrecsin(ATSderef(arg0, Mix_Music), Mix_Music, >> atslab__handle)) ; >> ^~~~~~~~ >> /home/d4v3y/ATS2-Postiats-0.4.0/ccomp/runtime/pats_ccomp_instrset.h:276:35: >> warning: assignment discards 'const' qualifier from pointer target type >> [-Wdiscarded-qualifiers] >> #define ATSINSmove(tmp, val) (tmp = val) >> ^ >> g_audio_dats.c:999:1: note: in expansion of macro 'ATSINSmove' >> ATSINSmove(tmp50, Mix_GetError()) ; >> ^~~~~~~~~~ >> make: *** [Makefile:63: obj/g_audio_dats.o] Error 1 >> >> >> On Tuesday, April 28, 2020 at 2:26:04 PM UTC-4, gmhwxi 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 >>> ) >>> >>> 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 <[email protected]> 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 [email protected]. >>>> 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/45cb4519-e7b1-4dbf-9dff-e72e640575d5%40googlegroups.com.
