diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-03-26 18:36:31 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-03-26 18:36:31 +0000 |
commit | a33d5d7926ba83530063f719df0177c6ffe33c3a (patch) | |
tree | 79b86d5caad832b758aba723ef5b92e16d716236 | |
parent | e9721bff5822b474efc457720212d68293f95a14 (diff) | |
download | rockbox-a33d5d7926ba83530063f719df0177c6ffe33c3a.tar.gz rockbox-a33d5d7926ba83530063f719df0177c6ffe33c3a.zip |
Fixed the define in config.h and more tagcache alignment issues.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9266 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/tagcache.c | 13 | ||||
-rw-r--r-- | firmware/export/config.h | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index 850eaf9733..b485eb4647 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -783,7 +783,7 @@ static bool tempbuf_unique_insert(char *str, int id) | |||
783 | if (!strcasecmp(str, index[i].str)) | 783 | if (!strcasecmp(str, index[i].str)) |
784 | { | 784 | { |
785 | tempbuf_left -= sizeof(struct tempbuf_id); | 785 | tempbuf_left -= sizeof(struct tempbuf_id); |
786 | if (tempbuf_left < 0) | 786 | if (tempbuf_left - 4 < 0) |
787 | return false; | 787 | return false; |
788 | 788 | ||
789 | idp = index[i].id; | 789 | idp = index[i].id; |
@@ -791,6 +791,17 @@ static bool tempbuf_unique_insert(char *str, int id) | |||
791 | idp = idp->next; | 791 | idp = idp->next; |
792 | 792 | ||
793 | idp->next = (struct tempbuf_id *)&tempbuf[tempbuf_pos]; | 793 | idp->next = (struct tempbuf_id *)&tempbuf[tempbuf_pos]; |
794 | #ifdef ROCKBOX_STRICT_ALIGN | ||
795 | /* Make sure the entry is long aligned. */ | ||
796 | if ((long)idp->next & 0x03) | ||
797 | { | ||
798 | int fix = 4 - ((long)idp->next & 0x03); | ||
799 | tempbuf_left -= fix; | ||
800 | tempbuf_pos += fix; | ||
801 | idp->next = (struct tempbuf_id *)(( | ||
802 | (long)idp->next & ~0x03) + 0x04); | ||
803 | } | ||
804 | #endif | ||
794 | idp = idp->next; | 805 | idp = idp->next; |
795 | idp->id = id; | 806 | idp->id = id; |
796 | idp->next = NULL; | 807 | idp->next = NULL; |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 5ac333d5e4..f99007304d 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -192,7 +192,7 @@ | |||
192 | #endif | 192 | #endif |
193 | 193 | ||
194 | /* Determine if accesses should be strictly long aligned. */ | 194 | /* Determine if accesses should be strictly long aligned. */ |
195 | #if (CONFIG_CPU == SH7034) || (CONFIG_CPU == CPU_ARM) | 195 | #if (CONFIG_CPU == SH7034) || defined(CPU_ARM) |
196 | #define ROCKBOX_STRICT_ALIGN 1 | 196 | #define ROCKBOX_STRICT_ALIGN 1 |
197 | #endif | 197 | #endif |
198 | 198 | ||