Comments (6)
I believe you're correct: the algo = SvIV( ST( i + 1 ) );
line seems to be missing from the Chromaprint.xs
file.
Incidentally, I think the current code (in the POD):
// we only store unless it's the algorithm
// then we simply override the value and store it later
if ( strcmp( SvPV_nolen( ST(i) ), "algorithm" ) == 0 ) {
const char *algo_v = SvPV_nolen(value);
// check algorithm options
if (!strcmp( algo_v, "test1")) {
algo = CHROMAPRINT_ALGORITHM_TEST1;
} else if (!strcmp(algo_v, "test2")) {
algo = CHROMAPRINT_ALGORITHM_TEST2;
} else if (!strcmp(algo_v, "test3")) {
algo = CHROMAPRINT_ALGORITHM_TEST3;
} else if (!strcmp(algo_v, "test4")) {
algo = CHROMAPRINT_ALGORITHM_TEST4;
} else {
warn("WARNING: unknown algorithm, using the default");
}
algo = SvIV( ST( i + 1 ) );
}
should be changed to this:
// we only store unless it's the algorithm
// then we simply override the value and store it later
if ( strcmp( SvPV_nolen( ST(i) ), "algorithm" ) == 0 ) {
const char *algo_v = SvPV_nolen(value);
// check algorithm options
if (!strcmp( algo_v, "test1")) {
algo = CHROMAPRINT_ALGORITHM_TEST1;
} else if (!strcmp(algo_v, "test2")) {
algo = CHROMAPRINT_ALGORITHM_TEST2;
} else if (!strcmp(algo_v, "test3")) {
algo = CHROMAPRINT_ALGORITHM_TEST3;
} else if (!strcmp(algo_v, "test4")) {
algo = CHROMAPRINT_ALGORITHM_TEST4;
} else {
warn("WARNING: unknown algorithm, using the default");
algo = SvIV( ST( i + 1 ) );
}
}
and that the code in Chromaprint.xs
should be updated to match.
@xsawyerx: does that look right to you?
from xs-fun.
@ivanych You're right. That line should not be in there. It was used originally to set the value of the algorithm before I wrote the code that validates what the algorithm is. It should be removed.
@paultcochrane The change you suggest keeps that line, which we agree should be removed, and removes another line, the else
clause that stores whatever else the parameter and its value is, which I think is by mistake. Is it by mistake?
from xs-fun.
I created the following Pull Request for it: #30.
from xs-fun.
@xsawyerx It seems I misunderstood @ivanych's comment: I thought it was meant that the line was missing from the code and that the text was correct. My apologies for getting it around the wrong way!
@xsawyerx my proposed change only moved the algo
line into the else
clause of the inner if
statement. It doesn't remove the following else
clause; I merely didn't mention the second else
clause in my quoted text above. That certainly could have been clearer, I admit... Also: thanks for the clarification in the PR!
@ivanych: does the change in #30 fix the issue for you?
from xs-fun.
I consider this resolved. If not, please reopen.
from xs-fun.
Yes, now everything is ok. Thank you!
from xs-fun.
Related Issues (9)
- "sv_bless( self, gv_stashpv( class, 0 ) )" issue HOT 6
- `PADTMP` doesn't appear in `sv_dump()` output in Chapter 04 HOT 5
- Does it work with C++ too? HOT 5
- clang: error: no input files HOT 4
- Audio::Chromaprint support
- chapter_08 HOT 7
- Cover typemaps HOT 2
- Chapter 01: I needed to do an extra `perl Makefile.PL` to get `make test` working. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xs-fun.