Add mpd-indent.sh
Add a few new options for indent to try to make things a bit cleaner git-svn-id: https://svn.musicpd.org/mpd/trunk@4411 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
29a25b9933
commit
00e67be7c9
1
doc/mpd-indent.sh
Executable file
1
doc/mpd-indent.sh
Executable file
@ -0,0 +1 @@
|
|||||||
|
find ../src/ -name "*.[ch]" -exec indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cdw -cd0 -c0 -cp0 {} \;
|
@ -197,7 +197,7 @@ static void convertAudioFormat(AudioOutput * audioOutput, char **chunkArgPtr,
|
|||||||
pcm_sizeOfOutputBufferForAudioFormatConversion(&
|
pcm_sizeOfOutputBufferForAudioFormatConversion(&
|
||||||
(audioOutput->
|
(audioOutput->
|
||||||
inAudioFormat),
|
inAudioFormat),
|
||||||
*sizeArgPtr,
|
*sizeArgPtr,
|
||||||
&(audioOutput->outAudioFormat));
|
&(audioOutput->outAudioFormat));
|
||||||
|
|
||||||
if (size > audioOutput->convBufferLen) {
|
if (size > audioOutput->convBufferLen) {
|
||||||
|
@ -408,10 +408,10 @@ AudioOutputPlugin alsaPlugin = {
|
|||||||
alsa_playAudio,
|
alsa_playAudio,
|
||||||
alsa_dropBufferedAudio,
|
alsa_dropBufferedAudio,
|
||||||
alsa_closeDevice,
|
alsa_closeDevice,
|
||||||
NULL, /* sendMetadataFunc */
|
NULL, /* sendMetadataFunc */
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* HAVE ALSA */
|
#else /* HAVE ALSA */
|
||||||
|
|
||||||
DISABLED_AUDIO_OUTPUT_PLUGIN(alsaPlugin)
|
DISABLED_AUDIO_OUTPUT_PLUGIN(alsaPlugin)
|
||||||
#endif /* HAVE_ALSA */
|
#endif /* HAVE_ALSA */
|
||||||
|
@ -248,7 +248,7 @@ AudioOutputPlugin aoPlugin = {
|
|||||||
audioOutputAo_play,
|
audioOutputAo_play,
|
||||||
audioOutputAo_dropBufferedAudio,
|
audioOutputAo_dropBufferedAudio,
|
||||||
audioOutputAo_closeDevice,
|
audioOutputAo_closeDevice,
|
||||||
NULL, /* sendMetadataFunc */
|
NULL, /* sendMetadataFunc */
|
||||||
};
|
};
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -143,7 +143,7 @@ static int mvp_setPcmParams(MvpData * md, unsigned long rate, int channels,
|
|||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
mix[3] = 0; /* stream type? */
|
mix[3] = 0; /* stream type? */
|
||||||
|
|
||||||
if (big_endian == 1)
|
if (big_endian == 1)
|
||||||
mix[4] = 1;
|
mix[4] = 1;
|
||||||
@ -278,10 +278,10 @@ AudioOutputPlugin mvpPlugin = {
|
|||||||
mvp_playAudio,
|
mvp_playAudio,
|
||||||
mvp_dropBufferedAudio,
|
mvp_dropBufferedAudio,
|
||||||
mvp_closeDevice,
|
mvp_closeDevice,
|
||||||
NULL, /* sendMetadataFunc */
|
NULL, /* sendMetadataFunc */
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* HAVE_MVP */
|
#else /* HAVE_MVP */
|
||||||
|
|
||||||
DISABLED_AUDIO_OUTPUT_PLUGIN(mvpPlugin)
|
DISABLED_AUDIO_OUTPUT_PLUGIN(mvpPlugin)
|
||||||
#endif /* HAVE_MVP */
|
#endif /* HAVE_MVP */
|
||||||
|
@ -42,15 +42,15 @@
|
|||||||
|
|
||||||
#if defined(__OpenBSD__) || defined(__NetBSD__)
|
#if defined(__OpenBSD__) || defined(__NetBSD__)
|
||||||
# include <soundcard.h>
|
# include <soundcard.h>
|
||||||
#else /* !(defined(__OpenBSD__) || defined(__NetBSD__) */
|
#else /* !(defined(__OpenBSD__) || defined(__NetBSD__) */
|
||||||
# include <sys/soundcard.h>
|
# include <sys/soundcard.h>
|
||||||
#endif /* !(defined(__OpenBSD__) || defined(__NetBSD__) */
|
#endif /* !(defined(__OpenBSD__) || defined(__NetBSD__) */
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
# define AFMT_S16_MPD AFMT_S16_BE
|
# define AFMT_S16_MPD AFMT_S16_BE
|
||||||
#else
|
#else
|
||||||
# define AFMT_S16_MPD AFMT_S16_LE
|
# define AFMT_S16_MPD AFMT_S16_LE
|
||||||
#endif /* WORDS_BIGENDIAN */
|
#endif /* WORDS_BIGENDIAN */
|
||||||
|
|
||||||
typedef struct _OssData {
|
typedef struct _OssData {
|
||||||
int fd;
|
int fd;
|
||||||
@ -585,10 +585,10 @@ AudioOutputPlugin ossPlugin = {
|
|||||||
oss_playAudio,
|
oss_playAudio,
|
||||||
oss_dropBufferedAudio,
|
oss_dropBufferedAudio,
|
||||||
oss_closeDevice,
|
oss_closeDevice,
|
||||||
NULL, /* sendMetadataFunc */
|
NULL, /* sendMetadataFunc */
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* HAVE OSS */
|
#else /* HAVE OSS */
|
||||||
|
|
||||||
DISABLED_AUDIO_OUTPUT_PLUGIN(ossPlugin)
|
DISABLED_AUDIO_OUTPUT_PLUGIN(ossPlugin)
|
||||||
#endif /* HAVE_OSS */
|
#endif /* HAVE_OSS */
|
||||||
|
@ -361,7 +361,7 @@ AudioOutputPlugin osxPlugin = {
|
|||||||
osx_play,
|
osx_play,
|
||||||
osx_dropBufferedAudio,
|
osx_dropBufferedAudio,
|
||||||
osx_closeDevice,
|
osx_closeDevice,
|
||||||
NULL, /* sendMetadataFunc */
|
NULL, /* sendMetadataFunc */
|
||||||
};
|
};
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -211,10 +211,10 @@ AudioOutputPlugin pulsePlugin = {
|
|||||||
pulse_playAudio,
|
pulse_playAudio,
|
||||||
pulse_dropBufferedAudio,
|
pulse_dropBufferedAudio,
|
||||||
pulse_closeDevice,
|
pulse_closeDevice,
|
||||||
NULL, /* sendMetadataFunc */
|
NULL, /* sendMetadataFunc */
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* HAVE_PULSE */
|
#else /* HAVE_PULSE */
|
||||||
|
|
||||||
DISABLED_AUDIO_OUTPUT_PLUGIN(pulsePlugin)
|
DISABLED_AUDIO_OUTPUT_PLUGIN(pulsePlugin)
|
||||||
#endif /* HAVE_PULSE */
|
#endif /* HAVE_PULSE */
|
||||||
|
@ -208,4 +208,4 @@ void flac_error_common_cb(const char *plugin,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_FLAC || HAVE_OGGFLAC */
|
#endif /* HAVE_FLAC || HAVE_OGGFLAC */
|
||||||
|
@ -73,6 +73,6 @@ static inline int flacSendChunk(FlacData * data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_FLAC || HAVE_OGGFLAC */
|
#endif /* HAVE_FLAC || HAVE_OGGFLAC */
|
||||||
|
|
||||||
#endif /* _FLAC_COMMON_H */
|
#endif /* _FLAC_COMMON_H */
|
||||||
|
@ -70,4 +70,4 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream)
|
|||||||
return VORBIS;
|
return VORBIS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* defined(HAVE_OGGFLAC || defined(HAVE_OGGVORBIS) */
|
#endif /* defined(HAVE_OGGFLAC || defined(HAVE_OGGVORBIS) */
|
||||||
|
@ -30,6 +30,6 @@ typedef enum _ogg_stream_type { VORBIS, FLAC } ogg_stream_type;
|
|||||||
|
|
||||||
ogg_stream_type ogg_stream_type_detect(InputStream * inStream);
|
ogg_stream_type ogg_stream_type_detect(InputStream * inStream);
|
||||||
|
|
||||||
#endif /* defined(HAVE_OGGFLAC || defined(HAVE_OGGVORBIS) */
|
#endif /* defined(HAVE_OGGFLAC || defined(HAVE_OGGVORBIS) */
|
||||||
|
|
||||||
#endif /* _OGG_COMMON_H */
|
#endif /* _OGG_COMMON_H */
|
||||||
|
@ -482,4 +482,4 @@ InputPlugin aacPlugin = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HAVE_FAAD */
|
#endif /* HAVE_FAAD */
|
||||||
|
@ -194,4 +194,4 @@ InputPlugin audiofilePlugin = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HAVE_AUDIOFILE */
|
#endif /* HAVE_AUDIOFILE */
|
||||||
|
@ -454,7 +454,7 @@ InputPlugin flacPlugin = {
|
|||||||
flac_mime_types
|
flac_mime_types
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* !HAVE_FLAC */
|
#else /* !HAVE_FLAC */
|
||||||
|
|
||||||
InputPlugin flacPlugin = {
|
InputPlugin flacPlugin = {
|
||||||
NULL,
|
NULL,
|
||||||
@ -469,4 +469,4 @@ InputPlugin flacPlugin = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HAVE_FLAC */
|
#endif /* HAVE_FLAC */
|
||||||
|
@ -298,4 +298,4 @@ InputPlugin modPlugin = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HAVE_AUDIOFILE */
|
#endif /* HAVE_AUDIOFILE */
|
||||||
|
@ -225,12 +225,10 @@ static ReplayGainInfo *parseId3ReplayGainInfo(struct id3_tag *tag)
|
|||||||
if (frame->nfields < 3)
|
if (frame->nfields < 3)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
key =
|
key = (char *)
|
||||||
(char *)
|
|
||||||
id3_ucs4_latin1duplicate(id3_field_getstring
|
id3_ucs4_latin1duplicate(id3_field_getstring
|
||||||
(&frame->fields[1]));
|
(&frame->fields[1]));
|
||||||
value =
|
value = (char *)
|
||||||
(char *)
|
|
||||||
id3_ucs4_latin1duplicate(id3_field_getstring
|
id3_ucs4_latin1duplicate(id3_field_getstring
|
||||||
(&frame->fields[2]));
|
(&frame->fields[2]));
|
||||||
|
|
||||||
@ -440,11 +438,11 @@ enum xing_magic {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct xing {
|
struct xing {
|
||||||
long flags; /* valid fields (see below) */
|
long flags; /* valid fields (see below) */
|
||||||
unsigned long frames; /* total number of frames */
|
unsigned long frames; /* total number of frames */
|
||||||
unsigned long bytes; /* total number of bytes */
|
unsigned long bytes; /* total number of bytes */
|
||||||
unsigned char toc[100]; /* 100-point seek table */
|
unsigned char toc[100]; /* 100-point seek table */
|
||||||
long scale; /* VBR quality */
|
long scale; /* VBR quality */
|
||||||
enum xing_magic magic; /* header magic */
|
enum xing_magic magic; /* header magic */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -468,4 +468,4 @@ InputPlugin mp4Plugin = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HAVE_FAAD */
|
#endif /* HAVE_FAAD */
|
||||||
|
@ -251,8 +251,8 @@ static void of_metadata_decode_cb(const OggFLAC__SeekableStreamDecoder * dec,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static OggFLAC__SeekableStreamDecoder
|
static OggFLAC__SeekableStreamDecoder
|
||||||
*full_decoder_init_and_read_metadata(FlacData * data,
|
* full_decoder_init_and_read_metadata(FlacData * data,
|
||||||
unsigned int metadata_only)
|
unsigned int metadata_only)
|
||||||
{
|
{
|
||||||
OggFLAC__SeekableStreamDecoder *decoder = NULL;
|
OggFLAC__SeekableStreamDecoder *decoder = NULL;
|
||||||
unsigned int s = 1;
|
unsigned int s = 1;
|
||||||
@ -416,7 +416,7 @@ InputPlugin oggflacPlugin = {
|
|||||||
oggflac_mime_types
|
oggflac_mime_types
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* !HAVE_FLAC */
|
#else /* !HAVE_FLAC */
|
||||||
|
|
||||||
InputPlugin oggflacPlugin = {
|
InputPlugin oggflacPlugin = {
|
||||||
NULL,
|
NULL,
|
||||||
@ -431,4 +431,4 @@ InputPlugin oggflacPlugin = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HAVE_OGGFLAC */
|
#endif /* HAVE_OGGFLAC */
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#define ov_time_total(VF, I) ((double)ov_time_total(VF, I)/1000)
|
#define ov_time_total(VF, I) ((double)ov_time_total(VF, I)/1000)
|
||||||
#define ov_time_tell(VF) ((double)ov_time_tell(VF)/1000)
|
#define ov_time_tell(VF) ((double)ov_time_tell(VF)/1000)
|
||||||
#define ov_time_seek_page(VF, S) (ov_time_seek_page(VF, (S)*1000))
|
#define ov_time_seek_page(VF, S) (ov_time_seek_page(VF, (S)*1000))
|
||||||
#endif /* HAVE_TREMOR */
|
#endif /* HAVE_TREMOR */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -424,7 +424,7 @@ InputPlugin oggvorbisPlugin = {
|
|||||||
oggvorbis_MimeTypes
|
oggvorbis_MimeTypes
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* !HAVE_OGGVORBIS */
|
#else /* !HAVE_OGGVORBIS */
|
||||||
|
|
||||||
InputPlugin oggvorbisPlugin = {
|
InputPlugin oggvorbisPlugin = {
|
||||||
NULL,
|
NULL,
|
||||||
@ -439,4 +439,4 @@ InputPlugin oggvorbisPlugin = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HAVE_OGGVORBIS */
|
#endif /* HAVE_OGGVORBIS */
|
||||||
|
@ -434,7 +434,7 @@ static int initHTTPConnection(InputStream * inStream)
|
|||||||
}
|
}
|
||||||
|
|
||||||
freeaddrinfo(ans);
|
freeaddrinfo(ans);
|
||||||
return -1; /* failed */
|
return -1; /* failed */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int finishHTTPInit(InputStream * inStream)
|
static int finishHTTPInit(InputStream * inStream)
|
||||||
@ -481,7 +481,7 @@ static int finishHTTPInit(InputStream * inStream)
|
|||||||
/*"Connection: close\r\n" */
|
/*"Connection: close\r\n" */
|
||||||
"User-Agent: %s/%s\r\n"
|
"User-Agent: %s/%s\r\n"
|
||||||
/*"Range: bytes=%ld-\r\n" */
|
/*"Range: bytes=%ld-\r\n" */
|
||||||
"%s" /* authorization */
|
"%s" /* authorization */
|
||||||
"Icy-Metadata:1\r\n"
|
"Icy-Metadata:1\r\n"
|
||||||
"\r\n", data->path, data->host, PACKAGE_NAME, PACKAGE_VERSION,
|
"\r\n", data->path, data->host, PACKAGE_NAME, PACKAGE_VERSION,
|
||||||
/*inStream->offset, */
|
/*inStream->offset, */
|
||||||
@ -672,7 +672,7 @@ static int getHTTPHello(InputStream * inStream)
|
|||||||
if (inStream->size <= 0)
|
if (inStream->size <= 0)
|
||||||
inStream->seekable = 0;
|
inStream->seekable = 0;
|
||||||
|
|
||||||
needle += 4; /* 4 == strlen("\r\n\r\n") */
|
needle += 4; /* 4 == strlen("\r\n\r\n") */
|
||||||
data->buflen -= (needle - data->buffer);
|
data->buflen -= (needle - data->buffer);
|
||||||
/*fwrite(data->buffer, 1, data->buflen, stdout); */
|
/*fwrite(data->buffer, 1, data->buflen, stdout); */
|
||||||
memmove(data->buffer, needle, data->buflen);
|
memmove(data->buffer, needle, data->buflen);
|
||||||
|
@ -65,9 +65,9 @@ typedef struct _Interface {
|
|||||||
char buffer[INTERFACE_MAX_BUFFER_LENGTH];
|
char buffer[INTERFACE_MAX_BUFFER_LENGTH];
|
||||||
int bufferLength;
|
int bufferLength;
|
||||||
int bufferPos;
|
int bufferPos;
|
||||||
int fd; /* file descriptor */
|
int fd; /* file descriptor */
|
||||||
FILE *fp; /* file pointer */
|
FILE *fp; /* file pointer */
|
||||||
int open; /* open/used */
|
int open; /* open/used */
|
||||||
int permission;
|
int permission;
|
||||||
time_t lastTime;
|
time_t lastTime;
|
||||||
List *commandList; /* for when in list mode */
|
List *commandList; /* for when in list mode */
|
||||||
@ -75,9 +75,9 @@ typedef struct _Interface {
|
|||||||
size_t commandListSize; /* mem commandList consumes */
|
size_t commandListSize; /* mem commandList consumes */
|
||||||
List *bufferList; /* for output if client is slow */
|
List *bufferList; /* for output if client is slow */
|
||||||
size_t outputBufferSize; /* mem bufferList consumes */
|
size_t outputBufferSize; /* mem bufferList consumes */
|
||||||
int expired; /* set whether this interface should be closed on next
|
int expired; /* set whether this interface should be closed on next
|
||||||
check of old interfaces */
|
check of old interfaces */
|
||||||
int num; /* interface number */
|
int num; /* interface number */
|
||||||
char *outBuffer;
|
char *outBuffer;
|
||||||
int outBuflen;
|
int outBuflen;
|
||||||
int outBufSize;
|
int outBufSize;
|
||||||
|
@ -107,7 +107,7 @@ static int setenv(const char *name, const char *value, int replace)
|
|||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SETENV */
|
#endif /* HAVE_SETENV */
|
||||||
|
|
||||||
static void usage(char *argv[])
|
static void usage(char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -1071,7 +1071,11 @@ void playPlaylistIfPlayerStopped(void)
|
|||||||
else
|
else
|
||||||
playlist_errorCount++;
|
playlist_errorCount++;
|
||||||
|
|
||||||
if (playlist_state == PLAYLIST_STATE_PLAY && ((playlist_stopOnError && error != PLAYER_ERROR_NOERROR) || error == PLAYER_ERROR_AUDIO || error == PLAYER_ERROR_SYSTEM || playlist_errorCount >= playlist.length)) {
|
if (playlist_state == PLAYLIST_STATE_PLAY
|
||||||
|
&& ((playlist_stopOnError && error != PLAYER_ERROR_NOERROR)
|
||||||
|
|| error == PLAYER_ERROR_AUDIO
|
||||||
|
|| error == PLAYER_ERROR_SYSTEM
|
||||||
|
|| playlist_errorCount >= playlist.length)) {
|
||||||
stopPlaylist(stderr);
|
stopPlaylist(stderr);
|
||||||
} else if (playlist_noGoToNext)
|
} else if (playlist_noGoToNext)
|
||||||
currentSongInPlaylist(stderr);
|
currentSongInPlaylist(stderr);
|
||||||
|
@ -27,4 +27,4 @@ void signal_unhandle(int sig);
|
|||||||
int signal_is_pending(int sig);
|
int signal_is_pending(int sig);
|
||||||
void signal_clear(int sig);
|
void signal_clear(int sig);
|
||||||
|
|
||||||
#endif /* SIGNAL_CHECK_H */
|
#endif /* SIGNAL_CHECK_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user