From a83a20f685cea0b6f02a2c83381e3d391b2657fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 6 Dec 2007 20:40:24 +0000 Subject: [PATCH] * Made cal.c compile, and fixed warnings. * Added it to the build, and the image. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23068 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/HaikuImage | 6 +++--- src/bin/Jamfile | 1 + src/bin/cal.c | 30 +++++++++++------------------- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index 03a04c9e80..48de00f2c1 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -23,9 +23,9 @@ if $(INCLUDE_GPL_ADDONS) = 1 { GPL_ONLY = "" ; } -BEOS_BIN = "[" addattr alert arp base64 basename bc beep bison bzip2 cat catattr - chgrp chmod chop chown cksum clear clockconfig cmp comm compress cp copyattr - $(X86_ONLY)CortexAddOnHost +BEOS_BIN = "[" addattr alert arp base64 basename bc beep bison bzip2 cal cat + catattr chgrp chmod chop chown cksum clear clockconfig cmp comm compress + cp copyattr $(X86_ONLY)CortexAddOnHost csplit ctags cut date dc dd desklink df diff diff3 dircolors dirname driveinfo dstcheck du echo eject env error expand expr expr factor false fdinfo ffm find finddir fmt fold fortune frcode ftp funzip fwcontrol diff --git a/src/bin/Jamfile b/src/bin/Jamfile index dacf52abee..9653062b03 100644 --- a/src/bin/Jamfile +++ b/src/bin/Jamfile @@ -17,6 +17,7 @@ AddResources hey : hey.rdef ; # standard commands that don't need any additional library StdBinCommands + cal.c catattr.cpp chop.c clear.c diff --git a/src/bin/cal.c b/src/bin/cal.c index f9570add62..21a06ca555 100644 --- a/src/bin/cal.c +++ b/src/bin/cal.c @@ -34,14 +34,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char copyright[] = "@(#) Copyright (c) 1989, 1993, 1994\n\n - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ -#ifndef lint -static char sccsid[] = "@(#)cal.c 8.4 (Berkeley) 4/2/94"; -#endif /* not lint */ - #include #include @@ -96,7 +88,7 @@ char day_headings[] = " "; char j_day_headings[] = " "; /* leap year -- account for gregorian reformation in 1752 */ -#define leap_year(yr) ((yr) <= 1752 ? !((yr) % 4) : !((yr) % 4) && ((yr) % 100) || !((yr) % 400)) +#define leap_year(yr) ((yr) <= 1752 ? !((yr) % 4) : (!((yr) % 4) && ((yr) % 100)) || !((yr) % 400)) /* number of centuries since 1700, not inclusive */ #define centuries_since_1700(yr) ((yr) > 1700 ? (yr) / 100 - 17 : 0) @@ -109,16 +101,16 @@ char j_day_headings[] = " "; int julian; -void ascii_day __P((char *, int)); -void center __P((char *, int, int)); -void day_array __P((int, int, int *)); -int day_in_week __P((int, int, int)); -int day_in_year __P((int, int, int)); -void j_yearly __P((int)); -void monthly __P((int, int)); -void trim_trailing_spaces __P((char *)); -void usage __P((void)); -void yearly __P((int)); +void ascii_day(char *, int); +void center(char *, int, int); +void day_array(int, int, int *); +int day_in_week(int, int, int); +int day_in_year(int, int, int); +void j_yearly(int); +void monthly(int, int); +void trim_trailing_spaces(char *); +void usage(void); +void yearly(int); int main(argc, argv)