Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 213139 | Differences between
and this patch

Collapse All | Expand All

(-)vamp-plugin-sdk-1.2.orig/vamp-sdk/PluginHostAdapter.cpp (-1 / +2 lines)
Lines 36-41 Link Here
36
36
37
#include "PluginHostAdapter.h"
37
#include "PluginHostAdapter.h"
38
38
39
#include <cstdlib> // std::getenv
39
namespace Vamp
40
namespace Vamp
40
{
41
{
41
42
Lines 63-69 Link Here
63
    std::vector<std::string> path;
64
    std::vector<std::string> path;
64
    std::string envPath;
65
    std::string envPath;
65
66
66
    char *cpath = getenv("VAMP_PATH");
67
    char *cpath = std::getenv("VAMP_PATH");
67
    if (cpath) envPath = cpath;
68
    if (cpath) envPath = cpath;
68
69
69
#ifdef _WIN32
70
#ifdef _WIN32
(-)vamp-plugin-sdk-1.2.orig/vamp-sdk/PluginAdapter.cpp (-31 / +33 lines)
Lines 35-40 Link Here
35
*/
35
*/
36
36
37
#include "PluginAdapter.h"
37
#include "PluginAdapter.h"
38
#include <cstring> // strdup (evil) :P
39
#include <cstdlib> // std::malloc,free
38
40
39
//#define DEBUG_PLUGIN_ADAPTER 1
41
//#define DEBUG_PLUGIN_ADAPTER 1
40
42
Lines 181-193 Link Here
181
    
183
    
182
    m_descriptor.parameterCount = m_parameters.size();
184
    m_descriptor.parameterCount = m_parameters.size();
183
    m_descriptor.parameters = (const VampParameterDescriptor **)
185
    m_descriptor.parameters = (const VampParameterDescriptor **)
184
        malloc(m_parameters.size() * sizeof(VampParameterDescriptor));
186
        std::malloc(m_parameters.size() * sizeof(VampParameterDescriptor));
185
187
186
    unsigned int i;
188
    unsigned int i;
187
    
189
    
188
    for (i = 0; i < m_parameters.size(); ++i) {
190
    for (i = 0; i < m_parameters.size(); ++i) {
189
        VampParameterDescriptor *desc = (VampParameterDescriptor *)
191
        VampParameterDescriptor *desc = (VampParameterDescriptor *)
190
            malloc(sizeof(VampParameterDescriptor));
192
            std::malloc(sizeof(VampParameterDescriptor));
191
        desc->identifier = strdup(m_parameters[i].identifier.c_str());
193
        desc->identifier = strdup(m_parameters[i].identifier.c_str());
192
        desc->name = strdup(m_parameters[i].name.c_str());
194
        desc->name = strdup(m_parameters[i].name.c_str());
193
        desc->description = strdup(m_parameters[i].description.c_str());
195
        desc->description = strdup(m_parameters[i].description.c_str());
Lines 200-206 Link Here
200
        desc->valueNames = 0;
202
        desc->valueNames = 0;
201
        if (desc->isQuantized && !m_parameters[i].valueNames.empty()) {
203
        if (desc->isQuantized && !m_parameters[i].valueNames.empty()) {
202
            desc->valueNames = (const char **)
204
            desc->valueNames = (const char **)
203
                malloc((m_parameters[i].valueNames.size()+1) * sizeof(char *));
205
                std::malloc((m_parameters[i].valueNames.size()+1) * sizeof(char *));
204
            for (unsigned int j = 0; j < m_parameters[i].valueNames.size(); ++j) {
206
            for (unsigned int j = 0; j < m_parameters[i].valueNames.size(); ++j) {
205
                desc->valueNames[j] = strdup(m_parameters[i].valueNames[j].c_str());
207
                desc->valueNames[j] = strdup(m_parameters[i].valueNames[j].c_str());
206
            }
208
            }
Lines 211-217 Link Here
211
    
213
    
212
    m_descriptor.programCount = m_programs.size();
214
    m_descriptor.programCount = m_programs.size();
213
    m_descriptor.programs = (const char **)
215
    m_descriptor.programs = (const char **)
214
        malloc(m_programs.size() * sizeof(const char *));
216
        std::malloc(m_programs.size() * sizeof(const char *));
215
    
217
    
216
    for (i = 0; i < m_programs.size(); ++i) {
218
    for (i = 0; i < m_programs.size(); ++i) {
217
        m_descriptor.programs[i] = strdup(m_programs[i].c_str());
219
        m_descriptor.programs[i] = strdup(m_programs[i].c_str());
Lines 261-291 Link Here
261
263
262
    if (!m_populated) return;
264
    if (!m_populated) return;
263
265
264
    free((void *)m_descriptor.identifier);
266
    std::free((void *)m_descriptor.identifier);
265
    free((void *)m_descriptor.name);
267
    std::free((void *)m_descriptor.name);
266
    free((void *)m_descriptor.description);
268
    std::free((void *)m_descriptor.description);
267
    free((void *)m_descriptor.maker);
269
    std::free((void *)m_descriptor.maker);
268
    free((void *)m_descriptor.copyright);
270
    std::free((void *)m_descriptor.copyright);
269
        
271
        
270
    for (unsigned int i = 0; i < m_descriptor.parameterCount; ++i) {
272
    for (unsigned int i = 0; i < m_descriptor.parameterCount; ++i) {
271
        const VampParameterDescriptor *desc = m_descriptor.parameters[i];
273
        const VampParameterDescriptor *desc = m_descriptor.parameters[i];
272
        free((void *)desc->identifier);
274
        std::free((void *)desc->identifier);
273
        free((void *)desc->name);
275
        std::free((void *)desc->name);
274
        free((void *)desc->description);
276
        std::free((void *)desc->description);
275
        free((void *)desc->unit);
277
        std::free((void *)desc->unit);
276
        if (desc->valueNames) {
278
        if (desc->valueNames) {
277
            for (unsigned int j = 0; desc->valueNames[j]; ++j) {
279
            for (unsigned int j = 0; desc->valueNames[j]; ++j) {
278
                free((void *)desc->valueNames[j]);
280
                std::free((void *)desc->valueNames[j]);
279
            }
281
            }
280
            free((void *)desc->valueNames);
282
            std::free((void *)desc->valueNames);
281
        }
283
        }
282
    }
284
    }
283
    free((void *)m_descriptor.parameters);
285
    std::free((void *)m_descriptor.parameters);
284
286
285
    for (unsigned int i = 0; i < m_descriptor.programCount; ++i) {
287
    for (unsigned int i = 0; i < m_descriptor.programCount; ++i) {
286
        free((void *)m_descriptor.programs[i]);
288
        std::free((void *)m_descriptor.programs[i]);
287
    }
289
    }
288
    free((void *)m_descriptor.programs);
290
    std::free((void *)m_descriptor.programs);
289
291
290
    if (m_adapterMap) {
292
    if (m_adapterMap) {
291
        
293
        
Lines 520-538 Link Here
520
    std::cerr << "PluginAdapterBase::Impl::vampReleaseOutputDescriptor(" << desc << ")" << std::endl;
522
    std::cerr << "PluginAdapterBase::Impl::vampReleaseOutputDescriptor(" << desc << ")" << std::endl;
521
#endif
523
#endif
522
524
523
    if (desc->identifier) free((void *)desc->identifier);
525
    if (desc->identifier) std::free((void *)desc->identifier);
524
    if (desc->name) free((void *)desc->name);
526
    if (desc->name) std::free((void *)desc->name);
525
    if (desc->description) free((void *)desc->description);
527
    if (desc->description) std::free((void *)desc->description);
526
    if (desc->unit) free((void *)desc->unit);
528
    if (desc->unit) std::free((void *)desc->unit);
527
    if (desc->hasFixedBinCount && desc->binNames) {
529
    if (desc->hasFixedBinCount && desc->binNames) {
528
        for (unsigned int i = 0; i < desc->binCount; ++i) {
530
        for (unsigned int i = 0; i < desc->binCount; ++i) {
529
            if (desc->binNames[i]) {
531
            if (desc->binNames[i]) {
530
                free((void *)desc->binNames[i]);
532
                std::free((void *)desc->binNames[i]);
531
            }
533
            }
532
        }
534
        }
533
    }
535
    }
534
    if (desc->binNames) free((void *)desc->binNames);
536
    if (desc->binNames) std::free((void *)desc->binNames);
535
    free((void *)desc);
537
    std::free((void *)desc);
536
}
538
}
537
539
538
VampFeatureList *
540
VampFeatureList *
Lines 583-595 Link Here
583
        for (unsigned int i = 0; i < outputCount; ++i) {
585
        for (unsigned int i = 0; i < outputCount; ++i) {
584
            for (unsigned int j = 0; j < m_fsizes[plugin][i]; ++j) {
586
            for (unsigned int j = 0; j < m_fsizes[plugin][i]; ++j) {
585
                if (list[i].features[j].label) {
587
                if (list[i].features[j].label) {
586
                    free(list[i].features[j].label);
588
                    std::free(list[i].features[j].label);
587
                }
589
                }
588
                if (list[i].features[j].values) {
590
                if (list[i].features[j].values) {
589
                    free(list[i].features[j].values);
591
                    std::free(list[i].features[j].values);
590
                }
592
                }
591
            }
593
            }
592
            if (list[i].features) free(list[i].features);
594
            if (list[i].features) std::free(list[i].features);
593
        }
595
        }
594
        m_fs.erase(plugin);
596
        m_fs.erase(plugin);
595
        m_fsizes.erase(plugin);
597
        m_fsizes.erase(plugin);
Lines 640-646 Link Here
640
        (*m_pluginOutputs[plugin])[i];
642
        (*m_pluginOutputs[plugin])[i];
641
643
642
    VampOutputDescriptor *desc = (VampOutputDescriptor *)
644
    VampOutputDescriptor *desc = (VampOutputDescriptor *)
643
        malloc(sizeof(VampOutputDescriptor));
645
        std::malloc(sizeof(VampOutputDescriptor));
644
646
645
    desc->identifier = strdup(od.identifier.c_str());
647
    desc->identifier = strdup(od.identifier.c_str());
646
    desc->name = strdup(od.name.c_str());
648
    desc->name = strdup(od.name.c_str());
Lines 651-657 Link Here
651
653
652
    if (od.hasFixedBinCount && od.binCount > 0) {
654
    if (od.hasFixedBinCount && od.binCount > 0) {
653
        desc->binNames = (const char **)
655
        desc->binNames = (const char **)
654
            malloc(od.binCount * sizeof(const char *));
656
            std::malloc(od.binCount * sizeof(const char *));
655
        
657
        
656
        for (unsigned int i = 0; i < od.binCount; ++i) {
658
        for (unsigned int i = 0; i < od.binCount; ++i) {
657
            if (i < od.binNames.size()) {
659
            if (i < od.binNames.size()) {
Lines 750-756 Link Here
750
            feature->nsec = fl[j].timestamp.nsec;
752
            feature->nsec = fl[j].timestamp.nsec;
751
            feature->valueCount = fl[j].values.size();
753
            feature->valueCount = fl[j].values.size();
752
754
753
            if (feature->label) free(feature->label);
755
            if (feature->label) std::free(feature->label);
754
756
755
            if (fl[j].label.empty()) {
757
            if (fl[j].label.empty()) {
756
                feature->label = 0;
758
                feature->label = 0;
(-)vamp-plugin-sdk-1.2.orig/vamp-sdk/hostext/PluginLoader.cpp (-1 / +2 lines)
Lines 42-47 Link Here
42
42
43
#include <fstream>
43
#include <fstream>
44
#include <cctype> // tolower
44
#include <cctype> // tolower
45
#include <cstring> // std::strlen
45
46
46
#ifdef _WIN32
47
#ifdef _WIN32
47
48
Lines 587-593 Link Here
587
        
588
        
588
        if (!e->d_name) continue;
589
        if (!e->d_name) continue;
589
       
590
       
590
        size_t len = strlen(e->d_name);
591
        size_t len = std::strlen(e->d_name);
591
        if (len < extlen + 2 ||
592
        if (len < extlen + 2 ||
592
            e->d_name + len - extlen - 1 != "." + extension) {
593
            e->d_name + len - extlen - 1 != "." + extension) {
593
            continue;
594
            continue;
(-)vamp-plugin-sdk-1.2.orig/host/vamp-simple-host.cpp (-11 / +13 lines)
Lines 49-54 Link Here
49
#include "system.h"
49
#include "system.h"
50
50
51
#include <cmath>
51
#include <cmath>
52
#include <cstring> // std::strcmp,memset
53
#include <cstdlib> // std::exit,atoi
52
54
53
using namespace std;
55
using namespace std;
54
56
Lines 112-118 Link Here
112
        "  " << name << " -v\n\n"
114
        "  " << name << " -v\n\n"
113
        "    -- Display version information only.\n"
115
        "    -- Display version information only.\n"
114
         << endl;
116
         << endl;
115
    exit(2);
117
    std::exit(2);
116
}
118
}
117
119
118
int main(int argc, char **argv)
120
int main(int argc, char **argv)
Lines 129-163 Link Here
129
131
130
    if (argc == 2) {
132
    if (argc == 2) {
131
133
132
        if (!strcmp(argv[1], "-v")) {
134
        if (!std::strcmp(argv[1], "-v")) {
133
135
134
            cout << "Simple Vamp plugin host version: " << HOST_VERSION << endl
136
            cout << "Simple Vamp plugin host version: " << HOST_VERSION << endl
135
                 << "Vamp API version: " << VAMP_API_VERSION << endl
137
                 << "Vamp API version: " << VAMP_API_VERSION << endl
136
                 << "Vamp SDK version: " << VAMP_SDK_VERSION << endl;
138
                 << "Vamp SDK version: " << VAMP_SDK_VERSION << endl;
137
            return 0;
139
            return 0;
138
140
139
        } else if (!strcmp(argv[1], "-l")) {
141
        } else if (!std::strcmp(argv[1], "-l")) {
140
142
141
            printPluginPath(true);
143
            printPluginPath(true);
142
            enumeratePlugins(PluginInformation);
144
            enumeratePlugins(PluginInformation);
143
            return 0;
145
            return 0;
144
146
145
        } else if (!strcmp(argv[1], "-p")) {
147
        } else if (!std::strcmp(argv[1], "-p")) {
146
148
147
            printPluginPath(false);
149
            printPluginPath(false);
148
            return 0;
150
            return 0;
149
151
150
        } else if (!strcmp(argv[1], "--list-ids")) {
152
        } else if (!std::strcmp(argv[1], "--list-ids")) {
151
153
152
            enumeratePlugins(PluginIds);
154
            enumeratePlugins(PluginIds);
153
            return 0;
155
            return 0;
154
156
155
        } else if (!strcmp(argv[1], "--list-outputs")) {
157
        } else if (!std::strcmp(argv[1], "--list-outputs")) {
156
158
157
            enumeratePlugins(PluginOutputIds);
159
            enumeratePlugins(PluginOutputIds);
158
            return 0;
160
            return 0;
159
161
160
        } else if (!strcmp(argv[1], "--list-by-category")) {
162
        } else if (!std::strcmp(argv[1], "--list-by-category")) {
161
163
162
            printPluginCategoryList();
164
            printPluginCategoryList();
163
            return 0;
165
            return 0;
Lines 170-176 Link Here
170
    bool useFrames = false;
172
    bool useFrames = false;
171
    
173
    
172
    int base = 1;
174
    int base = 1;
173
    if (!strcmp(argv[1], "-s")) {
175
    if (!std::strcmp(argv[1], "-s")) {
174
        useFrames = true;
176
        useFrames = true;
175
        base = 2;
177
        base = 2;
176
    }
178
    }
Lines 187-197 Link Here
187
        int idx = base+2;
189
        int idx = base+2;
188
190
189
        if (isdigit(*argv[idx])) {
191
        if (isdigit(*argv[idx])) {
190
            outputNo = atoi(argv[idx++]);
192
            outputNo = std::atoi(argv[idx++]);
191
        }
193
        }
192
194
193
        if (argc == idx + 2) {
195
        if (argc == idx + 2) {
194
            if (!strcmp(argv[idx], "-o")) {
196
            if (!std::strcmp(argv[idx], "-o")) {
195
                outfilename = argv[idx+1];
197
                outfilename = argv[idx+1];
196
            } else usage(name);
198
            } else usage(name);
197
        } else if (argc != idx) {
199
        } else if (argc != idx) {
Lines 248-254 Link Here
248
    
250
    
249
    SNDFILE *sndfile;
251
    SNDFILE *sndfile;
250
    SF_INFO sfinfo;
252
    SF_INFO sfinfo;
251
    memset(&sfinfo, 0, sizeof(SF_INFO));
253
    std::memset(&sfinfo, 0, sizeof(SF_INFO));
252
254
253
    sndfile = sf_open(wavname.c_str(), SFM_READ, &sfinfo);
255
    sndfile = sf_open(wavname.c_str(), SFM_READ, &sfinfo);
254
    if (!sndfile) {
256
    if (!sndfile) {

Return to bug 213139