summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-06-13 03:13:01 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-06-13 03:13:01 +0000
commit35b09cb615260a2d203da63b61587ba748e03727 (patch)
tree579cb6688731ba89fe144eb50ddb210410866eae /utils
parent3f06273e7cb2d84e152d2d2f26d68d489a024e7e (diff)
downloadrockbox-35b09cb615260a2d203da63b61587ba748e03727.zip
rockbox-35b09cb615260a2d203da63b61587ba748e03727.tar.gz
rockbox-35b09cb615260a2d203da63b61587ba748e03727.tar.bz2
rockbox-35b09cb615260a2d203da63b61587ba748e03727.tar.xz
initialise the element->type value so TAG types dont accidently get VIEWPORT if it element->type == 0 at alloc time
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26825 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-rw-r--r--utils/themeeditor/parsetreenode.cpp8
-rw-r--r--utils/themeeditor/skin_debug.c3
-rw-r--r--utils/themeeditor/skin_parser.c1
-rw-r--r--utils/themeeditor/skin_parser.h1
4 files changed, 12 insertions, 1 deletions
diff --git a/utils/themeeditor/parsetreenode.cpp b/utils/themeeditor/parsetreenode.cpp
index d3a1a71..397031a 100644
--- a/utils/themeeditor/parsetreenode.cpp
+++ b/utils/themeeditor/parsetreenode.cpp
@@ -106,7 +106,8 @@ QString ParseTreeNode::genCode() const
{
switch(element->type)
{
-
+ case UNKNOWN:
+ break;
case VIEWPORT:
/* Generating the Viewport tag, if necessary */
if(element->tag)
@@ -263,6 +264,8 @@ int ParseTreeNode::genHash() const
hash += element->type;
switch(element->type)
{
+ case UNKNOWN:
+ break;
case VIEWPORT:
case LINE:
case SUBLINES:
@@ -346,6 +349,8 @@ QVariant ParseTreeNode::data(int column) const
{
switch(element->type)
{
+ case UNKNOWN:
+ return QObject::tr("Unknown");
case VIEWPORT:
return QObject::tr("Viewport");
@@ -397,6 +402,7 @@ QVariant ParseTreeNode::data(int column) const
{
switch(element->type)
{
+ case UNKNOWN:
case VIEWPORT:
case LINE:
case SUBLINES:
diff --git a/utils/themeeditor/skin_debug.c b/utils/themeeditor/skin_debug.c
index 9a463c9..549f7b9 100644
--- a/utils/themeeditor/skin_debug.c
+++ b/utils/themeeditor/skin_debug.c
@@ -112,6 +112,9 @@ void skin_debug_tree(struct skin_element* root)
switch(current->type)
{
+ case UNKNOWN:
+ printf("[ Unknown element.. error\n]");
+ break;
case VIEWPORT:
printf("[ Viewport \n");
diff --git a/utils/themeeditor/skin_parser.c b/utils/themeeditor/skin_parser.c
index bf7ca8d..93a7191 100644
--- a/utils/themeeditor/skin_parser.c
+++ b/utils/themeeditor/skin_parser.c
@@ -860,6 +860,7 @@ struct skin_element* skin_alloc_element()
{
struct skin_element* retval = (struct skin_element*)
skin_alloc(sizeof(struct skin_element));
+ retval->type = UNKNOWN;
retval->next = NULL;
retval->tag = NULL;
retval->params_count = 0;
diff --git a/utils/themeeditor/skin_parser.h b/utils/themeeditor/skin_parser.h
index c15ba9d..1fc4a7a 100644
--- a/utils/themeeditor/skin_parser.h
+++ b/utils/themeeditor/skin_parser.h
@@ -35,6 +35,7 @@ extern "C"
/* Possible types of element in a WPS file */
enum skin_element_type
{
+ UNKNOWN = -1,
VIEWPORT,
LINE,
SUBLINES,