]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - stat.c
Avoid some gcc warnings.
[paraslash.git] / stat.c
diff --git a/stat.c b/stat.c
index 5b1c033e7ab2c42de82457c5f080b60146a5053a..59ac4235eb28da84ac2cd154a4425ca539f3b16b 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -44,45 +44,8 @@ static struct list_head client_list;
 static int initialized;
 static int num_clients;
 
-/** The list of all status items used by para_server/para_audiod. */
-const char *status_item_list[NUM_STAT_ITEMS] = {
-       [SI_BASENAME] = "basename",
-       [SI_STATUS] = "status",
-       [SI_NUM_PLAYED] = "num_played",
-
-       [SI_MTIME] = "mtime",
-       [SI_LENGTH_MIN] = "length_min",
-       [SI_LENGTH_SEC] = "length_sec",
-
-       [SI_FILE_SIZE] = "file_size",
-       [SI_STATUS_FLAGS] = "status_flags",
-       [SI_FORMAT] = "format",
-
-       [SI_SCORE] = "score",
-       [SI_AUDIO_FILE_INFO] = "audio_file_info",
-
-       [SI_TAG_INFO1] = "taginfo1",
-       [SI_TAG_INFO2] =  "taginfo2",
-       [SI_AFS_MODE] = "afs_mode",
-       [SI_ATTRIBUTES] = "attributes",
-
-       [SI_DIRECTORY] = "dir",
-       [SI_DECODER_FLAGS] = "decoder_flags",
-       [SI_AUDIOD_STATUS] = "audiod_status",
-
-       [SI_PLAY_TIME] = "play_time",
-       [SI_UPTIME] = "uptime",
-       [SI_OFFSET] = "offset",
-
-       [SI_SECONDS_TOTAL] = "seconds_total",
-       [SI_STREAM_START] = "stream_start",
-       [SI_CURRENT_TIME] = "current_time",
-
-       [SI_AUDIOD_UPTIME] = "audiod_uptime",
-       [SI_IMAGE_ID] = "image_id",
-       [SI_LYRICS_ID] = "lyrics_id",
-       [SI_DURATION] = "duration"
-};
+/** The list of all status items used by para_{server,audiod,gui}. */
+const char *status_item_list[] = {STATUS_ITEM_ARRAY};
 
 static void dump_stat_client_list(void)
 {
@@ -186,7 +149,7 @@ int stat_item_valid(const char *item)
                PARA_ERROR_LOG("%s\n", "no item");
                return -E_UNKNOWN_STAT_ITEM;
        }
-       FOR_EACH_STAT_ITEM(i)
+       FOR_EACH_STATUS_ITEM(i)
                if (!strcmp(status_item_list[i], item))
                        return i;
        PARA_ERROR_LOG("invalid stat item: %s\n", item);
@@ -210,7 +173,7 @@ int stat_line_valid(const char *line)
        if (!line || !*line)
                return -E_UNKNOWN_STAT_ITEM;
        line_len = strlen(line);
-       FOR_EACH_STAT_ITEM(i) {
+       FOR_EACH_STATUS_ITEM(i) {
                const char *s = status_item_list[i];
                size_t item_len = strlen(s);