On 10/8/13 4:33 PM, Cy Schubert wrote:
In message <52542687.7000...@pix.net>, Kurt Lidl writes:
On 10/8/13, Julian Elischer wrote:
On 10/7/13 11:06 PM, Steve Kargl wrote:
On Sun, Oct 06, 2013 at 10:43:21PM -0400, Eitan Adler wrote:
Hey all,

RCS was removed from the base system in r256095.  If you still want to
use RCS please install either devel/rcs or devel/rcs57.  If not, be
sure to check out the alternatives (pun stolen and intended).

Perhaps, a note in src/UPDATING is appropriate?

ok so what is this, the secret cabal to make FreeBSD useless?
I'm ccing core as I believe this was not discussed enough in public
(in fact not discussed AT ALL in any forum I am watching)
and I officially request a backout of the removal of what I consider
to be core functionality.

My usual way of doing things is on install to ci EVERYTHING in /etc
to get a snapsot right the way back to install.

now I have to change things in /etc (and other places) BEFORE I can
check them in.
(i.e. get networking up and ports installed)
not a big thing but I believe that a lot of poeple use ci/co on /etc
becasue it is "just there"


+1 for keeping a RCS in base.  I too use to maintain a bunch of
files in /etc - I have for years and years.  I don't particularly
want the GPL'd version - I'd be happiest with the OpenRCS version
(BSD-licensed) from OpenBSD.

I've started work on a port (not that this was my highest priority but
received a private email that I may want to do this instead of rcs57).
Would the majority here rather have it in base? Just finished schlepping
the OpenBSD source to my laptop (the link to the OpenRCS site returns a TCP
RST). I don't mind either way. It's the groups's and the Project's call.


I did the same thing this afternoon.  I grabbed the latest rcs sources
from the OpenBSD CVS server, and did a quick and dirty port to
FreeBSD.  There are some minor formatting diffs in the output of
'rlog', for example.

Diff should be attached (well, stripped from the mailing list, but still
available through the web interface to the mailing list).

-Kurt



diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,9 @@ LINKS=        ${BINDIR}/rcs ${BINDIR}/ci ${BIND
        ${BINDIR}/rcs ${BINDIR}/rcsclean ${BINDIR}/rcs ${BINDIR}/rcsdiff \
        ${BINDIR}/rcs ${BINDIR}/rcsmerge ${BINDIR}/rcs ${BINDIR}/rlog
 
 CPPFLAGS+=-I${.CURDIR}
-CFLAGS+=-Wall
+CFLAGS+=-Wall -I${.CURDIR}
 CFLAGS+=-Wstrict-prototypes -Wmissing-prototypes
 CFLAGS+=-Wmissing-declarations
 CFLAGS+=-Wshadow -Wpointer-arith -Wcast-qual
 CFLAGS+=-Wsign-compare
diff --git a/ci.c b/ci.c
--- a/ci.c
+++ b/ci.c
@@ -909,9 +909,9 @@ checkin_keywordscan(BUF *data, RCSNUM **
                buf_append(buf, start, len);
 
                /* XXX - Not binary safe. */
                buf_putc(buf, '\0');
-               checkin_parsekeyword(buf_get(buf), rev, date, author, state);
+               checkin_parsekeyword((char *)buf_get(buf), rev, date, author, 
state);
                buf_free(buf);
 loopend:;
        }
        if (kwstr == NULL)
diff --git a/date.y b/date.y
--- a/date.y
+++ b/date.y
@@ -13,9 +13,9 @@
 */
 /* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */
 /* SUPPRESS 288 on yyerrlab *//* Label unused */
 
-#include <sys/timeb.h>
+/* #include <sys/timeb.h> */
 
 #include <ctype.h>
 #include <err.h>
 #include <string.h>
diff --git a/diff.c b/diff.c
--- a/diff.c
+++ b/diff.c
@@ -426,10 +426,10 @@ files_differ(FILE *f1, FILE *f2)
 static void
 prepare(int i, FILE *fd, off_t filesize, int flags)
 {
        struct line *p;
-       int j, h;
-       size_t sz;
+       int h;
+       size_t j, sz;
 
        rewind(fd);
 
        sz = (filesize <= SIZE_MAX ? filesize : SIZE_MAX) / 25;
@@ -1141,9 +1141,9 @@ asciifile(FILE *f)
        cnt = fread(buf, 1, sizeof(buf), f);
        return (memchr(buf, '\0', cnt) == NULL);
 }
 
-#define begins_with(s, pre) (strncmp(s, pre, sizeof(pre)-1) == 0)
+#define begins_with(s, pre) (strncmp((const char *)s, pre, sizeof(pre)-1) == 0)
 
 static char *
 match_function(const long *f, int pos, FILE *fp)
 {
@@ -1160,9 +1160,9 @@ match_function(const long *f, int pos, F
                        nc = sizeof(buf) - 1;
                nc = fread(buf, 1, nc, fp);
                if (nc > 0) {
                        buf[nc] = '\0';
-                       buf[strcspn(buf, "\n")] = '\0';
+                       buf[strcspn((const char *)buf, "\n")] = '\0';
                        if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') {
                                if (begins_with(buf, "private:")) {
                                        if (!state)
                                                state = " (private)";
@@ -1172,9 +1172,9 @@ match_function(const long *f, int pos, F
                                } else if (begins_with(buf, "public:")) {
                                        if (!state)
                                                state = " (public)";
                                } else {
-                                       if (strlcpy(lastbuf, buf,
+                                       if (strlcpy(lastbuf, (const char *)buf,
                                            sizeof(lastbuf)) >= sizeof(lastbuf))
                                                errx(1,
                                                    "match_function: strlcpy");
                                        lastmatchline = pos;
diff --git a/diff3.c b/diff3.c
--- a/diff3.c
+++ b/diff3.c
@@ -455,9 +455,9 @@ ed_patch_lines(struct rcs_lines *dlines,
                lp->l_line[lp->l_len - 1] = '\0';
 
                /* len - 1 is NUL terminator so we use len - 2 for 'op' */
                op = lp->l_line[lp->l_len - 2];
-               start = (int)strtol(lp->l_line, &ep, 10);
+               start = (int)strtol((const char *)lp->l_line, &ep, 10);
 
                /* Restore the last byte of the buffer */
                lp->l_line[lp->l_len - 1] = tmp;
 
@@ -896,9 +896,10 @@ edit(struct diff *diff, int fdup, int j)
 /* regurgitate */
 static int
 edscript(int n)
 {
-       int j, k;
+       int k;
+       size_t j;
        char block[BUFSIZ+1];
 
        for (; n > 0; n--) {
                if (!oflag || !overlap[n])
diff --git a/rcs.c b/rcs.c
--- a/rcs.c
+++ b/rcs.c
@@ -802,9 +802,9 @@ rcs_patch_lines(struct rcs_lines *dlines
                op = *(lp->l_line);
                /* NUL-terminate line buffer for strtol() safety. */
                tmp = lp->l_line[lp->l_len - 1];
                lp->l_line[lp->l_len - 1] = '\0';
-               lineno = (int)strtol((lp->l_line + 1), &ep, 10);
+               lineno = (int)strtol((const char *)(lp->l_line + 1), &ep, 10);
                if (lineno > dlines->l_nblines || lineno < 0 ||
                    *ep != ' ')
                        errx(1, "invalid line specification in RCS patch");
                ep++;
@@ -1050,9 +1050,9 @@ rcs_delta_stats(struct rcs_delta *rdp, i
                        op = *(lp->l_line);
                        /* NUL-terminate line buffer for strtol() safety. */
                        tmp = lp->l_line[lp->l_len - 1];
                        lp->l_line[lp->l_len - 1] = '\0';
-                       (void)strtol((lp->l_line + 1), &ep, 10);
+                       (void)strtol((const char *)(lp->l_line + 1), &ep, 10);
                        ep++;
                        nbln = (int)strtol(ep, &ep, 10);
                        /* Restore the last byte of the buffer */
                        lp->l_line[lp->l_len - 1] = tmp;
diff --git a/rcs.h b/rcs.h
--- a/rcs.h
+++ b/rcs.h
@@ -29,8 +29,9 @@
 
 #include <sys/queue.h>
 
 #include <stdio.h>
+#include <time.h>
 
 #include "buf.h"
 
 #define RCS_DIFF_MAXARG                32
diff --git a/rcsparse.c b/rcsparse.c
--- a/rcsparse.c
+++ b/rcsparse.c
@@ -29,8 +29,13 @@
 #include "rcs.h"
 #include "rcsparse.h"
 #include "xmalloc.h"
 
+#if !defined(_PW_NAME_LEN)
+#include <sys/param.h>
+#define _PW_NAME_LEN (MAXLOGNAME-1)
+#endif
+
 #define RCS_BUFSIZE    16384
 #define RCS_BUFEXTSIZE 8192
 
 /* RCS token types */
@@ -602,9 +607,9 @@ rcsparse_text(RCSFILE *rfp, struct rcs_p
                return (1);
 
        pdp->rp_delta->rd_tlen = pdp->rp_tlen - 1;
        if (pdp->rp_delta->rd_tlen == 0) {
-               pdp->rp_delta->rd_text = xstrdup("");
+               pdp->rp_delta->rd_text = (u_char *) xstrdup("");
        } else {
                pdp->rp_delta->rd_text = xmalloc(pdp->rp_delta->rd_tlen);
                memcpy(pdp->rp_delta->rd_text, pdp->rp_buf,
                    pdp->rp_delta->rd_tlen);
@@ -1219,9 +1224,9 @@ valid_login(char *login_name)
        /* The first character cannot be a hyphen */
        if (*login_name == '-')
                return 0;
 
-       for (cp = login_name ; *cp ; cp++) {
+       for (cp = (u_char *)login_name ; *cp ; cp++) {
                /* We allow '$' as the last character for samba */
                if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-' &&
                    !(*cp == '$' && *(cp + 1) == '\0')) {
                        return 0;
@@ -1237,9 +1242,9 @@ valid_commitid(char *commitid)
 {
        unsigned char *cp;
 
        /* A-Za-z0-9 */
-       for (cp = commitid; *cp ; cp++) {
+       for (cp = (u_char *)commitid; *cp ; cp++) {
                if (!isalnum(*cp))
                        return 0;
        }
        if ((char *)cp - commitid > RCS_COMMITID_MAXLEN)
diff --git a/rlog.c b/rlog.c
--- a/rlog.c
+++ b/rlog.c
@@ -340,9 +340,9 @@ rlog_select_daterev(RCSFILE *rcsfile, ch
 static void
 rlog_file(const char *fname, RCSFILE *file)
 {
        char numb[RCS_REV_BUFSZ];
-       u_int nrev;
+       int nrev;
        struct rcs_sym *sym;
        struct rcs_access *acp;
        struct rcs_delta *rdp;
        struct rcs_lock *lkp;
@@ -355,10 +355,14 @@ rlog_file(const char *fname, RCSFILE *fi
                        errx(1, "invalid date: %s", rlog_dates);
        } else
                nrev = file->rf_ndelta;
 
+#if 0
        if ((workfile = basename(fname)) == NULL)
                err(1, "basename");
+#else
+       workfile = (char *)fname;
+#endif
 
        /*
         * In case they specified 'foo,v' as argument.
         */
diff --git a/xmalloc.c b/xmalloc.c
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -21,8 +21,12 @@
 #include <string.h>
 
 #include "xmalloc.h"
 
+#if !defined(u_long)
+#define u_long unsigned long
+#endif
+
 void *
 xmalloc(size_t size)
 {
        void *ptr;
diff --git a/xmalloc.h b/xmalloc.h
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -18,8 +18,13 @@
 
 #ifndef XMALLOC_H
 #define XMALLOC_H
 
+#if !defined(SIZE_MAX)
+#include <sys/limits.h>
+#define SIZE_MAX OFF_MAX
+#endif
+
 void   *xmalloc(size_t);
 void   *xcalloc(size_t, size_t);
 void   *xrealloc(void *, size_t, size_t);
 void     xfree(void *);
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to