aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Knight <q@1bpm.net>2021-07-21 22:22:01 +0100
committerRichard Knight <q@1bpm.net>2021-07-21 22:22:01 +0100
commitf71024077af151e0eeb37151fb0754e61ee9a2ea (patch)
tree89b59784cc7a0064ecd20ce783488a9522d8ff76 /src
parent1b40e87a3f54a70d4994262dd7fad4297caaeca3 (diff)
downloadcsound-sqldb-f71024077af151e0eeb37151fb0754e61ee9a2ea.tar.gz
csound-sqldb-f71024077af151e0eeb37151fb0754e61ee9a2ea.tar.bz2
csound-sqldb-f71024077af151e0eeb37151fb0754e61ee9a2ea.zip
new cmake approach
Diffstat (limited to 'src')
-rw-r--r--src/mysql.cpp8
-rw-r--r--src/postgresql.cpp2
-rw-r--r--src/sqlite3.cpp8
3 files changed, 9 insertions, 9 deletions
diff --git a/src/mysql.cpp b/src/mysql.cpp
index 71ea16c..2362d60 100644
--- a/src/mysql.cpp
+++ b/src/mysql.cpp
@@ -91,7 +91,7 @@ char* MySQLConnection::ScalarString(char* sql, int row, int col) {
for (int rowIndex = 0; rowIndex <= row; rowIndex++) {
res->next();
}
- char* result = res->getString(col + 1).c_str();
+ char* result = (char*) res->getString(col + 1).c_str();
delete res;
@@ -104,13 +104,13 @@ void MySQLConnection::ToArray(mysql::ResultSet* result, csnd::Csound* csound, AR
int colNum = meta->getColumnCount();
int rowNum = result->rowsCount();
int totalResults = colNum * rowNum;
- array->sizes = csound->calloc(sizeof(int32_t) * 2);
+ array->sizes = (int32_t*) csound->calloc(sizeof(int32_t) * 2);
array->sizes[0] = rowNum;
array->sizes[1] = colNum;
array->dimensions = 2;
CS_VARIABLE *var = array->arrayType->createVariable(csound, NULL);
array->arrayMemberSize = var->memBlockSize;
- array->data = csound->calloc(var->memBlockSize * totalResults);
+ array->data = (MYFLT*) csound->calloc(var->memBlockSize * totalResults);
STRINGDAT* strings;
if (asString) {
strings = (STRINGDAT*) array->data;
@@ -123,7 +123,7 @@ void MySQLConnection::ToArray(mysql::ResultSet* result, csnd::Csound* csound, AR
colIndex = 0;
while (colIndex < colNum) {
if (asString) {
- char* item = result->getString(colIndex + 1).c_str();
+ char* item = (char*) result->getString(colIndex + 1).c_str();
strings[index].size = strlen(item) + 1;
strings[index].data = csound->strdup(item);
} else {
diff --git a/src/postgresql.cpp b/src/postgresql.cpp
index f2d42be..6b54e29 100644
--- a/src/postgresql.cpp
+++ b/src/postgresql.cpp
@@ -98,7 +98,7 @@ void PostgresConnection::ToArray(PGresult* result, csnd::Csound* csound, ARRAYDA
int rows = PQntuples(result);
int cols = PQnfields(result);
int totalResults = rows * cols;
- array->sizes = csound->calloc(sizeof(int32_t) * 2);
+ array->sizes = (int32_t*) csound->calloc(sizeof(int32_t) * 2);
array->sizes[0] = rows;
array->sizes[1] = cols;
array->dimensions = 2;
diff --git a/src/sqlite3.cpp b/src/sqlite3.cpp
index 0fd96e3..00b2773 100644
--- a/src/sqlite3.cpp
+++ b/src/sqlite3.cpp
@@ -88,7 +88,7 @@ char* SqliteConnection::ScalarString(char* sql, int row, int col) {
rc = sqlite3_finalize(stmt);
throw std::runtime_error("column number out of range");
}
- char* result = sqlite3_column_text(stmt, col);
+ char* result = (char*) sqlite3_column_text(stmt, col);
rc = sqlite3_finalize(stmt);
return result;
}
@@ -115,13 +115,13 @@ void SqliteConnection::ToArray(sqlite3_stmt* stmt, csnd::Csound* csound, ARRAYDA
int colNum = sqlite3_column_count(stmt);
int rowNum = RowCount(stmt);
int totalResults = colNum * rowNum;
- array->sizes = csound->calloc(sizeof(int32_t) * 2);
+ array->sizes = (int32_t*) csound->calloc(sizeof(int32_t) * 2);
array->sizes[0] = rowNum;
array->sizes[1] = colNum;
array->dimensions = 2;
CS_VARIABLE *var = array->arrayType->createVariable(csound, NULL);
array->arrayMemberSize = var->memBlockSize;
- array->data = csound->calloc(var->memBlockSize * totalResults);
+ array->data = (MYFLT*) csound->calloc(var->memBlockSize * totalResults);
STRINGDAT* strings;
if (asString) {
strings = (STRINGDAT*) array->data;
@@ -135,7 +135,7 @@ void SqliteConnection::ToArray(sqlite3_stmt* stmt, csnd::Csound* csound, ARRAYDA
colIndex = 0;
while (colIndex < colNum) {
if (asString) {
- char* item = sqlite3_column_text(stmt, colIndex);
+ char* item = (char*) sqlite3_column_text(stmt, colIndex);
strings[index].size = strlen(item) + 1;
strings[index].data = csound->strdup(item);
} else {