[xiph-commits] r14306 - icecast/trunk/icecast/src

karl at svn.xiph.org karl at svn.xiph.org
Sat Dec 15 09:02:17 PST 2007


Author: karl
Date: 2007-12-15 09:02:16 -0800 (Sat, 15 Dec 2007)
New Revision: 14306

Modified:
   icecast/trunk/icecast/src/client.h
   icecast/trunk/icecast/src/format.c
   icecast/trunk/icecast/src/fserve.c
   icecast/trunk/icecast/src/refbuf.c
   icecast/trunk/icecast/src/refbuf.h
Log:
type cleanups. reduces memory usage on 64bit, no difference on 32bit. closes #780


Modified: icecast/trunk/icecast/src/client.h
===================================================================
--- icecast/trunk/icecast/src/client.h	2007-12-13 09:31:57 UTC (rev 14305)
+++ icecast/trunk/icecast/src/client.h	2007-12-15 17:02:16 UTC (rev 14306)
@@ -42,7 +42,7 @@
     refbuf_t *refbuf;
 
     /* position in first buffer */
-    unsigned long pos;
+    unsigned int pos;
 
     /* auth used for this client */
     struct auth_tag *auth;

Modified: icecast/trunk/icecast/src/format.c
===================================================================
--- icecast/trunk/icecast/src/format.c	2007-12-13 09:31:57 UTC (rev 14305)
+++ icecast/trunk/icecast/src/format.c	2007-12-15 17:02:16 UTC (rev 14306)
@@ -26,7 +26,9 @@
 #ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#include <time.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
 
 #include "connection.h"
 #include "refbuf.h"
@@ -136,7 +138,7 @@
     if (bytes == 0)
         return 0;
 
-    refbuf->len = bytes;
+    refbuf->len = (unsigned int)bytes;
     return 1;
 }
 

Modified: icecast/trunk/icecast/src/fserve.c
===================================================================
--- icecast/trunk/icecast/src/fserve.c	2007-12-13 09:31:57 UTC (rev 14305)
+++ icecast/trunk/icecast/src/fserve.c	2007-12-15 17:02:16 UTC (rev 14306)
@@ -236,7 +236,7 @@
 static void *fserv_thread_function(void *arg)
 {
     fserve_t *fclient, **trail;
-    int bytes;
+    size_t bytes;
 
     INFO0("file serving thread started");
     while (run_fserv) {
@@ -270,7 +270,7 @@
                         client_tree_changed = 1;
                         continue;
                     }
-                    refbuf->len = bytes;
+                    refbuf->len = (unsigned int)bytes;
                     client->pos = 0;
                 }
 

Modified: icecast/trunk/icecast/src/refbuf.c
===================================================================
--- icecast/trunk/icecast/src/refbuf.c	2007-12-13 09:31:57 UTC (rev 14305)
+++ icecast/trunk/icecast/src/refbuf.c	2007-12-15 17:02:16 UTC (rev 14306)
@@ -33,7 +33,7 @@
 {
 }
 
-refbuf_t *refbuf_new(unsigned long size)
+refbuf_t *refbuf_new(unsigned int size)
 {
     refbuf_t *refbuf;
 

Modified: icecast/trunk/icecast/src/refbuf.h
===================================================================
--- icecast/trunk/icecast/src/refbuf.h	2007-12-13 09:31:57 UTC (rev 14305)
+++ icecast/trunk/icecast/src/refbuf.h	2007-12-15 17:02:16 UTC (rev 14306)
@@ -20,19 +20,19 @@
 
 typedef struct _refbuf_tag
 {
+    unsigned int len;
+    unsigned int _count;
     char *data;
-    unsigned long len;
-    int sync_point;
     struct _refbuf_tag *associated;
     struct _refbuf_tag *next;
+    int sync_point;
 
-    unsigned long _count;
 } refbuf_t;
 
 void refbuf_initialize(void);
 void refbuf_shutdown(void);
 
-refbuf_t *refbuf_new(unsigned long size);
+refbuf_t *refbuf_new(unsigned int size);
 void refbuf_addref(refbuf_t *self);
 void refbuf_release(refbuf_t *self);
 



More information about the commits mailing list