libxmp / xmp-cli

Command-line mod player using libxmp
GNU General Public License v2.0
75 stars 22 forks source link

Make more static arrays const #65

Closed ccawley2011 closed 3 weeks ago

ccawley2011 commented 1 month ago

See also libxmp/libxmp#752.

sezero commented 3 weeks ago

This is OK by me. @AliceLR ?

And here is a follow-up patch to change driver description into a driver specific function call: removes the TODO note in sound_oss. patch.txt

sezero commented 3 weeks ago

And here is a follow-up patch to change driver description into a driver specific function call: removes the TODO note in sound_oss. patch.txt

And if we apply that, maybe we can revert https://github.com/libxmp/xmp-cli/commit/0e44b4ebf62514d35a42a6ec59698f7d614c9115 and adapt? (worth it?)

sezero commented 3 weeks ago

Now that this is in, should I create a new PR for the patch above?

AliceLR commented 3 weeks ago

And here is a follow-up patch

+static const char *desc_default = "OSS PCM audio";
+static char descbuf[80] = {0};

Given the whole point of this is to reduce the number of mutable globals/statics: this should be computed by the description function and returned via a caller-owned buffer IMO.

And if we apply that, maybe we can revert 0e44b4e and adapt? (worth it?)

Yes, that sounds OK to me.

sezero commented 3 weeks ago

And here is a follow-up patch

+static const char *desc_default = "OSS PCM audio";
+static char descbuf[80] = {0};

Given the whole point of this is to reduce the number of mutable globals/statics: this should be computed by the description function and returned via a caller-owned buffer IMO.

Do you have a patch (or a draft of it) ?

AliceLR commented 3 weeks ago

Do you have a patch (or a draft of it) ?

No, I only just saw your patch a moment ago.