Skip to content

Commit

Permalink
Fixed bug #825
Browse files Browse the repository at this point in the history
O.Sezer      2009-10-03 15:22:34 PDT

The following compiler warning

./timidity/timidity.c: In function 'Timidity_Init':
./timidity/timidity.c:298: warning: passing argument 1 of 'read_config_file'
discards qualifiers from pointer target type

.. showed that timidity needed some constification.  Minor grunt work attached.
  • Loading branch information
slouken committed Oct 4, 2009
1 parent 1695743 commit 64ff487
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions timidity/common.c
Expand Up @@ -99,7 +99,7 @@ static FILE *try_to_open(char *name, int decompress, int noise_mode)

/* This is meant to find and open files for reading, possibly piping
them through a decompressor. */
FILE *open_file(char *name, int decompress, int noise_mode)
FILE *open_file(const char *name, int decompress, int noise_mode)
{
FILE *fp;
PathList *plp;
Expand Down Expand Up @@ -219,7 +219,7 @@ void *safe_malloc(size_t count)
}

/* This adds a directory to the path list */
void add_to_pathlist(char *s)
void add_to_pathlist(const char *s)
{
PathList *plp=safe_malloc(sizeof(PathList));
strcpy((plp->path=safe_malloc(strlen(s)+1)),s);
Expand Down
4 changes: 2 additions & 2 deletions timidity/common.h
Expand Up @@ -40,8 +40,8 @@ typedef struct {
#define OF_NORMAL 1
#define OF_VERBOSE 2

extern FILE *open_file(char *name, int decompress, int noise_mode);
extern void add_to_pathlist(char *s);
extern FILE *open_file(const char *name, int decompress, int noise_mode);
extern void add_to_pathlist(const char *s);
extern void free_pathlist(void);
extern void close_file(FILE *fp);
extern void skip(FILE *fp, size_t len);
Expand Down
4 changes: 2 additions & 2 deletions timidity/timidity.c
Expand Up @@ -45,7 +45,7 @@ int num_ochannels;

#define MAXWORDS 10

static int read_config_file(char *name)
static int read_config_file(const char *name)
{
FILE *fp;
char tmp[1024], *w[MAXWORDS], *cp;
Expand Down Expand Up @@ -370,7 +370,7 @@ int Timidity_Init(int rate, int format, int channels, int samples)
}

char timidity_error[1024] = "";
char *Timidity_Error(void)
const char *Timidity_Error(void)
{
return(timidity_error);
}
2 changes: 1 addition & 1 deletion timidity/timidity.h
Expand Up @@ -22,7 +22,7 @@
typedef struct _MidiSong MidiSong;

extern int Timidity_Init(int rate, int format, int channels, int samples);
extern char *Timidity_Error(void);
extern const char *Timidity_Error(void);
extern void Timidity_SetVolume(int volume);
extern int Timidity_PlaySome(void *stream, int samples);
extern MidiSong *Timidity_LoadSong(char *midifile);
Expand Down

0 comments on commit 64ff487

Please sign in to comment.