Skip to content

Commit

Permalink
whitespace fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
abrasive committed May 13, 2013
1 parent d5b17e2 commit 98da1d2
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
OTHER DEALINGS IN THE SOFTWARE.
4 changes: 2 additions & 2 deletions audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ static audio_output *outputs[] = {
&audio_dummy,
NULL
};


audio_output *audio_get_output(char *name) {
audio_output **out;

// default to the first
if (!name)
return outputs[0];
Expand Down
4 changes: 2 additions & 2 deletions audio_dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ static void play(short buf[], int samples) {
// this is all a bit expensive but it's long-term stable.
gettimeofday(&tv, NULL);

long long nowtime = tv.tv_usec + 1e6*tv.tv_sec;
long long nowtime = tv.tv_usec + 1e6*tv.tv_sec;

if (!starttime)
starttime = nowtime;

samples_played += samples;

long long finishtime = starttime + samples_played * 1e6 / Fs;
Expand Down
4 changes: 2 additions & 2 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ uint8_t *base64_dec(char *input, int *outlen) {
while (inlen++ & 3)
BIO_write(bmem, "=", 1);
BIO_flush(bmem);

int bufsize = strlen(input)*3/4 + 1;
uint8_t *buf = malloc(bufsize);
int nread;
Expand All @@ -115,7 +115,7 @@ uint8_t *base64_dec(char *input, int *outlen) {
return buf;
}

static char super_secret_key[] =
static char super_secret_key[] =
"-----BEGIN RSA PRIVATE KEY-----\n"
"MIIEpQIBAAKCAQEA59dE8qLieItsH1WgjrcFRKj6eUWqi+bGLOX1HL3U3GhC/j0Qg90u3sG/1CUt\n"
"wC5vOYvfDmFI6oSFXi5ELabWJmT2dKHzBJKa3k9ok+8t9ucRqMd6DZHJ2YCCLlDRKSKv6kDqnw4U\n"
Expand Down
1 change: 1 addition & 0 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ typedef struct {
audio_output *output;
int buffer_start_fill;
int daemonise;
int mdns_internal;
} shairport_cfg;

extern int debuglev;
Expand Down
2 changes: 1 addition & 1 deletion mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void mdns_register(void) {

if ((mdns_pid = fork()))
return;

char *mdns_apname = malloc(strlen(config.apname) + 14);
char *p = mdns_apname;
int i;
Expand Down
2 changes: 1 addition & 1 deletion rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int rtp_setup(SOCKADDR *remote, int cport, int tport) {

// we do our own timing and ignore the timing port.
// an audio perfectionist may wish to learn the protocol.

memcpy(&rtp_client, remote, sizeof(rtp_client));
#ifdef AF_INET6
if (rtp_client.SAFAMILY == AF_INET6) {
Expand Down
22 changes: 11 additions & 11 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ typedef struct {

static rtsp_message * msg_init(void) {
rtsp_message *msg = malloc(sizeof(rtsp_message));
memset(msg, 0, sizeof(rtsp_message));
memset(msg, 0, sizeof(rtsp_message));
return msg;
}

Expand Down Expand Up @@ -179,7 +179,7 @@ static int msg_handle_line(rtsp_message **pmsg, char *line) {
p = strtok_r(NULL, " ", &sp);
if (!p)
goto fail;

p = strtok_r(NULL, " ", &sp);
if (!p)
goto fail;
Expand Down Expand Up @@ -221,7 +221,7 @@ static rtsp_message * rtsp_read_request(int fd) {

rtsp_message *msg = NULL;

ssize_t nread;
ssize_t nread;
ssize_t inbuf = 0;
int msg_size = -1;

Expand Down Expand Up @@ -426,7 +426,7 @@ static void handle_announce(rtsp_conn_info *conn,

if (!strncmp(cp, "a=rsaaeskey:", 12))
prsaaeskey = cp+12;

cp = next;
}

Expand Down Expand Up @@ -455,7 +455,7 @@ static void handle_announce(rtsp_conn_info *conn,
}
memcpy(conn->stream.aeskey, aeskey, 16);
free(aeskey);

int i;
for (i=0; i<sizeof(conn->stream.fmtp)/sizeof(conn->stream.fmtp[0]); i++)
conn->stream.fmtp[i] = atoi(strsep(&pfmtp, " \t"));
Expand Down Expand Up @@ -503,7 +503,7 @@ static void apple_challenge(int fd, rtsp_message *req, rtsp_message *resp) {
memcpy(bp, chall, chall_len);
free(chall);
bp += chall_len;

#ifdef AF_INET6
if (fdsa.SAFAMILY == AF_INET6) {
struct sockaddr_in6 *sa6 = (struct sockaddr_in6*)(&fdsa);
Expand Down Expand Up @@ -560,7 +560,7 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) {
char *hdr = msg_get_header(req, "Authorization");
if (!hdr || strncmp(hdr, "Digest ", 7))
goto authenticate;

char *realm = strstr(hdr, "realm=\"");
char *username = strstr(hdr, "username=\"");
char *response = strstr(hdr, "response=\"");
Expand Down Expand Up @@ -646,7 +646,7 @@ static void *rtsp_conversation_thread_func(void *vfd) {

int fd = *(int*)vfd;
socklen_t slen = sizeof(conn.remote);

fd = accept(fd, (struct sockaddr *)&conn.remote, &slen);
if (fd < 0) {
perror("failed to accept connection");
Expand All @@ -667,7 +667,7 @@ static void *rtsp_conversation_thread_func(void *vfd) {

if (rtsp_auth(&auth_nonce, req, resp))
goto respond;

struct method_handler *mh;
for (mh=method_handlers; mh->method; mh++) {
if (!strcmp(mh->method, req->method)) {
Expand All @@ -680,7 +680,7 @@ static void *rtsp_conversation_thread_func(void *vfd) {
msg_write_response(fd, resp);
msg_free(req);
msg_free(resp);
}
}

shutdown:
if (fd > 0)
Expand Down Expand Up @@ -731,7 +731,7 @@ void rtsp_listen_loop(void) {
if (ret) {
die("getaddrinfo failed: %s\n", gai_strerror(ret));
}

for (p=info; p; p=p->ai_next) {
int fd = socket(p->ai_family, p->ai_socktype, IPPROTO_TCP);
int yes = 1;
Expand Down
4 changes: 2 additions & 2 deletions shairport.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void signal_setup(void) {
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = &sig_ignore;
sigaction(SIGUSR1, &sa, NULL);

sa.sa_sigaction = &sig_shutdown;
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
Expand All @@ -144,7 +144,7 @@ int main(int argc, char **argv) {
snprintf(config.apname, 20 + 100, "Shairport on %s", hostname);

int audio_arg = parse_options(argc, argv);

config.output = audio_get_output(config.output_name);
if (!config.output) {
audio_ls_outputs();
Expand Down

0 comments on commit 98da1d2

Please sign in to comment.