File: clearer_longify.patch

package info (click to toggle)
eclib 20190909-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,196 kB
  • sloc: cpp: 47,090; makefile: 251; sh: 122
file content (36 lines) | stat: -rw-r--r-- 1,045 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Author: Julien Puydt
Description: a switch without default makes the compiler itchy (and could give a bug in the future)
Forwarded: https://github.com/JohnCremona/issues/61

--- eclib.orig/libsrc/interface.cc
+++ eclib/libsrc/interface.cc
@@ -318,6 +318,9 @@
           a = I2long(CeilToZZ(x)); return 1;
         case -1: // round down
           a = I2long(FloorToZZ(x)); return 1;
+	default: // should be unused!
+	  cerr<<"Attempt to round with unknown method fails!" << endl;
+	  return 0;
         }
     }
   else
@@ -345,6 +348,9 @@
           a = - (long)(-x+0.5); return 1;
         case -1: // round down
           a = (long)x; return 1;
+	default: // should be unused!
+	  cerr<<"Attempt to round with unknown method fails!" << endl;
+	  return 0;
         }
     }
   else
@@ -357,6 +363,9 @@
           a = (long)x; return 1;
         case -1: // round down
           a = (long)(x-0.5); return 1;
+	default: // should be unused!
+	  cerr<<"Attempt to round with unknown method fails!" << endl;
+	  return 0;
         }
     }
 }