changeset 221:8db9830e5d97

Constify.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Dec 2019 11:07:21 +0200
parents e79a93971d27
children 3a01518fffe0
files sidlib.c sidlib.h
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sidlib.c	Fri Dec 27 11:06:55 2019 +0200
+++ b/sidlib.c	Fri Dec 27 11:07:21 2019 +0200
@@ -677,7 +677,7 @@
 }
 
 
-int si_sldb_write_bin(th_ioctx *ctx, SIDLibSLDB *dbh)
+int si_sldb_write_bin(th_ioctx *ctx, const SIDLibSLDB *dbh)
 {
     th_md5state_t state;
     th_md5hash_t hash;
@@ -700,7 +700,7 @@
     // Write nodes
     for (n = 0; n < dbh->nnodes; n++)
     {
-        SIDLibSLDBNode *node = dbh->pindex[n];
+        const SIDLibSLDBNode *node = dbh->pindex[n];
         uint16_t tmpn;
         int index;
 
@@ -730,6 +730,7 @@
     }
 
     th_md5_finish(&state, hash);
+
     if (!thfwrite_str(ctx, hash, sizeof(hash)))
         return THERR_FWRITE;
 
--- a/sidlib.h	Fri Dec 27 11:06:55 2019 +0200
+++ b/sidlib.h	Fri Dec 27 11:07:21 2019 +0200
@@ -113,7 +113,7 @@
 SIDLibSLDBNode * si_sldb_get_by_hash(SIDLibSLDB *dbh, th_md5hash_t hash);
 
 int              si_sldb_read_bin(th_ioctx *ctx, SIDLibSLDB *dbh);
-int              si_sldb_write_bin(th_ioctx *ctx, SIDLibSLDB *dbh);
+int              si_sldb_write_bin(th_ioctx *ctx, const SIDLibSLDB *dbh);
 
 
 #ifdef __cplusplus