[nas] [patch] remove more unused content

Stefan Huehner stefan at huehner.org
Tue Aug 29 07:22:46 MDT 2006


Hi,

attached patch removes more unused defines and functions in server/ .
Additionally a k&r style function was convertd to ansi c in swaprep.c

Please check and consider applying.

Regards,
Stefan

-------------- next part --------------
Index: server/dda/voxware/auvoxware.c
===================================================================
--- server/dda/voxware/auvoxware.c	(revision 224)
+++ server/dda/voxware/auvoxware.c	(working copy)
@@ -206,7 +206,6 @@
 
 #define SERVER_CLIENT           0
 
-#define MIN_MINIBUF_SAMPLES     256
 #define MAX_MINIBUF_SAMPLES     1024    /* Must be a power of 2 */
 
 #define PhysicalOneTrackBufferSize \
@@ -322,18 +321,6 @@
 static void setPhysicalInputGainAndLineMode(AuFixedPoint gain,
                                             AuUint8 lineMode);
 
-void
-setDebugOn(void)
-{
-    NasConfig.DoDebug = 1;
-}
-
-void
-setVerboseOn(void)
-{
-    NasConfig.DoVerbose = 1;
-}
-
 #ifdef sco
 
 AuBlock
Index: server/dia/dispatch.c
===================================================================
--- server/dia/dispatch.c	(revision 224)
+++ server/dia/dispatch.c	(working copy)
@@ -70,12 +70,10 @@
 extern Bool InitClientResources();
 
 extern int (*InitialVector[3]) ();
-extern void Swap32Write(), WriteSConnectionInfo();
 extern void WriteSConnSetupPrefix();
 extern char *ClientAuthorized();
 extern Bool InsertFakeRequest();
 static void KillAllClients(void);
-extern void ProcessWorkQueue();
 
 extern int (*AuProcVector[256]) ();
 extern int (*AuSwappedProcVector[256]) ();
Index: server/dia/events.c
===================================================================
--- server/dia/events.c	(revision 224)
+++ server/dia/events.c	(working copy)
@@ -49,8 +49,6 @@
 
 #include        <audio/audio.h>
 #include        <audio/Aproto.h>
-#include "misc.h"
-#include "resource.h"
 #include "dixstruct.h"
 
 extern void WriteToClient();
Index: server/dia/dixutils.c
===================================================================
--- server/dia/dixutils.c       (revision 224)
+++ server/dia/dixutils.c       (working copy)
@@ -54,25 +54,6 @@

 extern void IgnoreClient(), AttendClient();

-/*
- * CompareTimeStamps returns -1, 0, or +1 depending on if the first
- * argument is less than, equal to or greater than the second argument.
- */
-
-int
-CompareTimeStamps(TimeStamp a, TimeStamp b)
-{
-    if (a.months < b.months)
-        return EARLIER;
-    if (a.months > b.months)
-        return LATER;
-    if (a.milliseconds < b.milliseconds)
-        return EARLIER;
-    if (a.milliseconds > b.milliseconds)
-        return LATER;
-    return SAMETIME;
-}
-
 /* No-op Don't Do Anything : sometimes we need to be able to call a procedure
  * that doesn't do anything.  For example, on screen with only static
  * colormaps, if someone calls install colormap, it's easier to have a dummy
Index: server/dia/swaprep.c
===================================================================
--- server/dia/swaprep.c	(revision 224)
+++ server/dia/swaprep.c	(working copy)
@@ -74,100 +71,8 @@
 }
 
 void
-CopySwap32Write(pClient, size, pbuf)
-ClientPtr pClient;
-int size;                       /* in bytes */
-long *pbuf;
+WriteSConnSetupPrefix(ClientPtr pClient, auConnSetupPrefix *pcsp)
 {
-    int bufsize = size;
-    long *pbufT;
-    register long *from, *to, *fromLast, *toLast;
-    long tmpbuf[1];
-
-    /* Allocate as big a buffer as we can... */
-    while (!(pbufT = (long *) ALLOCATE_LOCAL(bufsize))) {
-        bufsize >>= 1;
-        if (bufsize == 4) {
-            pbufT = tmpbuf;
-            break;
-        }
-    }
-
-    /* convert lengths from # of bytes to # of longs */
-    size >>= 2;
-    bufsize >>= 2;
-
-    from = pbuf;
-    fromLast = from + size;
-    while (from < fromLast) {
-        int nbytes;
-        to = pbufT;
-        toLast = to + min(bufsize, fromLast - from);
-        nbytes = (toLast - to) << 2;
-        while (to < toLast) {
-            /* can't write "cpswapl(*from++, *to++)" because cpswapl is a macro
-               that evaulates its args more than once */
-            cpswapl(*from, *to);
-            from++;
-            to++;
-        }
-        (void) WriteToClient(pClient, nbytes, (char *) pbufT);
-    }
-
-    if (pbufT != tmpbuf)
-        DEALLOCATE_LOCAL((char *) pbufT);
-}
-
-void
-CopySwap16Write(pClient, size, pbuf)
-ClientPtr pClient;
-int size;                       /* in bytes */
-short *pbuf;
-{
-    int bufsize = size;
-    short *pbufT;
-    register short *from, *to, *fromLast, *toLast;
-    short tmpbuf[2];
-
-    /* Allocate as big a buffer as we can... */
-    while (!(pbufT = (short *) ALLOCATE_LOCAL(bufsize))) {
-        bufsize >>= 1;
-        if (bufsize == 4) {
-            pbufT = tmpbuf;
-            break;
-        }
-    }
-
-    /* convert lengths from # of bytes to # of shorts */
-    size >>= 1;
-    bufsize >>= 1;
-
-    from = pbuf;
-    fromLast = from + size;
-    while (from < fromLast) {
-        int nbytes;
-        to = pbufT;
-        toLast = to + min(bufsize, fromLast - from);
-        nbytes = (toLast - to) << 1;
-        while (to < toLast) {
-            /* can't write "cpswaps(*from++, *to++)" because cpswaps is a macro
-               that evaulates its args more than once */
-            cpswaps(*from, *to);
-            from++;
-            to++;
-        }
-        (void) WriteToClient(pClient, nbytes, (char *) pbufT);
-    }
-
-    if (pbufT != tmpbuf)
-        DEALLOCATE_LOCAL((char *) pbufT);
-}
-
-void
-WriteSConnSetupPrefix(pClient, pcsp)
-ClientPtr pClient;
-auConnSetupPrefix *pcsp;
-{
     auConnSetupPrefix cspT;
 
     cspT.success = pcsp->success;
Index: server/dia/swapreq.c
===================================================================
--- server/dia/swapreq.c	(revision 224)
+++ server/dia/swapreq.c	(working copy)
@@ -50,7 +50,6 @@
 #include <audio/audio.h>
 #include <audio/Aproto.h>
 #include "misc.h"
-#include "dixstruct.h"
 
 /* Byte swap a list of longs */
 


More information about the Nas mailing list