aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-04-11 23:37:18 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-04-11 23:37:18 +0000
commit26f72edc468b235ee735821be54856ccfce87fbd (patch)
tree1650dac6e15e57a1040d5b32b9eae92352f9b641 /src
parentae33b348afa800447db9344cf6e5d082f1a1fcb3 (diff)
downloadmpd-26f72edc468b235ee735821be54856ccfce87fbd.tar.gz
mpd-26f72edc468b235ee735821be54856ccfce87fbd.tar.xz
mpd-26f72edc468b235ee735821be54856ccfce87fbd.zip
add volatile qualifiers to some shared mem buffer stuff, to enusre compiler
doesn't optimize out order sensitive stuff git-svn-id: https://svn.musicpd.org/mpd/trunk@698 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/decode.c2
-rw-r--r--src/player.h22
-rw-r--r--src/playerData.h16
3 files changed, 20 insertions, 20 deletions
diff --git a/src/decode.c b/src/decode.c
index 5cb5cfa20..4b50192b4 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -52,7 +52,7 @@
#include <unistd.h>
#include <string.h>
-int * decode_pid = NULL;
+int volatile * decode_pid = NULL;
void decodeSigHandler(int sig) {
if(sig==SIGCHLD) {
diff --git a/src/player.h b/src/player.h
index df256ea0b..65ea07595 100644
--- a/src/player.h
+++ b/src/player.h
@@ -52,11 +52,11 @@
typedef struct _PlayerControl {
mpd_sint8 decodeType;
- mpd_sint8 stop;
- mpd_sint8 play;
- mpd_sint8 pause;
- mpd_sint8 state;
- mpd_sint8 closeAudio;
+ mpd_sint8 volatile stop;
+ mpd_sint8 volatile play;
+ mpd_sint8 volatile pause;
+ mpd_sint8 volatile state;
+ mpd_sint8 volatile closeAudio;
mpd_sint8 error;
mpd_uint16 bitRate;
mpd_sint8 bits;
@@ -67,16 +67,16 @@ typedef struct _PlayerControl {
float elapsedTime;
char file[MAXPATHLEN+1];
char erroredFile[MAXPATHLEN+1];
- mpd_sint8 queueState;
- mpd_sint8 queueLockState;
- mpd_sint8 lockQueue;
- mpd_sint8 unlockQueue;
- mpd_sint8 seek;
+ mpd_sint8 volatile queueState;
+ mpd_sint8 volatile queueLockState;
+ mpd_sint8 volatile lockQueue;
+ mpd_sint8 volatile unlockQueue;
+ mpd_sint8 volatile seek;
double seekWhere;
float crossFade;
mpd_uint16 softwareVolume;
double totalPlayTime;
- int decode_pid;
+ int volatile decode_pid;
} PlayerControl;
void player_sigChldHandler(int pid, int status);
diff --git a/src/playerData.h b/src/playerData.h
index 52cbba1be..353c33c66 100644
--- a/src/playerData.h
+++ b/src/playerData.h
@@ -33,14 +33,14 @@ extern int buffered_before_play;
extern int buffered_chunks;
typedef struct _Buffer {
- char * chunks;
- mpd_uint16 * chunkSize;
- mpd_uint16 * bitRate;
- float * times;
- mpd_sint16 begin;
- mpd_sint16 end;
- mpd_sint16 next;
- mpd_sint8 wrap;
+ char * volatile chunks;
+ mpd_uint16 * volatile chunkSize;
+ mpd_uint16 * volatile bitRate;
+ float * volatile times;
+ mpd_sint16 volatile begin;
+ mpd_sint16 volatile end;
+ mpd_sint16 volatile next;
+ mpd_sint8 volatile wrap;
float totalTime;
} Buffer;