Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#12095 - Logical-or operator for tagnavi conditionals

Attached to Project: Rockbox
Opened by sideral (sideral) - Wednesday, 04 May 2011, 00:41 GMT+2
Last edited by sideral (sideral) - Tuesday, 10 May 2011, 12:32 GMT+2
Task Type Patches
Category Database
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This patch adds a logical-or operator ("|") for tagnavi conditionals.

Logical-and ("&") always takes precedence over logical-or. (Brackets are not supported.)

Example:

"Unfinished Podcasts" -> album ? filename ^ "/<microSD1>/PODCASTS" & playcount == "0" | filename ^ "/<microSD1>/PODCASTS" & lastoffset > "0" -> title = "fmt_title"
   logical-or.diff (3.7 KiB)
 b/apps/tagcache.c |   44 ++++++++++++++++++++++++++------------------
 b/apps/tagcache.h |    2 +-
 b/apps/tagtree.c  |    8 +++++++-
 3 files changed, 34 insertions(+), 20 deletions(-)

This task depends upon

Closed by  sideral (sideral)
Tuesday, 10 May 2011, 12:32 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Committed as r29851
Comment by sideral (sideral) - Wednesday, 04 May 2011, 23:24 GMT+2
New patch revision with the following changes:

* check_clauses: Correct size calculations for data read from disk.
* Fail a clause (i.e., return false rather than true) in case of errors (tag deleted or too long).
* Binsize optimization: Store some common expressions in local variables to avoid repeated reevaluation involving memory accesses.
* Minor cleanups and commenting.
* [EDIT:] Add checks to functions inspecting search clauses to prevent them from crashing trying to dereference undefined fields in logical-or clauses.
* [EDIT2:] Fix a functional bug introduced with the binsize optimization
   logical-or.v4.diff (8.1 KiB)
 b/apps/tagcache.c |  103 ++++++++++++++++++++++++++++++------------------------
 b/apps/tagcache.h |    2 -
 b/apps/tagtree.c  |   24 +++++++++---
 3 files changed, 78 insertions(+), 51 deletions(-)

Loading...