diff layer/LayerFactory.cpp @ 805:1d526ba11a24 warnfix_no_size_t

Remove size_t's and fix warnings in layer/
author Chris Cannam
date Tue, 17 Jun 2014 15:18:06 +0100
parents ddae586bc47b
children b12cd1c2dad5
line wrap: on
line diff
--- a/layer/LayerFactory.cpp	Tue Jun 03 11:10:52 2014 +0100
+++ b/layer/LayerFactory.cpp	Tue Jun 17 15:18:06 2014 +0100
@@ -93,10 +93,11 @@
 	// likewise
 	return Layer::tr("Spectrogram");
 
-    default: break;
+    case UnknownLayer:
+    default:
+        cerr << "WARNING: LayerFactory::getLayerPresentationName passed unknown layer" << endl;
+        return Layer::tr("Unknown Layer");
     }
-
-    return Layer::tr("Layer");
 }
 
 bool
@@ -244,7 +245,10 @@
     case Slice: return "spectrum";
     case MelodicRangeSpectrogram: return "spectrogram";
     case PeakFrequencySpectrogram: return "spectrogram";
-    default: return "unknown";
+    case UnknownLayer:
+    default:
+        cerr << "WARNING: LayerFactory::getLayerIconName passed unknown layer" << endl;
+        return "unknown";
     }
 }
 
@@ -267,7 +271,10 @@
     case Slice: return "slice";
     case MelodicRangeSpectrogram: return "melodicrange";
     case PeakFrequencySpectrogram: return "peakfrequency";
-    default: return "unknown";
+    case UnknownLayer:
+    default:
+        cerr << "WARNING: LayerFactory::getLayerTypeName passed unknown layer" << endl;
+        return "unknown";
     }
 }
 
@@ -460,11 +467,14 @@
 	layer = new SpectrogramLayer(SpectrogramLayer::MelodicPeaks);
 	break;
 
-    default: break;
+    case UnknownLayer:
+    default:
+        cerr << "WARNING: LayerFactory::createLayer passed unknown layer" << endl;
+        break;
     }
 
     if (!layer) {
-	SVDEBUG << "LayerFactory::createLayer: Unknown layer type " 
+	cerr << "LayerFactory::createLayer: Unknown layer type " 
 		  << type << endl;
     } else {
 //	SVDEBUG << "LayerFactory::createLayer: Setting object name "
@@ -499,7 +509,7 @@
         QDomElement layerElt = docNew.firstChildElement("layer");
         QDomNamedNodeMap attrNodes = layerElt.attributes();
         
-        for (unsigned int i = 0; i < attrNodes.length(); ++i) {
+        for (int i = 0; i < attrNodes.length(); ++i) {
             QDomAttr attr = attrNodes.item(i).toAttr();
             if (attr.isNull()) continue;
 //            cerr << "append \"" << attr.name()
@@ -510,7 +520,7 @@
         
         layerElt = docOld.firstChildElement("layer");
         attrNodes = layerElt.attributes();
-        for (unsigned int i = 0; i < attrNodes.length(); ++i) {
+        for (int i = 0; i < attrNodes.length(); ++i) {
             QDomAttr attr = attrNodes.item(i).toAttr();
             if (attr.isNull()) continue;
             if (attrs.value(attr.name()) == "") {