A generic touchscreen calibration program for X.Org
Revision | dd263d405a8ae109e1439c52dbabb55352d95bd0 (tree) |
---|---|
Time | 2013-01-23 02:34:11 |
Author | Andreas Müller <schnitzeltony@goog...> |
Commiter | Andreas Müller |
Set up buffer size for max line length only once in calibrator.hh
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
@@ -30,6 +30,9 @@ | ||
30 | 30 | #include <stdio.h> |
31 | 31 | #include <vector> |
32 | 32 | |
33 | +// XXX: we currently don't handle lines that are longer than this | |
34 | +#define MAX_LINE_LEN 1024 | |
35 | + | |
33 | 36 | int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min); |
34 | 37 | float scaleAxis(float Cx, int to_max, int to_min, int from_max, int from_min); |
35 | 38 |
@@ -39,9 +39,6 @@ | ||
39 | 39 | #define EXIT_FAILURE 0 |
40 | 40 | #endif |
41 | 41 | |
42 | -// XXX: we currently don't handle lines that are longer than this | |
43 | -#define MAX_LINE_LEN 1024 | |
44 | - | |
45 | 42 | // Constructor |
46 | 43 | CalibratorEvdev::CalibratorEvdev(const char* const device_name0, |
47 | 44 | const XYinfo& axys0, |
@@ -114,7 +114,7 @@ bool CalibratorUsbtouchscreen::finish_data(const XYinfo new_axys) | ||
114 | 114 | } |
115 | 115 | |
116 | 116 | std::string new_contents; |
117 | - const int len = 1024; // XXX: we currently don't handle lines that are longer than this | |
117 | + const int len = MAX_LINE_LEN; | |
118 | 118 | char line[len]; |
119 | 119 | const char *opt = "options usbtouchscreen"; |
120 | 120 | const int opt_len = strlen(opt); |
@@ -24,9 +24,6 @@ | ||
24 | 24 | |
25 | 25 | #include <cstdio> |
26 | 26 | |
27 | -// XXX: we currently don't handle lines that are longer than this | |
28 | -#define MAX_LINE_LEN 1024 | |
29 | - | |
30 | 27 | CalibratorXorgPrint::CalibratorXorgPrint(const char* const device_name0, const XYinfo& axys0, const int thr_misclick, const int thr_doubleclick, const OutputType output_type, const char* geometry, const bool use_timeout, const char* output_filename) |
31 | 28 | : Calibrator(device_name0, axys0, thr_misclick, thr_doubleclick, output_type, geometry, use_timeout, output_filename) |
32 | 29 | { |