Skip to content
Snippets Groups Projects
Commit d98c317d authored by Chris Wolf's avatar Chris Wolf
Browse files

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
parent 3c382341
No related branches found
No related tags found
No related merge requests found
......@@ -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
};
......@@ -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 */
}
......
......@@ -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
};
......@@ -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
};
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment