diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-02-06 15:06:17 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-02-06 15:06:17 +0000 |
| commit | da71443f77f499468d48b3f404eb6c59851eef8a (patch) | |
| tree | 7635b5003762929196a29b91ed0db77ab9b21bd3 /src/trace/siox.cpp | |
| parent | Unwanted output in documentation dropped (diff) | |
| download | inkscape-da71443f77f499468d48b3f404eb6c59851eef8a.tar.gz inkscape-da71443f77f499468d48b3f404eb6c59851eef8a.zip | |
(cppcheck and janitorial tasks:) C-style casting to C++-style casting
(bzr r10946)
Diffstat (limited to '')
| -rw-r--r-- | src/trace/siox.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/trace/siox.cpp b/src/trace/siox.cpp index 4c6cf1eac..9376fad66 100644 --- a/src/trace/siox.cpp +++ b/src/trace/siox.cpp @@ -1330,29 +1330,31 @@ bool Siox::colorSignature(const std::vector<CieLab> &inputVec, if (length < 1) // no error. just don't do anything return true; - CieLab *input = (CieLab *) malloc(length * sizeof(CieLab)); + CieLab *input = new CieLab [length]; if (!input) - { + { error("Could not allocate buffer for signature"); return false; - } + } for (unsigned int i=0 ; i < length ; i++) + { input[i] = inputVec[i]; + } unsigned int stage1length = 0; - colorSignatureStage1(input, 0, length, 0, - &stage1length, dims); + colorSignatureStage1(input, 0, length, 0, &stage1length, dims); unsigned int stage2length = 0; - colorSignatureStage2(input, 0, stage1length, 0, - &stage2length, length * 0.001, dims); + colorSignatureStage2(input, 0, stage1length, 0, &stage2length, length * 0.001, dims); result.clear(); for (unsigned int i=0 ; i < stage2length ; i++) + { result.push_back(input[i]); + } - free(input); + delete[] input; return true; } |
