From d98c317d94ae3892095ba650b1b33631feaec5d9 Mon Sep 17 00:00:00 2001
From: Chris Wolf <cwolf@xiph.org>
Date: Wed, 5 Sep 2001 19:34:29 +0000
Subject: [PATCH] Don't include unistd.h with MSVC, fix a warning

git-svn-id: http://svn.xiph.org/trunk/ao@1971 0101bb08-14d6-0310-b084-bc0e0c8e3800
---
 src/ao_au.c     | 16 +++++-----------
 src/ao_null.c   |  2 +-
 src/ao_raw.c    | 11 ++---------
 src/ao_wav.c    | 12 +++---------
 src/audio_out.c | 26 ++++++--------------------
 5 files changed, 17 insertions(+), 50 deletions(-)

diff --git a/src/ao_au.c b/src/ao_au.c
index 3a86902..94c9b7f 100644
--- a/src/ao_au.c
+++ b/src/ao_au.c
@@ -29,7 +29,9 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <unistd.h>
+#ifndef _MSC_VER
+# include <unistd.h>
+#endif
 #include <ao/ao.h>
 #include <ao/plugin.h>
 
@@ -81,7 +83,7 @@ typedef struct ao_au_internal
 } ao_au_internal;
 
 
-static int ao_au_test()
+static int ao_au_test(void)
 {
 	return 1; /* File driver always works */
 }
@@ -221,13 +223,6 @@ static void ao_au_device_clear(ao_device *device)
 	free(internal);
 }
 
-
-static char *ao_au_file_extension(void)
-{
-	return "au";
-}
-
-
 ao_functions ao_au = {
 	ao_au_test,
 	ao_au_driver_info,
@@ -236,6 +231,5 @@ ao_functions ao_au = {
 	ao_au_open,
 	ao_au_play,
 	ao_au_close,
-	ao_au_device_clear,
-	ao_au_file_extension
+	ao_au_device_clear
 };
diff --git a/src/ao_null.c b/src/ao_null.c
index 942b611..c4b6ab7 100644
--- a/src/ao_null.c
+++ b/src/ao_null.c
@@ -45,7 +45,7 @@ typedef struct ao_null_internal {
 } ao_null_internal;
 
 
-static int ao_null_test()
+static int ao_null_test(void)
 {
 	return 1; /* Null always works */
 }
diff --git a/src/ao_raw.c b/src/ao_raw.c
index d963279..c5b872c 100644
--- a/src/ao_raw.c
+++ b/src/ao_raw.c
@@ -49,7 +49,7 @@ typedef struct ao_raw_internal
 } ao_raw_internal;
 
 
-static int ao_raw_test()
+static int ao_raw_test(void)
 {
 	return 1; /* Always works */
 }
@@ -136,12 +136,6 @@ static void ao_raw_device_clear(ao_device *device)
 }
 
 
-static char *ao_raw_file_extension(void)
-{
-	return "raw";
-}
-
-
 ao_functions ao_raw = {
 	ao_raw_test,
 	ao_raw_driver_info,
@@ -150,6 +144,5 @@ ao_functions ao_raw = {
 	ao_raw_open,
 	ao_raw_play,
 	ao_raw_close,
-	ao_raw_device_clear,
-	ao_raw_file_extension	
+	ao_raw_device_clear
 };
diff --git a/src/ao_wav.c b/src/ao_wav.c
index e611f57..f816b22 100644
--- a/src/ao_wav.c
+++ b/src/ao_wav.c
@@ -99,7 +99,7 @@ typedef struct ao_wav_internal
 } ao_wav_internal;
 
 
-static int ao_wav_test()
+static int ao_wav_test(void)
 {
 	return 1; /* File driver always works */
 }
@@ -257,12 +257,6 @@ static void ao_wav_device_clear(ao_device *device)
 }
 
 
-static char *ao_wav_file_extension(void)
-{
-	return "wav";
-}
-
-
 ao_functions ao_wav = {
 	ao_wav_test,
 	ao_wav_driver_info,
@@ -271,6 +265,6 @@ ao_functions ao_wav = {
 	ao_wav_open,
 	ao_wav_play,
 	ao_wav_close,
-	ao_wav_device_clear,
-	ao_wav_file_extension
+	ao_wav_device_clear
 };
+
diff --git a/src/audio_out.c b/src/audio_out.c
index 56279e5..a81ae16 100644
--- a/src/audio_out.c
+++ b/src/audio_out.c
@@ -30,14 +30,17 @@
 #include <dlfcn.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
+#ifndef _MSC_VER
+# include <unistd.h>
+#endif
 #include <dirent.h>
+
 #include "ao/ao.h"
 #include "ao_private.h"
 
 /* These should have been set by the Makefile */
 #ifndef AO_PLUGIN_PATH
-#define AO_PLUGIN_PATH "/usr/local/lib/ao/plugins"
+#define AO_PLUGIN_PATH "/usr/local/lib/ao"
 #endif
 #ifndef SHARED_LIB_EXT
 #define SHARED_LIB_EXT ".so"
@@ -137,11 +140,6 @@ driver_list *_get_plugin(char *plugin_file)
 		  dlsym(dt->handle, "ao_plugin_device_clear");
 		if (dlerror()) { free(dt->functions); free(dt); return NULL; }
 
-		/* Optional function */
-		dt->functions->file_extension = 
-		  dlsym(dt->handle, "ao_plugin_file_extension");
-		if (dlerror()) { dt->functions->file_extension = NULL; }
-
 
 	} else {
 		return NULL;
@@ -394,7 +392,7 @@ int _realloc_swap_buffer(ao_device *device, int min_size)
    the target buffer. */
 void _swap_samples(char *target_buffer, char* source_buffer, uint_32 num_bytes)
 {
-	int i;
+	uint_32 i;
 
 	for (i = 0; i < num_bytes; i += 2) {
 		target_buffer[i] = source_buffer[i+1];
@@ -703,18 +701,6 @@ ao_info **ao_driver_info_list(int *count)
 }
 
 
-char *ao_file_extension(int driver_id)
-{
-	driver_list *driver;
-
-	if ( (driver = _get_driver(driver_id)) 
-	     && driver->functions->file_extension != NULL)
-		return driver->functions->file_extension();
-	else
-		return NULL;
-}  
-
-
 /* -- Miscellaneous -- */
 
 /* Stolen from Vorbis' lib/vorbisfile.c */
-- 
GitLab