• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A generic touchscreen calibration program for X.Org


Commit MetaInfo

Revisiondd263d405a8ae109e1439c52dbabb55352d95bd0 (tree)
Time2013-01-23 02:34:11
AuthorAndreas Müller <schnitzeltony@goog...>
CommiterAndreas Müller

Log Message

Set up buffer size for max line length only once in calibrator.hh

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>

Change Summary

Incremental Difference

--- a/src/calibrator.hh
+++ b/src/calibrator.hh
@@ -30,6 +30,9 @@
3030 #include <stdio.h>
3131 #include <vector>
3232
33+// XXX: we currently don't handle lines that are longer than this
34+#define MAX_LINE_LEN 1024
35+
3336 int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min);
3437 float scaleAxis(float Cx, int to_max, int to_min, int from_max, int from_min);
3538
--- a/src/calibrator/Evdev.cpp
+++ b/src/calibrator/Evdev.cpp
@@ -39,9 +39,6 @@
3939 #define EXIT_FAILURE 0
4040 #endif
4141
42-// XXX: we currently don't handle lines that are longer than this
43-#define MAX_LINE_LEN 1024
44-
4542 // Constructor
4643 CalibratorEvdev::CalibratorEvdev(const char* const device_name0,
4744 const XYinfo& axys0,
--- a/src/calibrator/Usbtouchscreen.cpp
+++ b/src/calibrator/Usbtouchscreen.cpp
@@ -114,7 +114,7 @@ bool CalibratorUsbtouchscreen::finish_data(const XYinfo new_axys)
114114 }
115115
116116 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;
118118 char line[len];
119119 const char *opt = "options usbtouchscreen";
120120 const int opt_len = strlen(opt);
--- a/src/calibrator/XorgPrint.cpp
+++ b/src/calibrator/XorgPrint.cpp
@@ -24,9 +24,6 @@
2424
2525 #include <cstdio>
2626
27-// XXX: we currently don't handle lines that are longer than this
28-#define MAX_LINE_LEN 1024
29-
3027 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)
3128 : Calibrator(device_name0, axys0, thr_misclick, thr_doubleclick, output_type, geometry, use_timeout, output_filename)
3229 {