Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin static + __dead
details: https://anonhg.NetBSD.org/src/rev/361fa5fc4130
branches: trunk
changeset: 768948:361fa5fc4130
user: joerg <joerg%NetBSD.org@localhost>
date: Mon Aug 29 13:47:16 2011 +0000
description:
static + __dead
diffstat:
usr.bin/bthset/bthset.c | 93 ++++++++++++++++++++++++------------------------
usr.bin/btpin/btpin.c | 9 ++--
2 files changed, 50 insertions(+), 52 deletions(-)
diffs (250 lines):
diff -r 139de06121d2 -r 361fa5fc4130 usr.bin/bthset/bthset.c
--- a/usr.bin/bthset/bthset.c Mon Aug 29 13:42:53 2011 +0000
+++ b/usr.bin/bthset/bthset.c Mon Aug 29 13:47:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bthset.c,v 1.6 2011/08/25 16:19:23 joerg Exp $ */
+/* $NetBSD: bthset.c,v 1.7 2011/08/29 13:47:16 joerg Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2006 Itronix, Inc. All rights reserved.");
-__RCSID("$NetBSD: bthset.c,v 1.6 2011/08/25 16:19:23 joerg Exp $");
+__RCSID("$NetBSD: bthset.c,v 1.7 2011/08/29 13:47:16 joerg Exp $");
#include <sys/types.h>
#include <sys/audioio.h>
@@ -62,45 +62,44 @@
#define RING_INTERVAL 5 /* seconds */
-int main(int, char *[]);
-void usage(void);
+__dead static void usage(void);
-void do_signal(int, short, void *);
-void do_ring(int, short, void *);
-void do_mixer(int, short, void *);
-void do_rfcomm(int, short, void *);
-void do_server(int, short, void *);
-int send_rfcomm(const char *, ...);
+static void do_signal(int, short, void *);
+static void do_ring(int, short, void *);
+static void do_mixer(int, short, void *);
+static void do_rfcomm(int, short, void *);
+static void do_server(int, short, void *);
+static int send_rfcomm(const char *, ...);
-int init_mixer(struct btsco_info *, const char *);
-int init_rfcomm(struct btsco_info *);
-int init_server(struct btsco_info *, int);
+static int init_mixer(struct btsco_info *, const char *);
+static int init_rfcomm(struct btsco_info *);
+static int init_server(struct btsco_info *, int);
-void remove_pid(void);
-int write_pid(void);
+static void remove_pid(void);
+static int write_pid(void);
-struct event sigint_ev; /* bye bye */
-struct event sigusr1_ev; /* start ringing */
-struct event sigusr2_ev; /* stop ringing */
-struct event mixer_ev; /* mixer changed */
-struct event rfcomm_ev; /* headset speaks */
-struct event server_ev; /* headset connecting */
-struct event ring_ev; /* ring timer */
+static struct event sigint_ev; /* bye bye */
+static struct event sigusr1_ev; /* start ringing */
+static struct event sigusr2_ev; /* stop ringing */
+static struct event mixer_ev; /* mixer changed */
+static struct event rfcomm_ev; /* headset speaks */
+static struct event server_ev; /* headset connecting */
+static struct event ring_ev; /* ring timer */
-mixer_ctrl_t vgs; /* speaker control */
-mixer_ctrl_t vgm; /* mic control */
-int ringing; /* we are ringing */
-int verbose; /* copy to stdout */
-int mx; /* mixer fd */
-int rf; /* rfcomm connection fd */
-int ag; /* rfcomm gateway fd */
-sdp_session_t ss; /* SDP server session */
+static mixer_ctrl_t vgs; /* speaker control */
+static mixer_ctrl_t vgm; /* mic control */
+static int ringing; /* we are ringing */
+static int verbose; /* copy to stdout */
+static int mx; /* mixer fd */
+static int rf; /* rfcomm connection fd */
+static int ag; /* rfcomm gateway fd */
+static sdp_session_t ss; /* SDP server session */
-char *command; /* answer command */
-char *pidfile; /* PID file name */
+static char *command; /* answer command */
+static char *pidfile; /* PID file name */
/* Headset Audio Gateway service record */
-uint8_t hset_data[] = {
+static uint8_t hset_data[] = {
0x09, 0x00, 0x00, // uint16 ServiceRecordHandle
0x0a, 0x00, 0x00, 0x00, // uint32 0x00000000
0x00,
@@ -141,8 +140,8 @@
0x77, 0x61, 0x79
};
-sdp_data_t hset_record = { hset_data + 0, hset_data + 91 };
-sdp_data_t hset_channel = { hset_data + 36, hset_data + 37 };
+static sdp_data_t hset_record = { hset_data + 0, hset_data + 91 };
+static sdp_data_t hset_channel = { hset_data + 36, hset_data + 37 };
int
main(int ac, char *av[])
@@ -239,7 +238,7 @@
err(EXIT_FAILURE, "event_dispatch");
}
-void
+static void
usage(void)
{
@@ -257,7 +256,7 @@
exit(EXIT_FAILURE);
}
-void
+static void
do_signal(int s, short ev, void *arg)
{
@@ -277,7 +276,7 @@
}
}
-void
+static void
do_ring(int s, short ev, void *arg)
{
static struct timeval tv = { RING_INTERVAL, 0 };
@@ -293,7 +292,7 @@
* The mixer device has been twiddled. We check mic and speaker
* settings and send the appropriate commands to the headset,
*/
-void
+static void
do_mixer(int s, short ev, void *arg)
{
mixer_ctrl_t mc;
@@ -325,7 +324,7 @@
/*
* RFCOMM socket event.
*/
-void
+static void
do_rfcomm(int fd, short ev, void *arg)
{
char buf[128];
@@ -392,7 +391,7 @@
/*
* got an incoming connection on the AG socket.
*/
-void
+static void
do_server(int fd, short ev, void *arg)
{
bdaddr_t *raddr = arg;
@@ -425,7 +424,7 @@
/*
* send a message to the RFCOMM socket
*/
-int
+static int
send_rfcomm(const char *msg, ...)
{
struct iovec iov[3];
@@ -453,7 +452,7 @@
/*
* Initialise mixer event
*/
-int
+static int
init_mixer(struct btsco_info *info, const char *mixer)
{
@@ -489,7 +488,7 @@
/*
* Initialise RFCOMM socket
*/
-int
+static int
init_rfcomm(struct btsco_info *info)
{
struct sockaddr_bt addr;
@@ -522,7 +521,7 @@
/*
* Initialise server socket
*/
-int
+static int
init_server(struct btsco_info *info, int channel)
{
struct sockaddr_bt addr;
@@ -561,7 +560,7 @@
return 0;
}
-void
+static void
remove_pid(void)
{
@@ -571,7 +570,7 @@
unlink(pidfile);
}
-int
+static int
write_pid(void)
{
char *buf;
diff -r 139de06121d2 -r 361fa5fc4130 usr.bin/btpin/btpin.c
--- a/usr.bin/btpin/btpin.c Mon Aug 29 13:42:53 2011 +0000
+++ b/usr.bin/btpin/btpin.c Mon Aug 29 13:47:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: btpin.c,v 1.5 2009/05/16 07:18:42 plunky Exp $ */
+/* $NetBSD: btpin.c,v 1.6 2011/08/29 13:50:13 joerg Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2006 Itronix, Inc. All rights reserved.");
-__RCSID("$NetBSD: btpin.c,v 1.5 2009/05/16 07:18:42 plunky Exp $");
+__RCSID("$NetBSD: btpin.c,v 1.6 2011/08/29 13:50:13 joerg Exp $");
#include <sys/types.h>
#include <sys/un.h>
@@ -45,8 +45,7 @@
#include <time.h>
#include <unistd.h>
-int main(int, char *[]);
-void usage(void);
+__dead static void usage(void);
int
main(int ac, char *av[])
@@ -183,7 +182,7 @@
exit(EXIT_SUCCESS);
}
-void
+static void
usage(void)
{
Home |
Main Index |
Thread Index |
Old Index