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.
  *
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to