Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
fa1ddc65
Vérifiée
Valider
fa1ddc65
rédigé
Il y a 3 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
MISC: Reduce the 'if/else' statement number for the idle command
parent
cf072b82
Branches
Branches contenant la validation
Étiquettes
Étiquettes contenant la validation
1 requête de fusion
!179
Queue download if update asked per ID
Pipeline
#2542
réussi
Il y a 3 ans
Étape : build
Modifications
1
Pipelines
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
src/base/commands.c
+15
-27
15 ajouts, 27 suppressions
src/base/commands.c
avec
15 ajouts
et
27 suppressions
src/base/commands.c
+
15
−
27
Voir le fichier @
fa1ddc65
...
@@ -591,34 +591,22 @@ command_idle(struct lkt_state *srv, size_t c, char *args[LKT_MESSAGE_ARGS_MAX])
...
@@ -591,34 +591,22 @@ command_idle(struct lkt_state *srv, size_t c, char *args[LKT_MESSAGE_ARGS_MAX])
bool
once
;
bool
once
;
size_t
i
;
size_t
i
;
#pragma message(TODO "Use a lookup table here...")
for
(
once
=
false
,
i
=
0
;
args
[
i
];
++
i
,
once
|=
true
)
{
for
(
once
=
false
,
i
=
0
;
args
[
i
];
++
i
,
once
|=
true
)
{
if
(
STR_MATCH
(
args
[
i
],
"database"
))
MPD_IDLE_FLAG
idle_mask
=
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_DATABASE
);
(
STR_MATCH
(
args
[
i
],
"database"
)
*
MPD_IDLE_DATABASE
)
+
else
if
(
STR_MATCH
(
args
[
i
],
"update"
))
(
STR_MATCH
(
args
[
i
],
"update"
)
*
MPD_IDLE_UPDATE
)
+
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_UPDATE
);
(
STR_MATCH
(
args
[
i
],
"stored_playlist"
)
*
MPD_IDLE_STORED_PLAYLIST
)
+
else
if
(
STR_MATCH
(
args
[
i
],
"stored_playlist"
))
(
STR_MATCH
(
args
[
i
],
"playlist"
)
*
MPD_IDLE_PLAYLIST
)
+
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_STORED_PLAYLIST
);
(
STR_MATCH
(
args
[
i
],
"player"
)
*
MPD_IDLE_PLAYER
)
+
else
if
(
STR_MATCH
(
args
[
i
],
"playlist"
))
(
STR_MATCH
(
args
[
i
],
"mixer"
)
*
MPD_IDLE_MIXER
)
+
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_PLAYLIST
);
(
STR_MATCH
(
args
[
i
],
"output"
)
*
MPD_IDLE_OUTPUT
)
+
else
if
(
STR_MATCH
(
args
[
i
],
"player"
))
(
STR_MATCH
(
args
[
i
],
"options"
)
*
MPD_IDLE_OPTIONS
)
+
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_PLAYER
);
(
STR_MATCH
(
args
[
i
],
"partition"
)
*
MPD_IDLE_PARTITION
)
+
else
if
(
STR_MATCH
(
args
[
i
],
"mixer"
))
(
STR_MATCH
(
args
[
i
],
"sticker"
)
*
MPD_IDLE_STICKER
)
+
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_MIXER
);
(
STR_MATCH
(
args
[
i
],
"subscription"
)
*
MPD_IDLE_SUBSCRIPTION
)
+
else
if
(
STR_MATCH
(
args
[
i
],
"output"
))
(
STR_MATCH
(
args
[
i
],
"message"
)
*
MPD_IDLE_MESSAGE
);
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_OUTPUT
);
idle_mask
=
idle_mask
+
((
unsigned
int
)(
!
(
bool
)(
idle_mask
))
*
MPD_IDLE_ALL
);
else
if
(
STR_MATCH
(
args
[
i
],
"options"
))
lkt_client_add_mask
(
srv
,
c
,
idle_mask
);
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_OPTIONS
);
else
if
(
STR_MATCH
(
args
[
i
],
"partition"
))
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_PARTITION
);
else
if
(
STR_MATCH
(
args
[
i
],
"sticker"
))
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_STICKER
);
else
if
(
STR_MATCH
(
args
[
i
],
"subscription"
))
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_SUBSCRIPTION
);
else
if
(
STR_MATCH
(
args
[
i
],
"message"
))
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_MESSAGE
);
else
lkt_client_add_mask
(
srv
,
c
,
MPD_IDLE_ALL
);
}
}
if
(
!
once
)
if
(
!
once
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter