OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 new_node->warning_string = warning_string; | 47 new_node->warning_string = warning_string; |
48 new_node->next_warning = NULL; | 48 new_node->next_warning = NULL; |
49 | 49 |
50 while (*node != NULL) | 50 while (*node != NULL) |
51 node = &(*node)->next_warning; | 51 node = &(*node)->next_warning; |
52 | 52 |
53 *node = new_node; | 53 *node = new_node; |
54 } | 54 } |
55 | 55 |
56 static void free_warning_list(struct WarningList *warning_list) { | 56 static void free_warning_list(struct WarningList *warning_list) { |
57 struct WarningListNode *node = warning_list->warning_node; | |
58 while (warning_list->warning_node != NULL) { | 57 while (warning_list->warning_node != NULL) { |
59 node = warning_list->warning_node->next_warning; | 58 struct WarningListNode *const node = warning_list->warning_node; |
60 free(warning_list->warning_node); | 59 warning_list->warning_node = node->next_warning; |
61 warning_list->warning_node = node; | 60 free(node); |
62 } | 61 } |
63 } | 62 } |
64 | 63 |
65 static int continue_prompt(int num_warnings) { | 64 static int continue_prompt(int num_warnings) { |
66 int c; | 65 int c; |
67 fprintf(stderr, | 66 fprintf(stderr, |
68 "%d encoder configuration warning(s). Continue? (y to continue) ", | 67 "%d encoder configuration warning(s). Continue? (y to continue) ", |
69 num_warnings); | 68 num_warnings); |
70 c = getchar(); | 69 c = getchar(); |
71 return c == 'y'; | 70 return c == 'y'; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 warn(warning->warning_string); | 106 warn(warning->warning_string); |
108 } | 107 } |
109 | 108 |
110 free_warning_list(&warning_list); | 109 free_warning_list(&warning_list); |
111 | 110 |
112 if (num_warnings) { | 111 if (num_warnings) { |
113 if (!disable_prompt && !continue_prompt(num_warnings)) | 112 if (!disable_prompt && !continue_prompt(num_warnings)) |
114 exit(EXIT_FAILURE); | 113 exit(EXIT_FAILURE); |
115 } | 114 } |
116 } | 115 } |
OLD | NEW |