Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Feb 2012 05:17:01 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r231816 - head/usr.bin/gencat
Message-ID:  <201202160517.q1G5H14i000118@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Thu Feb 16 05:17:01 2012
New Revision: 231816
URL: http://svn.freebsd.org/changeset/base/231816

Log:
  Removed unused code: fixes compiler warning with CC=gcc46
  	error: parameter 'fd' set but not used
  
  Approved by:	cperciva
  MFC after:	1 week

Modified:
  head/usr.bin/gencat/gencat.c

Modified: head/usr.bin/gencat/gencat.c
==============================================================================
--- head/usr.bin/gencat/gencat.c	Thu Feb 16 05:16:55 2012	(r231815)
+++ head/usr.bin/gencat/gencat.c	Thu Feb 16 05:17:01 2012	(r231816)
@@ -462,89 +462,6 @@ MCParse(int fd)
 	}
 }
 
-void
-MCReadCat(int fd)
-{
-	fd = 0;
-#if 0
-	MCHeaderT mcHead;
-	MCMsgT  mcMsg;
-	MCSetT  mcSet;
-	msgT   *msg;
-	setT   *set;
-	int     i;
-	char   *data;
-
-	/* XXX init sethead? */
-
-	if (read(fd, &mcHead, sizeof(mcHead)) != sizeof(mcHead))
-		CORRUPT();
-	if (strncmp(mcHead.magic, MCMagic, MCMagicLen) != 0)
-		CORRUPT();
-	if (mcHead.majorVer != MCMajorVer)
-		error("unrecognized catalog version");
-	if ((mcHead.flags & MCGetByteOrder()) == 0)
-		error("wrong byte order");
-
-	if (lseek(fd, mcHead.firstSet, SEEK_SET) == -1)
-		CORRUPT();
-
-	for (;;) {
-		if (read(fd, &mcSet, sizeof(mcSet)) != sizeof(mcSet))
-			CORRUPT();
-		if (mcSet.invalid)
-			continue;
-
-		set = xmalloc(sizeof(setT));
-		memset(set, '\0', sizeof(*set));
-		if (cat->first) {
-			cat->last->next = set;
-			set->prev = cat->last;
-			cat->last = set;
-		} else
-			cat->first = cat->last = set;
-
-		set->setId = mcSet.setId;
-
-		/* Get the data */
-		if (mcSet.dataLen) {
-			data = xmalloc(mcSet.dataLen);
-			if (lseek(fd, mcSet.data.off, SEEK_SET) == -1)
-				CORRUPT();
-			if (read(fd, data, mcSet.dataLen) != mcSet.dataLen)
-				CORRUPT();
-			if (lseek(fd, mcSet.u.firstMsg, SEEK_SET) == -1)
-				CORRUPT();
-
-			for (i = 0; i < mcSet.numMsgs; ++i) {
-				if (read(fd, &mcMsg, sizeof(mcMsg)) != sizeof(mcMsg))
-					CORRUPT();
-				if (mcMsg.invalid) {
-					--i;
-					continue;
-				}
-				msg = xmalloc(sizeof(msgT));
-				memset(msg, '\0', sizeof(*msg));
-				if (set->first) {
-					set->last->next = msg;
-					msg->prev = set->last;
-					set->last = msg;
-				} else
-					set->first = set->last = msg;
-
-				msg->msgId = mcMsg.msgId;
-				msg->str = xstrdup((char *) (data + mcMsg.msg.off));
-			}
-			free(data);
-		}
-		if (!mcSet.nextSet)
-			break;
-		if (lseek(fd, mcSet.nextSet, SEEK_SET) == -1)
-			CORRUPT();
-	}
-#endif
-}
-
 /*
  * Write message catalog.
  *



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202160517.q1G5H14i000118>