diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-13 03:13:01 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-13 03:13:01 +0000 |
commit | 35b09cb615260a2d203da63b61587ba748e03727 (patch) | |
tree | 579cb6688731ba89fe144eb50ddb210410866eae | |
parent | 3f06273e7cb2d84e152d2d2f26d68d489a024e7e (diff) | |
download | rockbox-35b09cb615260a2d203da63b61587ba748e03727.tar.gz rockbox-35b09cb615260a2d203da63b61587ba748e03727.zip |
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
-rw-r--r-- | utils/themeeditor/parsetreenode.cpp | 8 | ||||
-rw-r--r-- | utils/themeeditor/skin_debug.c | 3 | ||||
-rw-r--r-- | utils/themeeditor/skin_parser.c | 1 | ||||
-rw-r--r-- | utils/themeeditor/skin_parser.h | 1 |
4 files changed, 12 insertions, 1 deletions
diff --git a/utils/themeeditor/parsetreenode.cpp b/utils/themeeditor/parsetreenode.cpp index d3a1a71c93..397031aee1 100644 --- a/utils/themeeditor/parsetreenode.cpp +++ b/utils/themeeditor/parsetreenode.cpp | |||
@@ -106,7 +106,8 @@ QString ParseTreeNode::genCode() const | |||
106 | { | 106 | { |
107 | switch(element->type) | 107 | switch(element->type) |
108 | { | 108 | { |
109 | 109 | case UNKNOWN: | |
110 | break; | ||
110 | case VIEWPORT: | 111 | case VIEWPORT: |
111 | /* Generating the Viewport tag, if necessary */ | 112 | /* Generating the Viewport tag, if necessary */ |
112 | if(element->tag) | 113 | if(element->tag) |
@@ -263,6 +264,8 @@ int ParseTreeNode::genHash() const | |||
263 | hash += element->type; | 264 | hash += element->type; |
264 | switch(element->type) | 265 | switch(element->type) |
265 | { | 266 | { |
267 | case UNKNOWN: | ||
268 | break; | ||
266 | case VIEWPORT: | 269 | case VIEWPORT: |
267 | case LINE: | 270 | case LINE: |
268 | case SUBLINES: | 271 | case SUBLINES: |
@@ -346,6 +349,8 @@ QVariant ParseTreeNode::data(int column) const | |||
346 | { | 349 | { |
347 | switch(element->type) | 350 | switch(element->type) |
348 | { | 351 | { |
352 | case UNKNOWN: | ||
353 | return QObject::tr("Unknown"); | ||
349 | case VIEWPORT: | 354 | case VIEWPORT: |
350 | return QObject::tr("Viewport"); | 355 | return QObject::tr("Viewport"); |
351 | 356 | ||
@@ -397,6 +402,7 @@ QVariant ParseTreeNode::data(int column) const | |||
397 | { | 402 | { |
398 | switch(element->type) | 403 | switch(element->type) |
399 | { | 404 | { |
405 | case UNKNOWN: | ||
400 | case VIEWPORT: | 406 | case VIEWPORT: |
401 | case LINE: | 407 | case LINE: |
402 | case SUBLINES: | 408 | case SUBLINES: |
diff --git a/utils/themeeditor/skin_debug.c b/utils/themeeditor/skin_debug.c index 9a463c91e6..549f7b9e6c 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) | |||
112 | 112 | ||
113 | switch(current->type) | 113 | switch(current->type) |
114 | { | 114 | { |
115 | case UNKNOWN: | ||
116 | printf("[ Unknown element.. error\n]"); | ||
117 | break; | ||
115 | 118 | ||
116 | case VIEWPORT: | 119 | case VIEWPORT: |
117 | printf("[ Viewport \n"); | 120 | printf("[ Viewport \n"); |
diff --git a/utils/themeeditor/skin_parser.c b/utils/themeeditor/skin_parser.c index bf7ca8d7f6..93a71919bf 100644 --- a/utils/themeeditor/skin_parser.c +++ b/utils/themeeditor/skin_parser.c | |||
@@ -860,6 +860,7 @@ struct skin_element* skin_alloc_element() | |||
860 | { | 860 | { |
861 | struct skin_element* retval = (struct skin_element*) | 861 | struct skin_element* retval = (struct skin_element*) |
862 | skin_alloc(sizeof(struct skin_element)); | 862 | skin_alloc(sizeof(struct skin_element)); |
863 | retval->type = UNKNOWN; | ||
863 | retval->next = NULL; | 864 | retval->next = NULL; |
864 | retval->tag = NULL; | 865 | retval->tag = NULL; |
865 | retval->params_count = 0; | 866 | retval->params_count = 0; |
diff --git a/utils/themeeditor/skin_parser.h b/utils/themeeditor/skin_parser.h index c15ba9da8d..1fc4a7ae6b 100644 --- a/utils/themeeditor/skin_parser.h +++ b/utils/themeeditor/skin_parser.h | |||
@@ -35,6 +35,7 @@ extern "C" | |||
35 | /* Possible types of element in a WPS file */ | 35 | /* Possible types of element in a WPS file */ |
36 | enum skin_element_type | 36 | enum skin_element_type |
37 | { | 37 | { |
38 | UNKNOWN = -1, | ||
38 | VIEWPORT, | 39 | VIEWPORT, |
39 | LINE, | 40 | LINE, |
40 | SUBLINES, | 41 | SUBLINES, |