Browse Source

Suppress compiler warnings for non-sensical unit conversions

Neal Wilson 10 years ago
parent
commit
341032e980
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      src/units.w

+ 13
- 0
src/units.w View File

41
 
41
 
42
 @(units.cpp@>=
42
 @(units.cpp@>=
43
 #include "units.h"
43
 #include "units.h"
44
+#include <QtDebug>
44
 
45
 
45
 @ The |isTemperatureUnit()| method may seem counter-intuitive while the enum
46
 @ The |isTemperatureUnit()| method may seem counter-intuitive while the enum
46
 only contains represenations of temperature measurements, but there are plans
47
 only contains represenations of temperature measurements, but there are plans
90
 					break;
91
 					break;
91
 				case Rankine:@/
92
 				case Rankine:@/
92
 					return value + 459.67;
93
 					return value + 459.67;
94
+					break;
95
+				default:@/
96
+					qDebug() << "Warning: Non-sensical unit conversion.";
93
 					break;@t\2@>@/
97
 					break;@t\2@>@/
94
 			}@/
98
 			}@/
95
 			break;
99
 			break;
107
 					break;
111
 					break;
108
 				case Rankine:@/
112
 				case Rankine:@/
109
 					return (value + 273.15) * 9.0 / 5.0;
113
 					return (value + 273.15) * 9.0 / 5.0;
114
+					break;
115
+				default:@/
116
+					qDebug() << "Warning: Non-sensical unit conversion.";
110
 					break;@t\2@>@/
117
 					break;@t\2@>@/
111
 			}@/
118
 			}@/
112
 			break;
119
 			break;
124
 					break;
131
 					break;
125
 				case Rankine:@/
132
 				case Rankine:@/
126
 					return value * 9.0 / 5.0;
133
 					return value * 9.0 / 5.0;
134
+					break;
135
+				default:@/
136
+					qDebug() << "Warning: Non-sensical unit conversion.";
127
 					break;@t\2@>@/
137
 					break;@t\2@>@/
128
 			}@/
138
 			}@/
129
 			break;
139
 			break;
141
 					break;
151
 					break;
142
 				case Rankine:@/
152
 				case Rankine:@/
143
 					return value;
153
 					return value;
154
+					break;
155
+				default:@/
156
+					qDebug() << "Warning: Non-sensical unit conversion.";
144
 					break;@t\2@>@/
157
 					break;@t\2@>@/
145
 			}@/
158
 			}@/
146
 			break;
159
 			break;

Loading…
Cancel
Save