mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
make PA_GCC_PACKED and PA_GCC_MALLOC actually work
This commit is contained in:
parent
c0fb91db54
commit
44bca66c59
5 changed files with 10 additions and 10 deletions
|
|
@ -70,10 +70,10 @@ struct userdata {
|
||||||
|
|
||||||
#define ENTRY_VERSION 1
|
#define ENTRY_VERSION 1
|
||||||
|
|
||||||
struct entry PA_GCC_PACKED {
|
struct entry {
|
||||||
uint8_t version;
|
uint8_t version;
|
||||||
char profile[PA_NAME_MAX];
|
char profile[PA_NAME_MAX];
|
||||||
};
|
} PA_GCC_PACKED ;
|
||||||
|
|
||||||
static void save_time_callback(pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata) {
|
static void save_time_callback(pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata) {
|
||||||
struct userdata *u = userdata;
|
struct userdata *u = userdata;
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,12 @@ struct userdata {
|
||||||
|
|
||||||
#define ENTRY_VERSION 1
|
#define ENTRY_VERSION 1
|
||||||
|
|
||||||
struct entry PA_GCC_PACKED {
|
struct entry {
|
||||||
uint8_t version;
|
uint8_t version;
|
||||||
pa_bool_t muted:1;
|
pa_bool_t muted:1;
|
||||||
pa_channel_map channel_map;
|
pa_channel_map channel_map;
|
||||||
pa_cvolume volume;
|
pa_cvolume volume;
|
||||||
};
|
} PA_GCC_PACKED;
|
||||||
|
|
||||||
static void save_time_callback(pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata) {
|
static void save_time_callback(pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata) {
|
||||||
struct userdata *u = userdata;
|
struct userdata *u = userdata;
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ struct userdata {
|
||||||
|
|
||||||
#define ENTRY_VERSION 1
|
#define ENTRY_VERSION 1
|
||||||
|
|
||||||
struct entry PA_GCC_PACKED {
|
struct entry {
|
||||||
uint8_t version;
|
uint8_t version;
|
||||||
pa_bool_t muted_valid:1, relative_volume_valid:1, absolute_volume_valid:1, device_valid:1;
|
pa_bool_t muted_valid:1, relative_volume_valid:1, absolute_volume_valid:1, device_valid:1;
|
||||||
pa_bool_t muted:1;
|
pa_bool_t muted:1;
|
||||||
|
|
@ -101,7 +101,7 @@ struct entry PA_GCC_PACKED {
|
||||||
pa_cvolume relative_volume;
|
pa_cvolume relative_volume;
|
||||||
pa_cvolume absolute_volume;
|
pa_cvolume absolute_volume;
|
||||||
char device[PA_NAME_MAX];
|
char device[PA_NAME_MAX];
|
||||||
};
|
} PA_GCC_PACKED;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SUBCOMMAND_TEST,
|
SUBCOMMAND_TEST,
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PA_GCC_PACKED
|
#ifndef PA_GCC_PACKED
|
||||||
#ifdef __GNUCC__
|
#ifdef __GNUC__
|
||||||
#define PA_GCC_PACKED __attribute__ ((packed))
|
#define PA_GCC_PACKED __attribute__ ((packed))
|
||||||
#else
|
#else
|
||||||
/** Structure shall be packed in memory **/
|
/** Structure shall be packed in memory **/
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PA_GCC_MALLOC
|
#ifndef PA_GCC_MALLOC
|
||||||
#ifdef __GNUCC__
|
#ifdef __GNUC__
|
||||||
#define PA_GCC_MALLOC __attribute__ ((malloc))
|
#define PA_GCC_MALLOC __attribute__ ((malloc))
|
||||||
#else
|
#else
|
||||||
/** Macro for usage of GCC's malloc attribute */
|
/** Macro for usage of GCC's malloc attribute */
|
||||||
|
|
|
||||||
|
|
@ -70,14 +70,14 @@
|
||||||
|
|
||||||
/* We now put this SHM marker at the end of each segment. It's
|
/* We now put this SHM marker at the end of each segment. It's
|
||||||
* optional, to not require a reboot when upgrading, though */
|
* optional, to not require a reboot when upgrading, though */
|
||||||
struct shm_marker PA_GCC_PACKED {
|
struct shm_marker {
|
||||||
pa_atomic_t marker; /* 0xbeefcafe */
|
pa_atomic_t marker; /* 0xbeefcafe */
|
||||||
pa_atomic_t pid;
|
pa_atomic_t pid;
|
||||||
uint64_t _reserved1;
|
uint64_t _reserved1;
|
||||||
uint64_t _reserved2;
|
uint64_t _reserved2;
|
||||||
uint64_t _reserved3;
|
uint64_t _reserved3;
|
||||||
uint64_t _reserved4;
|
uint64_t _reserved4;
|
||||||
};
|
} PA_GCC_PACKED;
|
||||||
|
|
||||||
static char *segment_name(char *fn, size_t l, unsigned id) {
|
static char *segment_name(char *fn, size_t l, unsigned id) {
|
||||||
pa_snprintf(fn, l, "/pulse-shm-%u", id);
|
pa_snprintf(fn, l, "/pulse-shm-%u", id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue