| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 3 * Distributed under the terms of the GNU General Public License v2 | 3 * Distributed under the terms of the GNU General Public License v2 |
| 4 */ | 4 */ |
| 5 | 5 |
| 6 #include <float.h> | 6 #include <float.h> |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <ncurses.h> | 8 #include <ncurses.h> |
| 9 #include <signal.h> | 9 #include <signal.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 void pr_pixel(pixel_s p) | 22 void pr_pixel(pixel_s p) |
| 23 { | 23 { |
| 24 fprintf(stderr, "colx=%d row=%d\n", p.col, p.row); | 24 fprintf(stderr, "colx=%d row=%d\n", p.col, p.row); |
| 25 } | 25 } |
| 26 | 26 |
| 27 vector_s new_vector(int n) | 27 vector_s new_vector(int n) |
| 28 { | 28 { |
| 29 vector_s v; | 29 vector_s v; |
| 30 | 30 |
| 31 if (!n) { | 31 if (!n) { |
| 32 v.n = 0; |
| 32 v.p = NULL; | 33 v.p = NULL; |
| 33 return v; | 34 return v; |
| 34 } | 35 } |
| 35 v.p = ezalloc(n * sizeof(*v.p)); | 36 v.p = ezalloc(n * sizeof(*v.p)); |
| 36 v.n = n; | 37 v.n = n; |
| 37 return v; | 38 return v; |
| 38 } | 39 } |
| 39 | 40 |
| 40 static int x2col(graph_s *g, double x) | 41 static int x2col(graph_s *g, double x) |
| 41 { | 42 { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 { | 154 { |
| 154 set_signals(); | 155 set_signals(); |
| 155 init(); | 156 init(); |
| 156 graph(); | 157 graph(); |
| 157 refresh(); | 158 refresh(); |
| 158 getchar(); | 159 getchar(); |
| 159 cleanup(0); | 160 cleanup(0); |
| 160 return 0; | 161 return 0; |
| 161 } | 162 } |
| 162 #endif | 163 #endif |
| OLD | NEW |