1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

WARNS=2 fixup (mostly. Some are Hard To Fix(tm), so NO_WERROR is set)

Use __FBSDID().
Sort some headers.
This commit is contained in:
Mark Murray 2001-12-02 22:44:14 +00:00
parent f1b6a5418e
commit 9e1e9c4421
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87235
7 changed files with 67 additions and 55 deletions

View File

@ -3,7 +3,8 @@
PROG= calendar
SRCS= calendar.c io.c day.c ostern.c paskha.c
CFLAGS+= -Wall
WARNS?= 2
NO_WERROR= yes
INTER= de_DE.ISO8859-1 hr_HR.ISO8859-2 ru_RU.KOI8-R
DE_LINKS= de_DE.ISO_8859-1 de_DE.ISO8859-15 de_DE.ISO_8859-15
HR_LINKS= hr_HR.ISO_8859-2

View File

@ -29,19 +29,21 @@
* 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$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#endif
#ifndef lint
static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
#endif /* not lint */
#endif
#include <err.h>
#include <errno.h>

View File

@ -38,7 +38,7 @@ extern struct passwd *pw;
extern int doall;
extern struct iovec header[];
extern struct tm *tp;
extern char *calendarFile;
extern const char *calendarFile;
extern char *optarg;
void cal __P((void));

View File

@ -29,21 +29,22 @@
* 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$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/uio.h>
#include <ctype.h>
#include <err.h>
#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include <sys/uio.h>
#include <string.h>
#include <stdlib.h>
#include <err.h>
#include <string.h>
#include <string.h>
#include <time.h>
#include "pathnames.h"
#include "calendar.h"
@ -59,11 +60,11 @@ int daytab[][14] = {
{ 0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
};
static char *days[] = {
static char const *days[] = {
"sun", "mon", "tue", "wed", "thu", "fri", "sat", NULL,
};
static char *months[] = {
static const char *months[] = {
"jan", "feb", "mar", "apr", "may", "jun",
"jul", "aug", "sep", "oct", "nov", "dec", NULL,
};
@ -391,9 +392,9 @@ isnow(endp, monthp, dayp, varp)
int
getmonth(s)
register char *s;
char *s;
{
register char **p;
const char **p;
struct fixs *n;
for (n = fnmonths; n->name; ++n)
@ -411,9 +412,9 @@ getmonth(s)
int
getday(s)
register char *s;
char *s;
{
register char **p;
const char **p;
struct fixs *n;
for (n = fndays; n->name; ++n)
@ -435,24 +436,24 @@ getday(s)
*/
int
getdayvar(s)
register char *s;
char *s;
{
register int offset;
int offs;
offset = strlen(s);
offs = strlen(s);
/* Sun+1 or Wednesday-2
* ^ ^ */
/* fprintf(stderr, "x: %s %s %d\n", s, s + offset - 2, offset); */
switch(*(s + offset - 2)) {
/* fprintf(stderr, "x: %s %s %d\n", s, s + offs - 2, offs); */
switch(*(s + offs - 2)) {
case '-':
return(-(atoi(s + offset - 1)));
return(-(atoi(s + offs - 1)));
break;
case '+':
return(atoi(s + offset - 1));
return(atoi(s + offs - 1));
break;
}
@ -462,15 +463,15 @@ getdayvar(s)
*/
/* last */
if (offset > 4 && !strcasecmp(s + offset - 4, "last"))
if (offs > 4 && !strcasecmp(s + offs - 4, "last"))
return(-1);
else if (offset > 5 && !strcasecmp(s + offset - 5, "first"))
else if (offs > 5 && !strcasecmp(s + offs - 5, "first"))
return(+1);
else if (offset > 6 && !strcasecmp(s + offset - 6, "second"))
else if (offs > 6 && !strcasecmp(s + offs - 6, "second"))
return(+2);
else if (offset > 5 && !strcasecmp(s + offset - 5, "third"))
else if (offs > 5 && !strcasecmp(s + offs - 5, "third"))
return(+3);
else if (offset > 6 && !strcasecmp(s + offset - 6, "fourth"))
else if (offs > 6 && !strcasecmp(s + offs - 6, "fourth"))
return(+4);

View File

@ -29,44 +29,46 @@
* 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$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#endif
#ifndef lint
static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
#endif /* not lint */
#endif
#include <sys/param.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/wait.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <langinfo.h>
#include <locale.h>
#include <string.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <stdlib.h>
#include <pwd.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "pathnames.h"
#include "calendar.h"
char *calendarFile = "calendar"; /* default calendar file */
char *calendarHome = ".calendar"; /* HOME */
char *calendarNoMail = "nomail"; /* don't sent mail if this file exist */
const char *calendarFile = "calendar"; /* default calendar file */
const char *calendarHome = ".calendar"; /* HOME */
const char *calendarNoMail = "nomail"; /* don't sent mail if this file exist */
struct fixs neaster, npaskha;
@ -84,8 +86,8 @@ struct iovec header[] = {
void
cal()
{
register int printing;
register char *p;
int printing;
char *p;
FILE *fp;
int ch, l;
int month;

View File

@ -22,10 +22,12 @@
* 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$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -76,7 +78,7 @@ geteaster(s, year)
char *s;
int year;
{
register int offset = 0;
int offset = 0;
extern struct fixs neaster;
#define EASTER "easter"

View File

@ -22,10 +22,12 @@
* 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$
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -36,6 +38,8 @@
#define PASKHA "paskha"
#define PASKHALEN (sizeof(PASKHA) - 1)
static int paskha (int);
/* return year day for Orthodox Easter using Gauss formula */
/* (old style result) */