Mercurial > hg > audiodb
comparison common.cpp @ 454:f3b0ddc1ead0 api-inversion
No more indata
The mmap()ed version of the input data was never used, so zap it
everywhere.
author | mas01cr |
---|---|
date | Wed, 24 Dec 2008 10:57:18 +0000 |
parents | 0c1c8726a79b |
children | 913a95f06998 |
comparison
equal
deleted
inserted
replaced
453:16a903968d18 | 454:f3b0ddc1ead0 |
---|---|
150 lsh_n_point_bits = dbH->flags >> 28; | 150 lsh_n_point_bits = dbH->flags >> 28; |
151 if( !lsh_n_point_bits ) | 151 if( !lsh_n_point_bits ) |
152 lsh_n_point_bits = O2_DEFAULT_LSH_N_POINT_BITS; | 152 lsh_n_point_bits = O2_DEFAULT_LSH_N_POINT_BITS; |
153 } | 153 } |
154 | 154 |
155 void audioDB::initInputFile (const char *inFile, bool loadData) { | 155 void audioDB::initInputFile (const char *inFile) { |
156 if (inFile) { | 156 if (inFile) { |
157 if ((infid = open(inFile, O_RDONLY)) < 0) { | 157 if ((infid = open(inFile, O_RDONLY)) < 0) { |
158 error("can't open input file for reading", inFile, "open"); | 158 error("can't open input file for reading", inFile, "open"); |
159 } | 159 } |
160 | 160 |
180 } | 180 } |
181 if(dbH->dim != test) { | 181 if(dbH->dim != test) { |
182 std::cerr << "error: expected dimension: " << dbH->dim << ", got : " << test <<std::endl; | 182 std::cerr << "error: expected dimension: " << dbH->dim << ", got : " << test <<std::endl; |
183 error("feature dimensions do not match database table dimensions", inFile); | 183 error("feature dimensions do not match database table dimensions", inFile); |
184 } | 184 } |
185 } | |
186 | |
187 if (loadData && ((indata = (char *) mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, infid, 0)) == (caddr_t) -1)) { | |
188 error("mmap error for input", inFile, "mmap"); | |
189 } | 185 } |
190 } | 186 } |
191 } | 187 } |
192 | 188 |
193 void audioDB::initTables(const char* dbName, const char* inFile) { | 189 void audioDB::initTables(const char* dbName, const char* inFile) { |