Skip to content

Commit 0e3a442

Browse files
committed
fixes
1 parent 4f7b0ea commit 0e3a442

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

libatalk/cnid/sqlite/cnid_sqlite.c

+10-13
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939

4040

4141
sqlite3_stmt *stmt = NULL;
42-
// CK static MYSQL_BIND lookup_param[4], lookup_result[5];
43-
// CK static MYSQL_BIND add_param[4], put_param[5];
4442

4543
/*
4644
* Prepared statement parameters
@@ -248,7 +246,7 @@ void cnid_sqlite_close(struct _cnid_db *cdb)
248246
int cnid_sqlite_update(struct _cnid_db *cdb,
249247
cnid_t id,
250248
const struct stat *st,
251-
const cnid_t did, char *name, size_t len)
249+
cnid_t did, const char *name, size_t len)
252250
{
253251
EC_INIT;
254252
CNID_sqlite_private *db;
@@ -320,7 +318,7 @@ int cnid_sqlite_update(struct _cnid_db *cdb,
320318

321319
cnid_t cnid_sqlite_lookup(struct _cnid_db *cdb,
322320
const struct stat *st,
323-
const cnid_t did, char *name, const size_t len)
321+
cnid_t did, const char *name, size_t len)
324322
{
325323
EC_INIT;
326324

@@ -530,7 +528,7 @@ cnid_t cnid_sqlite_add(struct _cnid_db *cdb,
530528

531529
lastid = sqlite3_last_insert_rowid(db->cnid_sqlite_con);
532530

533-
if (lastid > 0xffffffff) { /* CK this is wrong */
531+
if (lastid > 0xffffffff) { /* FIXME: this is wrong */
534532
/* CNID set is depleted, restart from scratch */
535533
EC_NEG1(cnid_sqlite_execute
536534
(db->cnid_sqlite_con,
@@ -563,15 +561,15 @@ cnid_t cnid_sqlite_add(struct _cnid_db *cdb,
563561
}
564562
} while (id == CNID_INVALID);
565563

566-
EC_CLEANUP:
564+
EC_CLEANUP:
567565
LOG(log_debug, logtype_cnid, "cnid_sqlite_add: id: %" PRIu32,
568566
ntohl(id));
569567

570568
return id;
571569
}
572570

573-
cnid_t cnid_sqlite_get(struct _cnid_db *cdb, const cnid_t did, char *name,
574-
const size_t len)
571+
cnid_t cnid_sqlite_get(struct _cnid_db *cdb, cnid_t did, const char *name,
572+
size_t len)
575573
{
576574
EC_INIT;
577575
CNID_sqlite_private *db;
@@ -663,7 +661,7 @@ char *cnid_sqlite_resolve(struct _cnid_db *cdb, cnid_t * id, void *buffer,
663661
if (transient_stmt)
664662
sqlite3_finalize(transient_stmt);
665663

666-
#if 0 // handle this CK
664+
#if 0 // FIXME: handle this
667665
if (ret != 0) {
668666
*id = CNID_INVALID;
669667
return NULL;
@@ -728,7 +726,7 @@ int cnid_sqlite_find(struct _cnid_db *cdb, const char *name, size_t namelen,
728726
}
729727

730728
cnid_t cnid_sqlite_rebuild_add(struct _cnid_db *cdb, const struct stat *st,
731-
const cnid_t did, char *name, const size_t len,
729+
cnid_t did, const char *name, size_t len,
732730
cnid_t hint)
733731
{
734732
LOG(log_error, logtype_cnid,
@@ -775,7 +773,6 @@ static struct _cnid_db *cnid_sqlite_new(struct vol *vol)
775773

776774
cdb->cnid_db_vol = vol;
777775
cdb->cnid_db_flags = CNID_FLAG_PERSISTENT | CNID_FLAG_LAZY_INIT;
778-
779776
cdb->cnid_add = cnid_sqlite_add;
780777
cdb->cnid_delete = cnid_sqlite_delete;
781778
cdb->cnid_get = cnid_sqlite_get;
@@ -857,7 +854,7 @@ struct _cnid_db *cnid_sqlite_open(struct cnid_open_args *args)
857854
strlen(stamp), SQLITE_STATIC) );
858855

859856
sqlite3_step(transient_stmt);
860-
#if 0 // CK must figure out how to check for failed insert
857+
#if 0 // FIXME: must figure out how to check for failed insert
861858
if (sqlite3_step(transient_stmt)) {
862859
if (mysql_errno(db->cnid_sqlite_con) != ER_DUP_ENTRY) {
863860
LOG(log_error, logtype_cnid,
@@ -869,7 +866,7 @@ struct _cnid_db *cnid_sqlite_open(struct cnid_open_args *args)
869866
#endif
870867
sqlite3_finalize(transient_stmt);
871868

872-
#if 0 // CK FIX!
869+
#if 0 // FIXME
873870
/*
874871
* Check whether CNID set overflowed before.
875872
* If that's the case, in cnid_sqlite_add() we'll ignore the CNID

0 commit comments

Comments
 (0)