From owner-svn-soc-all@FreeBSD.ORG Mon Jul 16 19:29:21 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 28CE61065670 for ; Mon, 16 Jul 2012 19:29:19 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 16 Jul 2012 19:29:19 +0000 Date: Mon, 16 Jul 2012 19:29:19 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120716192919.28CE61065670@hub.freebsd.org> Cc: Subject: socsvn commit: r239480 - in soc2012/jhagewood/sdiff: . sdiff X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2012 19:29:21 -0000 Author: jhagewood Date: Mon Jul 16 19:29:18 2012 New Revision: 239480 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=239480 Log: Fixed some style issues in sdiff Modified: soc2012/jhagewood/sdiff/hagewood-sdiff.patch soc2012/jhagewood/sdiff/sdiff/common.c soc2012/jhagewood/sdiff/sdiff/common.h soc2012/jhagewood/sdiff/sdiff/edit.c soc2012/jhagewood/sdiff/sdiff/sdiff.c Modified: soc2012/jhagewood/sdiff/hagewood-sdiff.patch ============================================================================== --- soc2012/jhagewood/sdiff/hagewood-sdiff.patch Mon Jul 16 19:24:27 2012 (r239479) +++ soc2012/jhagewood/sdiff/hagewood-sdiff.patch Mon Jul 16 19:29:18 2012 (r239480) @@ -1,3 +1,64 @@ +diff -rupN jhagewood/sdiff/sdiff-orig/common.c jhagewood/sdiff/sdiff/common.c +--- jhagewood/sdiff/sdiff-orig/common.c 2012-07-14 03:47:32.000000000 -0400 ++++ jhagewood/sdiff/sdiff/common.c 2012-07-16 19:27:40.000000000 -0400 +@@ -5,16 +5,24 @@ + * Public domain. + */ + ++#if 0 ++#ifndef lint ++static char sccsid[] = "@(#)common.c"; ++#endif ++#endif /* not lint */ ++#include ++__FBSDID("$FreeBSD$"); ++ + #include + #include + #include + + #include "common.h" + +-__dead void ++void + cleanup(const char *filename) + { + if (unlink(filename)) + err(2, "could not delete: %s", filename); +- exit(2); ++ exit(1); + } +diff -rupN jhagewood/sdiff/sdiff-orig/common.h jhagewood/sdiff/sdiff/common.h +--- jhagewood/sdiff/sdiff-orig/common.h 2012-07-14 03:47:32.000000000 -0400 ++++ jhagewood/sdiff/sdiff/common.h 2012-07-16 19:27:30.000000000 -0400 +@@ -5,8 +5,4 @@ + * Public domain. + */ + +-#ifdef __FreeBSD__ +-#define __dead +-#endif +- +-__dead void cleanup(const char *); ++void cleanup(const char *) __dead2; +diff -rupN jhagewood/sdiff/sdiff-orig/edit.c jhagewood/sdiff/sdiff/edit.c +--- jhagewood/sdiff/sdiff-orig/edit.c 2012-07-14 03:47:32.000000000 -0400 ++++ jhagewood/sdiff/sdiff/edit.c 2012-07-16 19:29:10.000000000 -0400 +@@ -4,6 +4,14 @@ + * Written by Raymond Lai . + * Public domain. + */ ++ ++#if 0 ++#ifndef lint ++static char sccsid[] = "@(#)edit.c"; ++#endif ++#endif /* not lint */ ++#include ++__FBSDID("$FreeBSD$"); + + #include + #include diff -rupN jhagewood/sdiff/sdiff-orig/sdiff.1 jhagewood/sdiff/sdiff/sdiff.1 --- jhagewood/sdiff/sdiff-orig/sdiff.1 2012-07-14 03:47:32.000000000 -0400 +++ jhagewood/sdiff/sdiff/sdiff.1 2012-07-14 03:47:32.000000000 -0400 @@ -112,8 +173,8 @@ + diff -rupN jhagewood/sdiff/sdiff-orig/sdiff.c jhagewood/sdiff/sdiff/sdiff.c --- jhagewood/sdiff/sdiff-orig/sdiff.c 2012-07-14 03:47:32.000000000 -0400 -+++ jhagewood/sdiff/sdiff/sdiff.c 2012-07-14 03:52:09.000000000 -0400 -@@ -5,6 +5,15 @@ ++++ jhagewood/sdiff/sdiff/sdiff.c 2012-07-16 19:26:27.000000000 -0400 +@@ -5,6 +5,14 @@ * Public domain. */ @@ -122,14 +183,13 @@ +static char sccsid[] = "@(#)sdiff.c"; +#endif +#endif /* not lint */ -+ +#include +__FBSDID("$FreeBSD$"); + #include #include #include -@@ -62,81 +71,108 @@ static void printd(FILE *, size_t); +@@ -62,81 +70,108 @@ static void printd(FILE *, size_t); static void println(const char *, const char, const char *); static void processq(void); static void prompt(const char *, const char *); @@ -296,7 +356,7 @@ /* * Create temporary file if source_file is not a regular file. * Returns temporary file name if one was malloced, NULL if unnecessary. -@@ -175,7 +211,7 @@ mktmpcpy(const char *source_file) +@@ -175,7 +210,7 @@ mktmpcpy(const char *source_file) err(2, "asprintf"); if ((ofd = mkstemp(target_file)) == -1) { warn("error opening %s", target_file); @@ -305,7 +365,7 @@ } while ((rcount = read(ifd, buf, sizeof(buf))) != -1 && rcount != 0) { -@@ -184,22 +220,18 @@ mktmpcpy(const char *source_file) +@@ -184,22 +219,18 @@ mktmpcpy(const char *source_file) wcount = write(ofd, buf, (size_t)rcount); if (-1 == wcount || rcount != wcount) { warn("error writing to %s", target_file); @@ -330,7 +390,7 @@ } int -@@ -240,18 +272,13 @@ main(int argc, char **argv) +@@ -240,18 +271,13 @@ main(int argc, char **argv) const char *errstr; switch (ch) { @@ -349,7 +409,7 @@ /* combine no-arg single switches */ case 'a': case 'B': -@@ -261,11 +288,17 @@ main(int argc, char **argv) +@@ -261,11 +287,17 @@ main(int argc, char **argv) case 'i': case 't': case 'H': @@ -370,7 +430,7 @@ case DIFFPROG_OPT: diffargv[0] = diffprog = optarg; break; -@@ -289,32 +322,27 @@ main(int argc, char **argv) +@@ -289,32 +321,27 @@ main(int argc, char **argv) if (errstr) errx(2, "width is %s: %s", errstr, optarg); break; @@ -410,7 +470,7 @@ diffargv[i] = diffargv[i+1]; } diffargv[diffargc-1] = NULL; -@@ -362,19 +390,18 @@ main(int argc, char **argv) +@@ -362,19 +389,18 @@ main(int argc, char **argv) /* Add NULL to end of array to indicate end of array. */ diffargv[diffargc++] = NULL; @@ -435,7 +495,7 @@ case 0: /* child */ /* We don't read from the pipe. */ -@@ -383,7 +410,6 @@ main(int argc, char **argv) +@@ -383,7 +409,6 @@ main(int argc, char **argv) err(2, "child could not duplicate descriptor"); /* Free unused descriptor. */ close(fd[1]); @@ -443,7 +503,7 @@ execvp(diffprog, diffargv); err(2, "could not execute diff: %s", diffprog); break; -@@ -461,6 +487,7 @@ main(int argc, char **argv) +@@ -461,6 +486,7 @@ main(int argc, char **argv) static void printcol(const char *s, size_t *col, const size_t col_max) { @@ -451,7 +511,7 @@ for (; *s && *col < col_max; ++s) { size_t new_col; -@@ -484,11 +511,9 @@ printcol(const char *s, size_t *col, con +@@ -484,11 +510,9 @@ printcol(const char *s, size_t *col, con return; *col = new_col; break; @@ -463,7 +523,7 @@ putchar(*s); } } -@@ -512,56 +537,47 @@ prompt(const char *s1, const char *s2) +@@ -512,56 +536,47 @@ prompt(const char *s1, const char *s2) /* Skip leading whitespace. */ for (p = cmd; isspace(*p); ++p) ; @@ -529,7 +589,7 @@ free(cmd); return; } -@@ -570,7 +586,7 @@ PROMPT: +@@ -570,7 +585,7 @@ PROMPT: * If there was no error, we received an EOF from stdin, so we * should quit. */ @@ -538,7 +598,7 @@ fclose(outfp); exit(0); } -@@ -678,7 +694,6 @@ parsecmd(FILE *diffpipe, FILE *file1, FI +@@ -678,7 +693,6 @@ parsecmd(FILE *diffpipe, FILE *file1, FI /* A range is specified for file1. */ if (c == ',') { @@ -546,7 +606,7 @@ q = p; /* Go to character after file2end. */ while (isdigit(*p)) -@@ -690,7 +705,6 @@ parsecmd(FILE *diffpipe, FILE *file1, FI +@@ -690,7 +704,6 @@ parsecmd(FILE *diffpipe, FILE *file1, FI errx(2, "file1 end is %s: %s", errstr, line); if (file1start > file1end) errx(2, "invalid line range in file1: %s", line); @@ -554,7 +614,7 @@ } else file1end = file1start; -@@ -809,17 +823,14 @@ parsecmd(FILE *diffpipe, FILE *file1, FI +@@ -809,17 +822,14 @@ parsecmd(FILE *diffpipe, FILE *file1, FI printa(file2, file2end); n = file2end - file2start + 1; break; @@ -572,7 +632,7 @@ default: errx(2, "invalid diff command: %c: %s", cmd, line); } -@@ -854,6 +865,7 @@ enqueue(char *left, char div, char *righ +@@ -854,6 +864,7 @@ enqueue(char *left, char div, char *righ static void freediff(struct diffline *diffp) { @@ -580,7 +640,7 @@ free(diffp->left); free(diffp->right); free(diffp); -@@ -876,7 +888,6 @@ astrcat(char **s, const char *append) +@@ -876,7 +887,6 @@ astrcat(char **s, const char *append) static const char *oldstr = NULL; char *newstr; @@ -588,7 +648,7 @@ /* * First string is NULL, so just copy append. */ -@@ -1002,7 +1013,6 @@ printa(FILE *file, size_t line2) +@@ -1002,7 +1012,6 @@ printa(FILE *file, size_t line2) errx(2, "append ended early"); enqueue(NULL, '>', line); } @@ -596,7 +656,7 @@ processq(); } -@@ -1103,24 +1113,35 @@ printd(FILE *file1, size_t file1end) +@@ -1103,24 +1112,35 @@ printd(FILE *file1, size_t file1end) static void int_usage(void) { Modified: soc2012/jhagewood/sdiff/sdiff/common.c ============================================================================== --- soc2012/jhagewood/sdiff/sdiff/common.c Mon Jul 16 19:24:27 2012 (r239479) +++ soc2012/jhagewood/sdiff/sdiff/common.c Mon Jul 16 19:29:18 2012 (r239480) @@ -5,16 +5,24 @@ * Public domain. */ +#if 0 +#ifndef lint +static char sccsid[] = "@(#)common.c"; +#endif +#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include #include "common.h" -__dead void +void cleanup(const char *filename) { if (unlink(filename)) err(2, "could not delete: %s", filename); - exit(2); + exit(1); } Modified: soc2012/jhagewood/sdiff/sdiff/common.h ============================================================================== --- soc2012/jhagewood/sdiff/sdiff/common.h Mon Jul 16 19:24:27 2012 (r239479) +++ soc2012/jhagewood/sdiff/sdiff/common.h Mon Jul 16 19:29:18 2012 (r239480) @@ -5,8 +5,4 @@ * Public domain. */ -#ifdef __FreeBSD__ -#define __dead -#endif - -__dead void cleanup(const char *); +void cleanup(const char *) __dead2; Modified: soc2012/jhagewood/sdiff/sdiff/edit.c ============================================================================== --- soc2012/jhagewood/sdiff/sdiff/edit.c Mon Jul 16 19:24:27 2012 (r239479) +++ soc2012/jhagewood/sdiff/sdiff/edit.c Mon Jul 16 19:29:18 2012 (r239480) @@ -4,6 +4,14 @@ * Written by Raymond Lai . * Public domain. */ + +#if 0 +#ifndef lint +static char sccsid[] = "@(#)edit.c"; +#endif +#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); #include #include Modified: soc2012/jhagewood/sdiff/sdiff/sdiff.c ============================================================================== --- soc2012/jhagewood/sdiff/sdiff/sdiff.c Mon Jul 16 19:24:27 2012 (r239479) +++ soc2012/jhagewood/sdiff/sdiff/sdiff.c Mon Jul 16 19:29:18 2012 (r239480) @@ -10,7 +10,6 @@ static char sccsid[] = "@(#)sdiff.c"; #endif #endif /* not lint */ - #include __FBSDID("$FreeBSD$");