[nas] Gcc 4.0 fixes for nas 1.7

Steve McIntyre steve at einval.com
Sun Dec 26 15:11:33 MST 2004


Hi Jon,

Gcc 4.0 is much pickier about function prototypes. It throws lots of
warnings when compiling nas 1.7, and one error in auutil.c. The
attached patch fixes them for me (mainly by simply including standard
headers!).

I'm also seeing (on AMD64) several warnings about invalid pointer <->
int conversions. These seem benign so far, but you should be
aware. I've grepped a build log for these (also attached).

-- 
Steve McIntyre, Cambridge, UK.                                steve at einval.com
We don't need no education.
We don't need no thought control.
-------------- next part --------------
--- nas-1.7.orig/clients/audio/auconvert/auconvert.c
+++ nas-1.7/clients/audio/auconvert/auconvert.c
@@ -383,7 +383,7 @@
 	    fatalError("Error writing output file");
     }
     else
-	rateConvert(in, out, numBytes, data);
+	rateConvert(in, out, numBytes, (char *)data);
 
     if (SoundCloseFile(out))
 	fatalError("Error closing output file");
--- nas-1.7.orig/clients/audio/auinfo/auinfo.c
+++ nas-1.7/clients/audio/auinfo/auinfo.c
@@ -26,6 +26,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <audio/audiolib.h>
 
--- nas-1.7.orig/clients/audio/aupanel/aupanel.c
+++ nas-1.7/clients/audio/aupanel/aupanel.c
@@ -28,6 +28,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #ifndef SYSV
 #include <audio/Aos.h>		/* for string and other os stuff */
 #endif
--- nas-1.7.orig/clients/audio/auplay/auplay.c
+++ nas-1.7/clients/audio/auplay/auplay.c
@@ -30,7 +30,9 @@
 #include	<unistd.h>
 #include	<fcntl.h>
 #include	<stdio.h>
+#include    <stdlib.h>
 #include	<signal.h>
+#include    <string.h>
 #include	<audio/audiolib.h>
 #include	<audio/soundlib.h>
 
--- nas-1.7.orig/clients/audio/aurecord/aurecord.c
+++ nas-1.7/clients/audio/aurecord/aurecord.c
@@ -28,6 +28,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <signal.h>
 #include <audio/Aos.h>			/* for string and other os stuff */
 #include <audio/Afuncs.h> 		/* for bcopy et. al. */
--- nas-1.7.orig/clients/audio/auwave/auwave.c
+++ nas-1.7/clients/audio/auwave/auwave.c
@@ -28,6 +28,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #ifndef SYSV
 #include <audio/Aos.h> 		/* for string and other os stuff */
 #endif
--- nas-1.7.orig/clients/audio/examples/playFile.c
+++ nas-1.7/clients/audio/examples/playFile.c
@@ -9,6 +9,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 
--- nas-1.7.orig/clients/audio/examples/playSimul.c
+++ nas-1.7/clients/audio/examples/playSimul.c
@@ -9,6 +9,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 
@@ -48,7 +49,7 @@
 	    {
 		arg++;
 		argc--;
-		volume = atoi(arg);
+		volume = atoi(*arg);
 	    }
 	}
 	else if (AuSoundPlayFromFile(aud, *arg, AuNone,
--- nas-1.7.orig/clients/audio/examples/playFromBckt.c
+++ nas-1.7/clients/audio/examples/playFromBckt.c
@@ -9,6 +9,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 
--- nas-1.7.orig/clients/audio/examples/loopBucket.c
+++ nas-1.7/clients/audio/examples/loopBucket.c
@@ -10,6 +10,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 
--- nas-1.7.orig/clients/audio/examples/bundle.c
+++ nas-1.7/clients/audio/examples/bundle.c
@@ -17,6 +17,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 
--- nas-1.7.orig/clients/audio/examples/recordBucket.c
+++ nas-1.7/clients/audio/examples/recordBucket.c
@@ -11,6 +11,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 
--- nas-1.7.orig/clients/audio/examples/plyBcktAsync.c
+++ nas-1.7/clients/audio/examples/plyBcktAsync.c
@@ -7,6 +7,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 
--- nas-1.7.orig/clients/audio/util/playbucket.c
+++ nas-1.7/clients/audio/util/playbucket.c
@@ -23,6 +23,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
--- nas-1.7.orig/clients/audio/widgets/Slider.c
+++ nas-1.7/clients/audio/widgets/Slider.c
@@ -31,6 +31,7 @@
 #include <X11/StringDefs.h>
 #include <X11/Xaw/Label.h>
 #include <X11/Xaw/Scrollbar.h>
+#include <stdio.h>
 #include "SliderP.h"
 
 static XtResource resources[] = {
--- nas-1.7.orig/server/dia/main.c
+++ nas-1.7/server/dia/main.c
@@ -52,6 +52,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <audio/audio.h>
 #include <audio/Aproto.h>
 #include "NasConfig.h"
--- nas-1.7.orig/server/dia/auprocess.c
+++ nas-1.7/server/dia/auprocess.c
@@ -25,6 +25,7 @@
 #define _AUPROCESS_C_
 #define OUTPUT_RANGE_CHECK
 
+#include <string.h>
 #include <audio/audio.h>
 #include <audio/Aproto.h>
 #include "au.h"
--- nas-1.7.orig/server/dia/auutil.c
+++ nas-1.7/server/dia/auutil.c
@@ -173,7 +173,7 @@
 AuCreateResourceTypes()
 {
     void            AuFreeComponent();
-    static void     freeFlow();
+    void     freeFlow();
 
     auComponentType = CreateNewResourceType(AuFreeComponent);
     auFlowType = CreateNewResourceType(freeFlow);
--- nas-1.7.orig/server/os/access.c
+++ nas-1.7/server/os/access.c
@@ -583,7 +583,8 @@
 AuthorizedClient(client)
     ClientPtr client;
 {
-    int    		alen, family;
+    int    		family;
+	socklen_t   alen;
 #ifndef AMOEBA
     struct sockaddr	from;
 #else
--- nas-1.7.orig/server/os/connection.c
+++ nas-1.7/server/os/connection.c
@@ -1402,7 +1402,7 @@
 	struct sockaddr_dn dn;
 #endif /* DNETCONN */
     } from;
-    int	fromlen = sizeof (from);
+    socklen_t	fromlen = sizeof (from);
     AuID	 auth_id;
 
     auth_id = CheckAuthorization (proto_n, auth_proto,
@@ -1480,7 +1480,7 @@
 	struct sockaddr_dn dn;
 #endif /* DNETCONN */
     } from;
-    int	fromlen;
+    socklen_t	fromlen;
 #endif /* TCP_NODELAY */
 
     readyconnections = (((long)closure) & WellKnownConnections);
@@ -1504,7 +1504,7 @@
 	readyconnections &= ~(1 << curconn);
 	if ((newconn = accept (curconn,
 			      (struct sockaddr *) NULL, 
-			      (int *)NULL)) < 0) 
+			      (socklen_t *)NULL)) < 0) 
 	    continue;
 	if (newconn > lastfdesc)
 	{
--- nas-1.7.orig/server/os/utils.c
+++ nas-1.7/server/os/utils.c
@@ -51,6 +51,7 @@
 #include <audio/audio.h>
 #include <audio/Aos.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include "nasconf.h"
 #include "misc.h"
 #include "opaque.h"
-------------- next part --------------
gram.y:66: warning: cast to pointer from integer of different size
gram.y:100: warning: cast to pointer from integer of different size
gram.y:104: warning: cast to pointer from integer of different size
gram.y:108: warning: cast to pointer from integer of different size
gram.y:120: warning: cast to pointer from integer of different size
gram.y:124: warning: cast to pointer from integer of different size
gram.y:128: warning: cast to pointer from integer of different size
gram.y:132: warning: cast to pointer from integer of different size
gram.y:136: warning: cast to pointer from integer of different size
gram.y:139: warning: cast to pointer from integer of different size
gram.y:141: warning: cast to pointer from integer of different size
gram.y:143: warning: cast to pointer from integer of different size
config.c:29: warning: cast from pointer to integer of different size
config.c:42: warning: cast from pointer to integer of different size
config.c:47: warning: cast from pointer to integer of different size
config.c:58: warning: cast from pointer to integer of different size
config.c:63: warning: cast from pointer to integer of different size
config.c:87: warning: cast from pointer to integer of different size
config.c:99: warning: cast from pointer to integer of different size
config.c:124: warning: cast from pointer to integer of different size
config.c:139: warning: cast from pointer to integer of different size
config.c:154: warning: cast from pointer to integer of different size
config.c:166: warning: cast from pointer to integer of different size
config.c:172: warning: cast from pointer to integer of different size
config.c:178: warning: cast from pointer to integer of different size
Slider.c:153: warning: cast to pointer from integer of different size
Slider.c:164: warning: cast from pointer to integer of different size
audemo.c:976: warning: cast to pointer from integer of different size
audemo.c:1299: warning: cast from pointer to integer of different size
audemo.c:1366: warning: cast from pointer to integer of different size
audemo.c:1460: warning: cast from pointer to integer of different size
auedit.c:392: warning: cast from pointer to integer of different size
auedit.c:408: warning: cast from pointer to integer of different size
auedit.c:459: warning: cast from pointer to integer of different size
auedit.c:1846: warning: cast from pointer to integer of different size
Graph.c:455: warning: cast to pointer from integer of different size
Graph.c:462: warning: cast to pointer from integer of different size
Graph.c:542: warning: cast to pointer from integer of different size
Graph.c:545: warning: cast to pointer from integer of different size
aupanel.c:264: warning: cast from pointer to integer of different size
aupanel.c:328: warning: cast from pointer to integer of different size
audiotool.c:389: warning: cast from pointer to integer of different size
auwave.c:239: warning: cast from pointer to integer of different size
auwave.c:261: warning: cast from pointer to integer of different size
auwave.c:286: warning: cast from pointer to integer of different size
auphone.c:920: warning: cast from pointer to integer of different size
auphone.c:942: warning: cast from pointer to integer of different size
auphone.c:1241: warning: cast to pointer from integer of different size
auphone.c:1244: warning: cast to pointer from integer of different size
auphone.c:1247: warning: cast to pointer from integer of different size
auphone.c:1250: warning: cast to pointer from integer of different size
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://radscan.com/pipermail/nas/attachments/20041226/210b5ca4/attachment.pgp>


More information about the Nas mailing list