comparison rdf/RDFFeatureWriter.cpp @ 930:06579b8ffb7b warnfix_no_size_t

More size_t evisceration and warning fixes
author Chris Cannam
date Tue, 17 Jun 2014 14:49:49 +0100
parents e802e550a1f2
children 952005e25266
comparison
equal deleted inserted replaced
929:59e7fe1b1003 930:06579b8ffb7b
532 532
533 QString outputId = od.identifier.c_str(); 533 QString outputId = od.identifier.c_str();
534 534
535 // iterate through FeatureLists 535 // iterate through FeatureLists
536 536
537 for (int i = 0; i < featureList.size(); ++i) { 537 for (int i = 0; i < (int)featureList.size(); ++i) {
538 538
539 const Plugin::Feature &feature = featureList[i]; 539 const Plugin::Feature &feature = featureList[i];
540 unsigned long featureNumber = m_count++; 540 unsigned long featureNumber = m_count++;
541 541
542 stream << ":event_" << featureNumber << " a "; 542 stream << ":event_" << featureNumber << " a ";
595 595
596 if (!feature.values.empty()) { 596 if (!feature.values.empty()) {
597 stream << ";\n"; 597 stream << ";\n";
598 //!!! named bins? 598 //!!! named bins?
599 stream << " af:feature \"" << feature.values[0]; 599 stream << " af:feature \"" << feature.values[0];
600 for (int j = 1; j < feature.values.size(); ++j) { 600 for (int j = 1; j < (int)feature.values.size(); ++j) {
601 stream << " " << feature.values[j]; 601 stream << " " << feature.values[j];
602 } 602 }
603 stream << "\" "; 603 stream << "\" ";
604 } 604 }
605 605
607 } 607 }
608 } 608 }
609 609
610 void 610 void
611 RDFFeatureWriter::writeTrackLevelRDF(QTextStream *sptr, 611 RDFFeatureWriter::writeTrackLevelRDF(QTextStream *sptr,
612 const Transform &transform, 612 const Transform &,
613 const Plugin::OutputDescriptor& od, 613 const Plugin::OutputDescriptor& od,
614 const Plugin::FeatureList& featureList, 614 const Plugin::FeatureList& featureList,
615 PluginRDFDescription &desc, 615 PluginRDFDescription &desc,
616 QString signalURI) 616 QString signalURI)
617 { 617 {
618 if (featureList.empty()) return; 618 if (featureList.empty()) return;
619 QTextStream &stream = *sptr; 619 QTextStream &stream = *sptr;
620 620
621 bool plain = (m_plain || !desc.haveDescription()); 621 // bool plain = (m_plain || !desc.haveDescription());
622 622
623 QString outputId = od.identifier.c_str(); 623 QString outputId = od.identifier.c_str();
624 QString featureUri = desc.getOutputFeatureAttributeURI(outputId); 624 QString featureUri = desc.getOutputFeatureAttributeURI(outputId);
625 625
626 if (featureUri == "") { 626 if (featureUri == "") {
627 SVDEBUG << "RDFFeatureWriter::writeTrackLevelRDF: ERROR: No feature URI available -- this function should not have been called!" << endl; 627 SVDEBUG << "RDFFeatureWriter::writeTrackLevelRDF: ERROR: No feature URI available -- this function should not have been called!" << endl;
628 return; 628 return;
629 } 629 }
630 630
631 for (int i = 0; i < featureList.size(); ++i) { 631 for (int i = 0; i < (int)featureList.size(); ++i) {
632 632
633 const Plugin::Feature &feature = featureList[i]; 633 const Plugin::Feature &feature = featureList[i];
634 634
635 if (feature.values.empty()) { 635 if (feature.values.empty()) {
636 636
677 // the sample rate, window length and hop size from the 677 // the sample rate, window length and hop size from the
678 // transform 678 // transform
679 679
680 stream << "\n:feature_timeline_" << featureNumber << " a tl:DiscreteTimeLine .\n\n"; 680 stream << "\n:feature_timeline_" << featureNumber << " a tl:DiscreteTimeLine .\n\n";
681 681
682 size_t stepSize = transform.getStepSize(); 682 int stepSize = transform.getStepSize();
683 if (stepSize == 0) { 683 if (stepSize == 0) {
684 cerr << "RDFFeatureWriter: INTERNAL ERROR: writing dense features without having set the step size properly!" << endl; 684 cerr << "RDFFeatureWriter: INTERNAL ERROR: writing dense features without having set the step size properly!" << endl;
685 return; 685 return;
686 } 686 }
687 687
688 size_t blockSize = transform.getBlockSize(); 688 int blockSize = transform.getBlockSize();
689 if (blockSize == 0) { 689 if (blockSize == 0) {
690 cerr << "RDFFeatureWriter: INTERNAL ERROR: writing dense features without having set the block size properly!" << endl; 690 cerr << "RDFFeatureWriter: INTERNAL ERROR: writing dense features without having set the block size properly!" << endl;
691 return; 691 return;
692 } 692 }
693 693
754 } 754 }
755 755
756 QString &str = m_openDenseFeatures[sp].second; 756 QString &str = m_openDenseFeatures[sp].second;
757 QTextStream stream(&str); 757 QTextStream stream(&str);
758 758
759 for (int i = 0; i < featureList.size(); ++i) { 759 for (int i = 0; i < (int)featureList.size(); ++i) {
760 760
761 const Plugin::Feature &feature = featureList[i]; 761 const Plugin::Feature &feature = featureList[i];
762 762
763 for (int j = 0; j < feature.values.size(); ++j) { 763 for (int j = 0; j < (int)feature.values.size(); ++j) {
764 stream << feature.values[j] << " "; 764 stream << feature.values[j] << " ";
765 } 765 }
766 } 766 }
767 } 767 }
768 768