mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-07-10 13:29:52 -04:00
Simpler const fix for fill_metadata_from_path()
Make sure the output of strchr(const*) is assinged to a const* This way the filename argument can stay const Change-Id: Ie46be936491eb62ba2a7e729b8cd7881e205bba7
This commit is contained in:
parent
026ce110f2
commit
8768266d27
2 changed files with 5 additions and 5 deletions
|
|
@ -381,7 +381,7 @@ bool format_buffers_with_offset(int afmt)
|
||||||
/* Simple file type probing by looking at the filename extension. */
|
/* Simple file type probing by looking at the filename extension. */
|
||||||
unsigned int probe_file_format(const char *filename)
|
unsigned int probe_file_format(const char *filename)
|
||||||
{
|
{
|
||||||
char *suffix;
|
const char *suffix;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
suffix = strrchr(filename, '.');
|
suffix = strrchr(filename, '.');
|
||||||
|
|
@ -418,7 +418,7 @@ unsigned int probe_file_format(const char *filename)
|
||||||
* file that would prevent playback. supply a filedescriptor <0 and the file will be opened
|
* file that would prevent playback. supply a filedescriptor <0 and the file will be opened
|
||||||
* and closed automatically within the get_metadata call
|
* and closed automatically within the get_metadata call
|
||||||
* get_metadata_ex allows flags to change the way get_metadata behaves
|
* get_metadata_ex allows flags to change the way get_metadata behaves
|
||||||
* METADATA_EXCLUDE_ID3_PATH won't copy filename path to the id3 path buffer
|
* METADATA_EXCLUDE_ID3_PATH won't copy filename path to the id3 path buffer
|
||||||
* METADATA_CLOSE_FD_ON_EXIT closes the open filedescriptor on exit
|
* METADATA_CLOSE_FD_ON_EXIT closes the open filedescriptor on exit
|
||||||
*/
|
*/
|
||||||
bool get_metadata_ex(struct mp3entry* id3, int fd, const char* trackname, int flags)
|
bool get_metadata_ex(struct mp3entry* id3, int fd, const char* trackname, int flags)
|
||||||
|
|
@ -554,8 +554,8 @@ void fill_metadata_from_path(struct mp3entry *id3, const char *trackname)
|
||||||
wipe_mp3entry(id3);
|
wipe_mp3entry(id3);
|
||||||
|
|
||||||
/* Find the filename portion of the path */
|
/* Find the filename portion of the path */
|
||||||
p = strrchr(trackname, '/');
|
const char *pt = strrchr(trackname, '/');
|
||||||
strlcpy(id3->id3v2buf, p ? ++p : id3->path, ID3V2_BUF_SIZE);
|
strlcpy(id3->id3v2buf, pt ? ++pt : id3->path, ID3V2_BUF_SIZE);
|
||||||
|
|
||||||
/* Get the format from the extension and trim it off */
|
/* Get the format from the extension and trim it off */
|
||||||
p = strrchr(id3->id3v2buf, '.');
|
p = strrchr(id3->id3v2buf, '.');
|
||||||
|
|
|
||||||
|
|
@ -317,7 +317,7 @@ void skin_error_format_message(void)
|
||||||
char text[128];
|
char text[128];
|
||||||
if (!error_line_start)
|
if (!error_line_start)
|
||||||
return;
|
return;
|
||||||
char* line_end = strchr(error_line_start, '\n');
|
const char* line_end = strchr(error_line_start, '\n');
|
||||||
int len = MIN(line_end - error_line_start, 80);
|
int len = MIN(line_end - error_line_start, 80);
|
||||||
if (!line_end)
|
if (!line_end)
|
||||||
len = strlen(error_line_start);
|
len = strlen(error_line_start);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue