mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-08 10:06:56 -05:00
win32: Make some unused-variable warnings go away
This commit is contained in:
parent
3adc43b8fe
commit
5818a2c63e
15 changed files with 49 additions and 29 deletions
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <pulsecore/macro.h>
|
||||
#include <pulsecore/socket.h>
|
||||
#include <pulsecore/core-util.h>
|
||||
|
||||
#include "arpa-inet.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1574,8 +1574,10 @@ static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
|
|||
pa_card *card;
|
||||
pa_bool_t nl;
|
||||
uint32_t idx;
|
||||
char txt[256];
|
||||
time_t now;
|
||||
#ifdef HAVE_CTIME_R
|
||||
char txt[256];
|
||||
#endif
|
||||
|
||||
pa_core_assert_ref(c);
|
||||
pa_assert(t);
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ void pa_make_fd_cloexec(int fd) {
|
|||
/** Creates a directory securely */
|
||||
int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
|
||||
struct stat st;
|
||||
int r, saved_errno, fd;
|
||||
int r, saved_errno;
|
||||
|
||||
pa_assert(dir);
|
||||
|
||||
|
|
@ -238,6 +238,8 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
|
|||
return -1;
|
||||
|
||||
#if defined(HAVE_FSTAT) && !defined(OS_IS_WIN32)
|
||||
{
|
||||
int fd;
|
||||
if ((fd = open(dir,
|
||||
#ifdef O_CLOEXEC
|
||||
O_CLOEXEC|
|
||||
|
|
@ -276,6 +278,7 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
|
|||
#endif
|
||||
|
||||
pa_assert_se(pa_close(fd) >= 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LSTAT
|
||||
|
|
@ -728,7 +731,7 @@ int pa_make_realtime(int rtprio) {
|
|||
pa_log_info("Successfully acquired real-time thread priority.");
|
||||
return 0;
|
||||
|
||||
#elif _POSIX_PRIORITY_SCHEDULING
|
||||
#elif defined(_POSIX_PRIORITY_SCHEDULING)
|
||||
int p;
|
||||
|
||||
if (set_scheduler(rtprio) >= 0) {
|
||||
|
|
@ -886,7 +889,6 @@ int pa_match(const char *expr, const char *v) {
|
|||
|
||||
/* Try to parse a boolean string value.*/
|
||||
int pa_parse_boolean(const char *v) {
|
||||
const char *expr;
|
||||
pa_assert(v);
|
||||
|
||||
/* First we check language independant */
|
||||
|
|
@ -896,6 +898,8 @@ int pa_parse_boolean(const char *v) {
|
|||
return 0;
|
||||
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
{
|
||||
const char *expr;
|
||||
/* And then we check language dependant */
|
||||
if ((expr = nl_langinfo(YESEXPR)))
|
||||
if (expr[0])
|
||||
|
|
@ -906,6 +910,7 @@ int pa_parse_boolean(const char *v) {
|
|||
if (expr[0])
|
||||
if (pa_match(expr, v) > 0)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
errno = EINVAL;
|
||||
|
|
@ -1561,7 +1566,6 @@ static int make_random_dir_and_link(mode_t m, const char *k) {
|
|||
|
||||
char *pa_get_runtime_dir(void) {
|
||||
char *d, *k = NULL, *p = NULL, *t = NULL, *mid;
|
||||
struct stat st;
|
||||
mode_t m;
|
||||
|
||||
/* The runtime directory shall contain dynamic data that needs NOT
|
||||
|
|
@ -1641,10 +1645,10 @@ char *pa_get_runtime_dir(void) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
/* Hmm, so this symlink is still around, make sure nobody fools
|
||||
* us */
|
||||
|
||||
/* Hmm, so this symlink is still around, make sure nobody fools us */
|
||||
#ifdef HAVE_LSTAT
|
||||
{
|
||||
struct stat st;
|
||||
if (lstat(p, &st) < 0) {
|
||||
|
||||
if (errno != ENOENT) {
|
||||
|
|
@ -1664,6 +1668,7 @@ char *pa_get_runtime_dir(void) {
|
|||
|
||||
pa_log_info("Hmm, runtime path exists, but points to an invalid directory. Changing runtime directory.");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
pa_xfree(p);
|
||||
|
|
@ -2203,7 +2208,7 @@ void *pa_will_need(const void *p, size_t l) {
|
|||
#endif
|
||||
const void *a;
|
||||
size_t size;
|
||||
int r;
|
||||
int r = ENOTSUP;
|
||||
size_t bs;
|
||||
|
||||
pa_assert(p);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
extern pa_win32_get_toplevel(HANDLE handle);
|
||||
extern char *pa_win32_get_toplevel(HANDLE handle);
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
|
||||
WSADATA data;
|
||||
|
|
|
|||
|
|
@ -49,11 +49,11 @@ static int random_proper(void *ret_data, size_t length) {
|
|||
#ifdef OS_IS_WIN32
|
||||
int ret = -1;
|
||||
|
||||
HCRYPTPROV hCryptProv = 0;
|
||||
|
||||
pa_assert(ret_data);
|
||||
pa_assert(length > 0);
|
||||
|
||||
HCRYPTPROV hCryptProv = NULL;
|
||||
|
||||
if (CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
|
||||
if(CryptGenRandom(hCryptProv, length, ret_data))
|
||||
ret = 0;
|
||||
|
|
|
|||
|
|
@ -98,8 +98,10 @@ static char *segment_name(char *fn, size_t l, unsigned id) {
|
|||
#endif
|
||||
|
||||
int pa_shm_create_rw(pa_shm *m, size_t size, pa_bool_t shared, mode_t mode) {
|
||||
#ifdef HAVE_SHM_OPEN
|
||||
char fn[32];
|
||||
int fd = -1;
|
||||
#endif
|
||||
|
||||
pa_assert(m);
|
||||
pa_assert(size > 0);
|
||||
|
|
|
|||
|
|
@ -72,8 +72,9 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
|
|||
#ifndef OS_IS_WIN32
|
||||
pa_assert_se(fstat(fd, &st) == 0);
|
||||
|
||||
if (S_ISSOCK(st.st_mode)) {
|
||||
if (S_ISSOCK(st.st_mode))
|
||||
#endif
|
||||
{
|
||||
union {
|
||||
struct sockaddr_storage storage;
|
||||
struct sockaddr sa;
|
||||
|
|
@ -118,10 +119,11 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef OS_IS_WIN32
|
||||
pa_snprintf(c, l, "Unknown network client");
|
||||
return;
|
||||
} else if (S_ISCHR(st.st_mode) && (fd == 0 || fd == 1)) {
|
||||
}
|
||||
#ifndef OS_IS_WIN32
|
||||
else if (S_ISCHR(st.st_mode) && (fd == 0 || fd == 1)) {
|
||||
pa_snprintf(c, l, "STDIN/STDOUT client");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@
|
|||
#include "start-child.h"
|
||||
|
||||
int pa_start_child_for_read(const char *name, const char *argv1, pid_t *pid) {
|
||||
#ifdef HAVE_FORK
|
||||
pid_t child;
|
||||
int pipe_fds[2] = { -1, -1 };
|
||||
|
||||
#ifdef HAVE_FORK
|
||||
if (pipe(pipe_fds) < 0) {
|
||||
pa_log("pipe() failed: %s", pa_cstrerror(errno));
|
||||
goto fail;
|
||||
|
|
@ -106,10 +106,10 @@ int pa_start_child_for_read(const char *name, const char *argv1, pid_t *pid) {
|
|||
execl(name, name, argv1, NULL);
|
||||
_exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
fail:
|
||||
pa_close_pipe(pipe_fds);
|
||||
#endif /* HAVE_FORK */
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue