Commit ad47480b authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Update: Added consts and statics

parent 4ba87d43
......@@ -37,12 +37,12 @@ typedef struct file_private_t {
transport_t file_transport; /* Forward declaration */
int file_can_transport (char *source_string)
int file_can_transport (const char *source_string)
{
return 1; /* The file transport is tested last, so always try it */
}
data_source_t* file_open (char *source_string, ogg123_options_t *ogg123_opts)
data_source_t* file_open (const char *source_string, ogg123_options_t *ogg123_opts)
{
data_source_t *source;
file_private_t *private;
......
......@@ -167,7 +167,7 @@ void *curl_thread_func (void *arg)
/* -------------------------- Public interface -------------------------- */
int http_can_transport (char *source_string)
int http_can_transport (const char *source_string)
{
int tmp;
......@@ -178,7 +178,7 @@ int http_can_transport (char *source_string)
}
data_source_t* http_open (char *source_string, ogg123_options_t *ogg123_opts)
data_source_t* http_open (const char *source_string, ogg123_options_t *ogg123_opts)
{
data_source_t *source;
http_private_t *private;
......
......@@ -514,7 +514,7 @@ int main(int argc, char **argv)
void play (char *source_string)
{
transport_t *transport;
const transport_t *transport;
format_t *format;
data_source_t *source;
decoder_t *decoder;
......
......@@ -30,7 +30,7 @@ extern transport_t file_transport;
extern transport_t http_transport;
#endif
transport_t *transports[] = {
static const transport_t *transports[] = {
#ifdef HAVE_CURL
&http_transport,
#endif
......@@ -39,7 +39,7 @@ transport_t *transports[] = {
};
transport_t *get_transport_by_name (char *name)
const transport_t *get_transport_by_name (const char *name)
{
int i = 0;
......@@ -50,7 +50,7 @@ transport_t *get_transport_by_name (char *name)
}
transport_t *select_transport (char *source)
const transport_t *select_transport (const char *source)
{
int i = 0;
......
......@@ -43,9 +43,9 @@ typedef struct data_source_t {
} data_source_t;
typedef struct transport_t {
char *name;
int (* can_transport)(char *source_string);
data_source_t* (* open) (char *source_string, ogg123_options_t *ogg123_opts);
const char *name;
int (* can_transport)(const char *source_string);
data_source_t* (* open) (const char *source_string, ogg123_options_t *ogg123_opts);
int (* peek) (data_source_t *source, void *ptr, size_t size, size_t nmemb);
int (* read) (data_source_t *source, void *ptr, size_t size, size_t nmemb);
int (* seek) (data_source_t *source, long offset, int whence);
......@@ -54,8 +54,8 @@ typedef struct transport_t {
void (* close) (data_source_t *source);
} transport_t;
transport_t *get_transport_by_name (char *name);
transport_t *select_transport (char *source);
const transport_t *get_transport_by_name (const char *name);
const transport_t *select_transport (const char *source);
data_source_stats_t *malloc_data_source_stats (data_source_stats_t *to_copy);
......
......@@ -29,12 +29,13 @@
#include "format.h"
#include "utf8.h"
#include "i18n.h"
#include "vorbis_comments.h"
/* Vorbis comment keys that need special formatting. */
struct {
char *key; /* includes the '=' for programming convenience */
char *formatstr; /* formatted output */
static const struct {
const char *key; /* includes the '=' for programming convenience */
const char *formatstr; /* formatted output */
} vorbis_comment_keys[] = {
{"TRACKNUMBER=", N_("Track number:")},
{"REPLAYGAIN_TRACK_GAIN=", N_("ReplayGain (Track):")},
......@@ -47,7 +48,7 @@ struct {
};
char *lookup_comment_prettyprint (char *comment, int *offset)
char *lookup_comment_prettyprint (const char *comment, int *offset)
{
int i, j;
char *s;
......@@ -101,7 +102,7 @@ char *lookup_comment_prettyprint (char *comment, int *offset)
return s;
}
void print_vorbis_comment (char *comment, decoder_callbacks_t *cb,
void print_vorbis_comment (const char *comment, decoder_callbacks_t *cb,
void *callback_arg)
{
char *comment_prettyprint;
......
......@@ -22,7 +22,7 @@
#include "format.h"
void print_vorbis_comment (char *comment, decoder_callbacks_t *cb,
void print_vorbis_comment (const char *comment, decoder_callbacks_t *cb,
void *callback_arg);
#endif /* __VORBIS_COMMENTS_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment