]> sigrok.org Git - libsigrok.git/blobdiff - datastore.c
Change SIGROK_ prefix to SR_.
[libsigrok.git] / datastore.c
index 75cd243b6ed964c46f92ea5d984c555b8d287145..31dc770ecec3970ee3a3cad30e5c062d65bd5f02 100644 (file)
@@ -28,19 +28,19 @@ static gpointer new_chunk(struct datastore **ds);
 int datastore_new(int unitsize, struct datastore **ds)
 {
        if (!ds)
-               return SIGROK_ERR;
+               return SR_ERR;
 
        if (unitsize <= 0)
-               return SIGROK_ERR; /* TODO: Different error? */
+               return SR_ERR; /* TODO: Different error? */
 
        if (!(*ds = g_malloc(sizeof(struct datastore))))
-               return SIGROK_ERR_MALLOC;
+               return SR_ERR_MALLOC;
 
        (*ds)->ds_unitsize = unitsize;
        (*ds)->num_units = 0;
        (*ds)->chunklist = NULL;
 
-       return SIGROK_OK;
+       return SR_OK;
 }
 
 int datastore_destroy(struct datastore *ds)
@@ -48,14 +48,14 @@ int datastore_destroy(struct datastore *ds)
        GSList *chunk;
 
        if (!ds)
-               return SIGROK_ERR;
-       
+               return SR_ERR;
+
        for (chunk = ds->chunklist; chunk; chunk = chunk->next)
                g_free(chunk->data);
        g_slist_free(ds->chunklist);
        g_free(ds);
 
-       return SIGROK_OK;
+       return SR_OK;
 }
 
 void datastore_put(struct datastore *ds, void *data, unsigned int length,
@@ -65,7 +65,7 @@ void datastore_put(struct datastore *ds, void *data, unsigned int length,
        int capacity, size, num_chunks, chunk_bytes_free, chunk_offset;
        gpointer chunk;
 
-       /* QUICK HACK */
+       /* Avoid compiler warnings. */
        in_unitsize = in_unitsize;
        probelist = probelist;