Skip to content
Myr

stb_vorbis: use const char* when appropriate

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Ronny Chevalier · committed by Ronny Chevalier · parent ee8e926 · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:stb_vorbis.c+4 added-4 removed
209 unmodified lines
210// of callback to your code. (But if you don't support seeking, you may211// just want to go ahead and use pushdata.)212213#if !defined(STB_VORBIS_NO_STDIO) && !defined(STB_VORBIS_NO_INTEGER_CONVERSION)214extern int stb_vorbis_decode_filename(char *filename, int *channels, int *sample_rate, short **output);214extern int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output);215#endif216#if !defined(STB_VORBIS_NO_INTEGER_CONVERSION)217extern int stb_vorbis_decode_memory(unsigned char *mem, int len, int *channels, int *sample_rate, short **output);218#endif
7 unmodified lines
226// create an ogg vorbis decoder from an ogg vorbis stream in memory (note227// this must be the entire stream!). on failure, returns NULL and sets *error228229#ifndef STB_VORBIS_NO_STDIO230extern stb_vorbis * stb_vorbis_open_filename(char *filename,230extern stb_vorbis * stb_vorbis_open_filename(const char *filename,231 int *error, stb_vorbis_alloc *alloc_buffer);232// create an ogg vorbis decoder from a filename via fopen(). on failure,233// returns NULL and sets *error (possibly to VORBIS_file_open_failure).234
4786 unmodified lines
5021 fseek(file, start, SEEK_SET);5022 return stb_vorbis_open_file_section(file, close_on_free, error, alloc, len);5023}50245025stb_vorbis * stb_vorbis_open_filename(char *filename, int *error, stb_vorbis_alloc *alloc)5025stb_vorbis * stb_vorbis_open_filename(const char *filename, int *error, stb_vorbis_alloc *alloc)5026{5027 FILE *f = fopen(filename, "rb");5028 if (f) 5029 return stb_vorbis_open_file(f, TRUE, error, alloc);
246 unmodified lines
5276 return n;5277}52785279#ifndef STB_VORBIS_NO_STDIO5280int stb_vorbis_decode_filename(char *filename, int *channels, int *sample_rate, short **output)5280int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output)5281{5282 int data_len, offset, total, limit, error;5283 short *data;5284 stb_vorbis *v = stb_vorbis_open_filename(filename, &error, NULL);
171 unmodified lines