--- embedaddon/mpd/src/msg.c 2012/02/21 23:32:47 1.1 +++ embedaddon/mpd/src/msg.c 2021/03/17 00:39:23 1.1.1.3 @@ -28,20 +28,25 @@ }; typedef struct mpmsg *Msg; - #define MSG_QUEUE_LEN 8192 - #define MSG_QUEUE_MASK 0x1FFF - - struct mpmsg msgqueue[MSG_QUEUE_LEN]; - int msgqueueh = 0; - int msgqueuet = 0; + static struct mpmsg msgqueue[MSG_QUEUE_LEN]; + static int msgqueueh = 0; + static int msgqueuet = 0; #define QUEUELEN() ((msgqueueh >= msgqueuet)? \ (msgqueueh - msgqueuet):(msgqueueh + MSG_QUEUE_LEN - msgqueuet)) - int msgpipe[2]; - int msgpipesent = 0; - EventRef msgevent; + static int msgpipe[2]; + static int msgpipesent = 0; + static EventRef msgevent; /* + * GLOBAL VARIABLES + */ + + int gQThresMin = 64; + int gQThresMax = 256; + int gQThresDiff = 256 - 64; + +/* * INTERNAL FUNCTIONS */ @@ -98,6 +103,9 @@ static void MsgEvent(int type, void *cookie) { char buf[16]; + + (void)type; + (void)cookie; /* flush signaling pipe */ msgpipesent = 0; while (read(msgpipe[PIPE_READ], buf, sizeof(buf)) == sizeof(buf));