WARNS=2 fixup.

This commit is contained in:
Mark Murray 2001-12-02 12:26:18 +00:00
parent 3e9203d750
commit 3ce6c35745
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87208
7 changed files with 24 additions and 18 deletions

View File

@ -3,8 +3,8 @@
.include "${.CURDIR}/Makefile.inc"
PROG= at
CFLAGS+=-Wall
SRCS= at.c panic.c parsetime.c perm.c
WARNS?= 2
LINKS= ${BINDIR}/at ${BINDIR}/atq \
${BINDIR}/at ${BINDIR}/atrm \
${BINDIR}/at ${BINDIR}/batch

View File

@ -98,7 +98,7 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */
/* File scope variables */
char *no_export[] =
const char *no_export[] =
{
"TERM", "TERMCAP", "DISPLAY", "_"
} ;
@ -122,10 +122,11 @@ static void alarmc(int signo);
static char *cwdname(void);
static void writefile(time_t runtimer, char queue);
static void list_jobs(void);
static long nextjob(void);
/* Signal catching functions */
static void sigc(int signo)
static void sigc(int signo __unused)
{
/* If the user presses ^C, remove the spool file and exit
*/
@ -139,7 +140,7 @@ static void sigc(int signo)
_exit(EXIT_FAILURE);
}
static void alarmc(int signo)
static void alarmc(int signo __unused)
{
char buf[1024];
@ -360,7 +361,7 @@ writefile(time_t runtimer, char queue)
eqp = *atenv;
else
{
int i;
size_t i;
for (i=0; i<sizeof(no_export)/sizeof(no_export[0]); i++)
{
export = export
@ -496,7 +497,7 @@ list_jobs()
runtimer = 60*(time_t) ctm;
runtime = *localtime(&runtimer);
strftime(timestr, TIMESIZE, "%X %x", &runtime);
strftime(timestr, TIMESIZE, "%+", &runtime);
if (first) {
printf("Date\t\t\tOwner\tQueue\tJob#\n");
first=0;
@ -601,9 +602,8 @@ main(int argc, char **argv)
char queue_set = 0;
char *pgm;
enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */
int program = AT; /* our default program */
char *options = "q:f:mvldbVc"; /* default options for at */
const char *options = "q:f:mvldbVc";/* default options for at */
int disp_version = 0;
time_t timer;

View File

@ -47,7 +47,7 @@ static const char rcsid[] =
/* Global functions */
void
panic(char *a)
panic(const char *a)
{
/* Something fatal has happened, print error message and exit.
*/
@ -61,7 +61,7 @@ panic(char *a)
}
void
perr(char *a)
perr(const char *a)
{
/* Some operating system error; print error message and exit.
*/

View File

@ -21,6 +21,8 @@
* THEORY OF LIABILITY, WETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifdef __FreeBSD__
@ -31,12 +33,12 @@ void
#ifdef __GNUC__
__NORETURN
#endif
panic(char *a);
panic(const char *a);
void
#ifdef __GNUC__
__NORETURN
#endif
perr(char *a);
perr(const char *a);
void
#ifdef __GNUC__
__NORETURN

View File

@ -57,6 +57,7 @@ static const char rcsid[] =
#include "at.h"
#include "panic.h"
#include "parsetime.h"
/* Structures and unions */
@ -74,7 +75,7 @@ enum { /* symbols */
/* parse translation table - table driven parsers can be your FRIEND!
*/
struct {
char *name; /* token name */
const char *name; /* token name */
int value; /* token id */
int plural; /* is this plural? */
} Specials[] = {
@ -159,7 +160,7 @@ static int sc_tokplur; /* scanner - is token plural? */
static int
parse_token(char *arg)
{
int i;
size_t i;
for (i=0; i<(sizeof Specials/sizeof Specials[0]); i++)
if (strcasecmp(Specials[i].name, arg) == 0) {
@ -193,7 +194,7 @@ init_scanner(int argc, char **argv)
* token() fetches a token from the input stream
*/
static int
token()
token(void)
{
int idx;

View File

@ -42,8 +42,9 @@ static const char rcsid[] =
/* Local headers */
#include "privs.h"
#include "at.h"
#include "perm.h"
#include "privs.h"
/* Macros */
@ -81,7 +82,7 @@ static int check_for_user(FILE *fp,const char *name)
return found;
}
/* Global functions */
int check_permission()
int check_permission(void)
{
FILE *fp;
uid_t uid = geteuid();

View File

@ -21,6 +21,8 @@
* THEORY OF LIABILITY, WETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
*/
int check_permission();
int check_permission(void);