OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkFlags.h" | 8 #include "SkFlags.h" |
9 | 9 |
10 SkFlagInfo* SkFlags::gHead; | 10 SkFlagInfo* SkFlags::gHead; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 flag->setDouble(atof(argv[i])); | 150 flag->setDouble(atof(argv[i])); |
151 break; | 151 break; |
152 default: | 152 default: |
153 SkASSERT(!"Invalid flag type"); | 153 SkASSERT(!"Invalid flag type"); |
154 } | 154 } |
155 break; | 155 break; |
156 } | 156 } |
157 flag = flag->next(); | 157 flag = flag->next(); |
158 } | 158 } |
159 if (!flagMatched) { | 159 if (!flagMatched) { |
160 SkDebugf("skipping unknown flag %s\n", argv[i]); | 160 SkDebugf("Got unknown flag \"%s\". Exiting.\n", argv[i]); |
| 161 exit(-1); |
161 } | 162 } |
162 } | 163 } |
163 } | 164 } |
164 // Since all of the flags have been set, release the memory used by each | 165 // Since all of the flags have been set, release the memory used by each |
165 // flag. FLAGS_x can still be used after this. | 166 // flag. FLAGS_x can still be used after this. |
166 SkFlagInfo* flag = gHead; | 167 SkFlagInfo* flag = gHead; |
167 gHead = NULL; | 168 gHead = NULL; |
168 while (flag != NULL) { | 169 while (flag != NULL) { |
169 SkFlagInfo* next = flag->next(); | 170 SkFlagInfo* next = flag->next(); |
170 SkDELETE(flag); | 171 SkDELETE(flag); |
171 flag = next; | 172 flag = next; |
172 } | 173 } |
173 if (helpPrinted) { | 174 if (helpPrinted) { |
174 exit(0); | 175 exit(0); |
175 } | 176 } |
176 } | 177 } |
OLD | NEW |