File: 010_min_max.diff

package info (click to toggle)
langdrill 0.3-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 568 kB
  • sloc: cpp: 1,377; makefile: 73
file content (21 lines) | stat: -rw-r--r-- 782 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
The minimum and maximum operators were never terribly portable and have
been dropped by GCC 4.2.
Index: langdrill-0.3/src/main.cc
===================================================================
--- langdrill-0.3.orig/src/main.cc	2007-07-15 12:52:38.000000000 +0100
+++ langdrill-0.3/src/main.cc	2007-07-15 12:54:01.000000000 +0100
@@ -460,9 +460,11 @@
   // keys. In such a case, we must take some precations
   setActiveButtons( keyTotalNr );
 
-  // is this minimum operator portable ??
-  // it should work with egcs at least !!
-  int cols = keyTotalNr <? atoi(_setup.quizzAnswerNr);
+  int cols;
+  if (keyTotalNr < atoi(_setup.quizzAnswerNr))
+    cols = keyTotalNr;
+  else
+    cols = atoi(_setup.quizzAnswerNr);
 
   int rows = keyTotalNr;
   int *set = new int[cols];