]> sigrok.org Git - libsigrokdecode.git/commitdiff
constify srd_decoder_list() output
authorBert Vermeulen <redacted>
Tue, 1 Jan 2013 12:04:16 +0000 (13:04 +0100)
committerBert Vermeulen <redacted>
Tue, 1 Jan 2013 12:04:16 +0000 (13:04 +0100)
decoder.c
sigrokdecode.h.in

index 6dfeecae7fa1fa5a5ca6e1c55eb7e27641ffcc49..cbca0b840376c60de504dcc1bd91cdd449c6bef4 100644 (file)
--- a/decoder.c
+++ b/decoder.c
@@ -36,7 +36,7 @@ extern SRD_PRIV PyObject *mod_sigrokdecode;
  *
  * @return List of decoders, NULL if none are supported or loaded.
  */
-SRD_API GSList *srd_decoder_list(void)
+SRD_API const GSList *srd_decoder_list(void)
 {
        return pd_list;
 }
@@ -53,7 +53,7 @@ SRD_API struct srd_decoder *srd_decoder_get_by_id(const char *id)
        GSList *l;
        struct srd_decoder *dec;
 
-       for (l = srd_decoder_list(); l; l = l->next) {
+       for (l = pd_list; l; l = l->next) {
                dec = l->data;
                if (!strcmp(dec->id, id))
                        return dec;
@@ -415,7 +415,7 @@ SRD_API int srd_decoder_unload_all(void)
        GSList *l;
        struct srd_decoder *dec;
 
-       for (l = srd_decoder_list(); l; l = l->next) {
+       for (l = pd_list; l; l = l->next) {
                dec = l->data;
                srd_decoder_unload(dec);
        }
index ad7b602d73dee3ef56741fc49817e65e174feaba..6b05b64db622fc2f61ccba9b1bf5b7be3ac74c62 100644 (file)
@@ -268,7 +268,7 @@ SRD_API int srd_pd_output_callback_add(int output_type,
 
 /*--- decoder.c -------------------------------------------------------------*/
 
-SRD_API GSList *srd_decoder_list(void);
+SRD_API const GSList *srd_decoder_list(void);
 SRD_API struct srd_decoder *srd_decoder_get_by_id(const char *id);
 SRD_API int srd_decoder_load(const char *name);
 SRD_API int srd_decoder_unload(struct srd_decoder *dec);