Mercurial > hg > audiodb
comparison insert.cpp @ 370:2d5c3f8e8c22
Merge gcc-4.3-cleanups branch (-r629:642, but I consider that branch as
having served its purpose) onto the trunk.
Now compiles cleanly even with a fairly picky gcc. I await version 4.4
with bated breath.
author | mas01cr |
---|---|
date | Wed, 12 Nov 2008 15:40:40 +0000 |
parents | c93be2f3a674 |
children | 61b40ed4dc62 |
comparison
equal
deleted
inserted
replaced
355:94c18f128ce8 | 370:2d5c3f8e8c22 |
---|---|
13 bool audioDB::enough_data_space_free(off_t size) { | 13 bool audioDB::enough_data_space_free(off_t size) { |
14 return(dbH->timesTableOffset > dbH->dataOffset + dbH->length + size); | 14 return(dbH->timesTableOffset > dbH->dataOffset + dbH->length + size); |
15 } | 15 } |
16 | 16 |
17 void audioDB::insert_data_vectors(off_t offset, void *buffer, size_t size) { | 17 void audioDB::insert_data_vectors(off_t offset, void *buffer, size_t size) { |
18 lseek(dbfid, dbH->dataOffset + offset, SEEK_SET); | 18 if(lseek(dbfid, dbH->dataOffset + offset, SEEK_SET) == (off_t) -1) { |
19 write(dbfid, buffer, size); | 19 error("error seeking to offset", "", "lseek"); |
20 } | |
21 CHECKED_WRITE(dbfid, buffer, size); | |
20 } | 22 } |
21 | 23 |
22 void audioDB::insert(const char* dbName, const char* inFile) { | 24 void audioDB::insert(const char* dbName, const char* inFile) { |
23 forWrite = true; | 25 forWrite = true; |
24 initTables(dbName, inFile); | 26 initTables(dbName, inFile); |