[libgda/LIBGDA_5.2] Use memmove instead of deprecated g_memmove().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/LIBGDA_5.2] Use memmove instead of deprecated g_memmove().
- Date: Tue, 27 Oct 2015 20:28:17 +0000 (UTC)
commit 4e17bdeec412c9f74ceae4a5171f7e8f4839eee7
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Oct 27 11:09:01 2015 +0100
Use memmove instead of deprecated g_memmove().
See
https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-memmove
libgda-ui/data-entries/gdaui-entry.c | 2 +-
libgda-ui/data-entries/gdaui-formatted-entry.c | 2 +-
libgda-ui/data-entries/gdaui-numeric-entry.c | 6 +++---
libgda/gda-util.c | 10 +++++-----
libgda/sql-parser/gda-statement-struct-util.c | 12 ++++++------
libgda/sqlite/gda-sqlite-provider.c | 2 +-
libgda/sqlite/gda-sqlite-util.c | 12 ++++++------
providers/mdb/libmdb-src/kkd.c | 2 +-
providers/mysql/gda-mysql-provider.c | 10 +++++-----
providers/mysql/gda-mysql-recordset.c | 18 +++++++++---------
providers/oracle/gda-oracle-provider.c | 10 +++++-----
providers/postgres/gda-postgres-provider.c | 12 ++++++------
12 files changed, 49 insertions(+), 49 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry.c b/libgda-ui/data-entries/gdaui-entry.c
index 121ab58..03304ce 100644
--- a/libgda-ui/data-entries/gdaui-entry.c
+++ b/libgda-ui/data-entries/gdaui-entry.c
@@ -397,7 +397,7 @@ gdaui_entry_get_text (GdauiEntry *entry)
text = g_strdup (ctext);
if (entry->priv->prefix) {
len -= entry->priv->prefix_len;
- g_memmove (text, text + entry->priv->prefix_len, len+1);
+ memmove (text, text + entry->priv->prefix_len, len+1);
}
if (entry->priv->suffix) {
len -= entry->priv->suffix_len;
diff --git a/libgda-ui/data-entries/gdaui-formatted-entry.c b/libgda-ui/data-entries/gdaui-formatted-entry.c
index 548df47..14e9ce1 100644
--- a/libgda-ui/data-entries/gdaui-formatted-entry.c
+++ b/libgda-ui/data-entries/gdaui-formatted-entry.c
@@ -506,7 +506,7 @@ gdaui_formatted_entry_get_text (GdauiFormattedEntry *entry)
mptr++) {
if ((*mptr == '-') && (*tptr == '_')) {
/* remove that char */
- g_memmove (tptr, tptr+1, len - (tptr - text));
+ memmove (tptr, tptr+1, len - (tptr - text));
}
else
tptr = g_utf8_next_char (tptr);
diff --git a/libgda-ui/data-entries/gdaui-numeric-entry.c b/libgda-ui/data-entries/gdaui-numeric-entry.c
index e73f660..62e0f70 100644
--- a/libgda-ui/data-entries/gdaui-numeric-entry.c
+++ b/libgda-ui/data-entries/gdaui-numeric-entry.c
@@ -353,14 +353,14 @@ text_unformat (GdauiNumericEntry *entry, gchar *str, gint *pos)
*ptr;
i++) {
if (*ptr == entry->priv->thousands_sep) {
- g_memmove (ptr, ptr+1, len - (ptr - str));
+ memmove (ptr, ptr+1, len - (ptr - str));
len--;
if (*pos >= i)
*pos = *pos - 1;
}
else if ((*ptr == entry->priv->decimal_sep) &&
(ptr[1] == entry->priv->decimal_sep)) {
- g_memmove (ptr, ptr+1, len - (ptr - str));
+ memmove (ptr, ptr+1, len - (ptr - str));
len--;
/*if (*pos > i)
*pos = *pos - 1;*/
@@ -705,7 +705,7 @@ gdaui_numeric_entry_get_value (GdauiNumericEntry *entry)
len = strlen (text);
for (ptr = text; *ptr; ) {
if (*ptr == entry->priv->thousands_sep)
- g_memmove (ptr, ptr+1, len - (ptr - text));
+ memmove (ptr, ptr+1, len - (ptr - text));
else {
if (*ptr == entry->priv->decimal_sep)
*ptr = '.';
diff --git a/libgda/gda-util.c b/libgda/gda-util.c
index 4121999..f3158bc 100644
--- a/libgda/gda-util.c
+++ b/libgda/gda-util.c
@@ -265,7 +265,7 @@ gda_default_unescape_string (const gchar *string)
/* we accept the "''" as a synonym of "\'" */
if (*ptr == '\'') {
if (*(ptr+1) == '\'') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -275,13 +275,13 @@ gda_default_unescape_string (const gchar *string)
}
if (*ptr == '\\') {
if (*(ptr+1) == '\\') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
if (*(ptr+1) == '\'') {
*ptr = '\'';
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -2996,7 +2996,7 @@ gda_connection_string_split (const gchar *string, gchar **out_cnc_params, gchar
*out_username = g_strndup (pos + 9, ptr - (pos + 9));
if (*ptr)
- g_memmove (pos, ptr + 1, strlen (ptr));
+ memmove (pos, ptr + 1, strlen (ptr));
else
*pos = 0;
gchar *tmp;
@@ -3021,7 +3021,7 @@ gda_connection_string_split (const gchar *string, gchar **out_cnc_params, gchar
}
if (*ptr)
- g_memmove (pos, ptr + 1, strlen (ptr));
+ memmove (pos, ptr + 1, strlen (ptr));
else
*pos = 0;
gchar *tmp;
diff --git a/libgda/sql-parser/gda-statement-struct-util.c b/libgda/sql-parser/gda-statement-struct-util.c
index bbcd6c3..60d4c0f 100644
--- a/libgda/sql-parser/gda-statement-struct-util.c
+++ b/libgda/sql-parser/gda-statement-struct-util.c
@@ -88,12 +88,12 @@ _remove_quotes (gchar *str)
total = strlen (str);
if (str[total-1] == delim) {
/* string is correctly terminated by a double quote */
- g_memmove (str, str+1, total-2);
+ memmove (str, str+1, total-2);
total -=2;
}
else {
/* string is _not_ correctly terminated by a double quote */
- g_memmove (str, str+1, total-1);
+ memmove (str, str+1, total-1);
total -=1;
}
str[total] = 0;
@@ -103,7 +103,7 @@ _remove_quotes (gchar *str)
/* we accept the "''" as a synonym of "\'" */
if (*ptr == delim) {
if (*(ptr+1) == delim) {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -113,7 +113,7 @@ _remove_quotes (gchar *str)
}
else if (*ptr == '"') {
if (*(ptr+1) == '"') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -123,13 +123,13 @@ _remove_quotes (gchar *str)
}
else if (*ptr == '\\') {
if (*(ptr+1) == '\\') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
if (*(ptr+1) == delim) {
*ptr = delim;
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
diff --git a/libgda/sqlite/gda-sqlite-provider.c b/libgda/sqlite/gda-sqlite-provider.c
index c1e7e49..5914703 100644
--- a/libgda/sqlite/gda-sqlite-provider.c
+++ b/libgda/sqlite/gda-sqlite-provider.c
@@ -4019,7 +4019,7 @@ gda_sqlite_provider_unescape_string (G_GNUC_UNUSED GdaServerProvider *provider,
while (offset < total) {
if (*ptr == '\'') {
if (*(ptr+1) == '\'') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
diff --git a/libgda/sqlite/gda-sqlite-util.c b/libgda/sqlite/gda-sqlite-util.c
index 22b58ed..ccae2c6 100644
--- a/libgda/sqlite/gda-sqlite-util.c
+++ b/libgda/sqlite/gda-sqlite-util.c
@@ -248,12 +248,12 @@ sqlite_remove_quotes (gchar *str)
total = strlen (str);
if ((str[total-1] == delim) || ((delim == '[') && (str[total-1] == ']'))) {
/* string is correctly terminated */
- g_memmove (str, str+1, total-2);
+ memmove (str, str+1, total-2);
total -=2;
}
else {
/* string is _not_ correctly terminated */
- g_memmove (str, str+1, total-1);
+ memmove (str, str+1, total-1);
total -=1;
}
str[total] = 0;
@@ -264,7 +264,7 @@ sqlite_remove_quotes (gchar *str)
/* we accept the "''" as a synonym of "\'" */
if (*ptr == delim) {
if (*(ptr+1) == delim) {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -274,7 +274,7 @@ sqlite_remove_quotes (gchar *str)
}
else if (*ptr == '"') {
if (*(ptr+1) == '"') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -284,13 +284,13 @@ sqlite_remove_quotes (gchar *str)
}
else if (*ptr == '\\') {
if (*(ptr+1) == '\\') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
if (*(ptr+1) == delim) {
*ptr = delim;
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
diff --git a/providers/mdb/libmdb-src/kkd.c b/providers/mdb/libmdb-src/kkd.c
index e8f753d..72527cd 100644
--- a/providers/mdb/libmdb-src/kkd.c
+++ b/providers/mdb/libmdb-src/kkd.c
@@ -43,7 +43,7 @@ MdbHandle *mdb = entry->mdb;
tmp = mdb_pg_get_int16(mdb,pos); /* length of string */
pos += 2;
cplen = tmp > MDB_MAX_OBJ_NAME ? MDB_MAX_OBJ_NAME : tmp;
- g_memmove(prop.name,&mdb->pg_buf[pos],cplen);
+ memmove(prop.name,&mdb->pg_buf[pos],cplen);
prop.name[cplen]='\0';
pos += tmp;
g_array_append_val(entry->props, prop.name);
diff --git a/providers/mysql/gda-mysql-provider.c b/providers/mysql/gda-mysql-provider.c
index 4f8b856..5bd5cd8 100644
--- a/providers/mysql/gda-mysql-provider.c
+++ b/providers/mysql/gda-mysql-provider.c
@@ -3057,12 +3057,12 @@ my_remove_quotes (gchar *str)
total = strlen (str);
if (str[total-1] == delim) {
/* string is correctly terminated */
- g_memmove (str, str+1, total-2);
+ memmove (str, str+1, total-2);
total -=2;
}
else {
/* string is _not_ correctly terminated */
- g_memmove (str, str+1, total-1);
+ memmove (str, str+1, total-1);
total -=1;
}
str[total] = 0;
@@ -3072,7 +3072,7 @@ my_remove_quotes (gchar *str)
/* we accept the "''" as a synonym of "\'" */
if (*ptr == delim) {
if (*(ptr+1) == delim) {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -3082,13 +3082,13 @@ my_remove_quotes (gchar *str)
}
if (*ptr == '\\') {
if (*(ptr+1) == '\\') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
if (*(ptr+1) == delim) {
*ptr = delim;
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
diff --git a/providers/mysql/gda-mysql-recordset.c b/providers/mysql/gda-mysql-recordset.c
index 8193877..081c26c 100644
--- a/providers/mysql/gda-mysql-recordset.c
+++ b/providers/mysql/gda-mysql-recordset.c
@@ -787,7 +787,7 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, G_GNUC_UNUSED gint rownum, G
my_bool is_null = FALSE;
unsigned long length;
- g_memmove (&is_null, mysql_bind_result[i].is_null, sizeof (my_bool));
+ memmove (&is_null, mysql_bind_result[i].is_null, sizeof (my_bool));
if (is_null) {
gda_value_set_null (value);
continue;
@@ -798,13 +798,13 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, G_GNUC_UNUSED gint rownum, G
switch (mysql_bind_result[i].buffer_type) {
case MYSQL_TYPE_SHORT: {
short int bvalue = 0;
- g_memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
+ memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
g_value_set_int (value, bvalue);
break;
}
case MYSQL_TYPE_TINY: {
signed char bvalue = 0;
- g_memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
+ memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
g_value_set_int (value, bvalue);
break;
}
@@ -812,7 +812,7 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, G_GNUC_UNUSED gint rownum, G
case MYSQL_TYPE_LONG:
case MYSQL_TYPE_YEAR: {
int bvalue = 0;
- g_memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
+ memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
if (type == G_TYPE_INT)
g_value_set_int (value, bvalue);
@@ -831,7 +831,7 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, G_GNUC_UNUSED gint rownum, G
}
case MYSQL_TYPE_LONGLONG: {
long long bvalue = 0;
- g_memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
+ memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
if (type == G_TYPE_BOOLEAN)
g_value_set_boolean (value, bvalue ? TRUE : FALSE);
@@ -856,7 +856,7 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, G_GNUC_UNUSED gint rownum, G
case MYSQL_TYPE_DATETIME:
case MYSQL_TYPE_TIMESTAMP: {
MYSQL_TIME bvalue = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- g_memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
+ memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
if (type == GDA_TYPE_TIME) {
GdaTime time = {
@@ -901,7 +901,7 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, G_GNUC_UNUSED gint rownum, G
}
case MYSQL_TYPE_FLOAT: {
float bvalue = 0.;
- g_memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
+ memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
if (type == G_TYPE_FLOAT)
g_value_set_float (value, (float) bvalue);
@@ -916,7 +916,7 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, G_GNUC_UNUSED gint rownum, G
}
case MYSQL_TYPE_DOUBLE: {
double bvalue = 0.0;
- g_memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
+ memmove (&bvalue, mysql_bind_result[i].buffer, sizeof (bvalue));
if (type == G_TYPE_DOUBLE)
g_value_set_double (value, bvalue);
@@ -939,7 +939,7 @@ new_row_from_mysql_stmt (GdaMysqlRecordset *imodel, G_GNUC_UNUSED gint rownum, G
case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_BIT: {
char *bvalue = NULL;
- g_memmove (&length, mysql_bind_result[i].length, sizeof (unsigned long));
+ memmove (&length, mysql_bind_result[i].length, sizeof (unsigned long));
if (length > 0) {
bvalue = g_malloc (length + 1);
memcpy (bvalue, mysql_bind_result[i].buffer, length);
diff --git a/providers/oracle/gda-oracle-provider.c b/providers/oracle/gda-oracle-provider.c
index fd5638e..319a6b0 100644
--- a/providers/oracle/gda-oracle-provider.c
+++ b/providers/oracle/gda-oracle-provider.c
@@ -2507,12 +2507,12 @@ ora_remove_quotes (gchar *str)
total = strlen (str);
if (str[total-1] == delim) {
/* string is correctly terminated */
- g_memmove (str, str+1, total-2);
+ memmove (str, str+1, total-2);
total -=2;
}
else {
/* string is _not_ correctly terminated */
- g_memmove (str, str+1, total-1);
+ memmove (str, str+1, total-1);
total -=1;
}
str[total] = 0;
@@ -2522,7 +2522,7 @@ ora_remove_quotes (gchar *str)
/* we accept the "''" as a synonym of "\'" */
if (*ptr == delim) {
if (*(ptr+1) == delim) {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -2532,13 +2532,13 @@ ora_remove_quotes (gchar *str)
}
if (*ptr == '\\') {
if (*(ptr+1) == '\\') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
if (*(ptr+1) == delim) {
*ptr = delim;
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
diff --git a/providers/postgres/gda-postgres-provider.c b/providers/postgres/gda-postgres-provider.c
index 69b26fe..b5f4767 100644
--- a/providers/postgres/gda-postgres-provider.c
+++ b/providers/postgres/gda-postgres-provider.c
@@ -2707,12 +2707,12 @@ pg_remove_quotes (gchar *str)
total = strlen (str);
if (str[total-1] == delim) {
/* string is correctly terminated */
- g_memmove (str, str+1, total-2);
+ memmove (str, str+1, total-2);
total -=2;
}
else {
/* string is _not_ correctly terminated */
- g_memmove (str, str+1, total-1);
+ memmove (str, str+1, total-1);
total -=1;
}
str[total] = 0;
@@ -2722,7 +2722,7 @@ pg_remove_quotes (gchar *str)
/* we accept the "''" as a synonym of "\'" */
if (*ptr == delim) {
if (*(ptr+1) == delim) {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -2732,7 +2732,7 @@ pg_remove_quotes (gchar *str)
}
else if (*ptr == '"') {
if (*(ptr+1) == '"') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
@@ -2742,13 +2742,13 @@ pg_remove_quotes (gchar *str)
}
else if (*ptr == '\\') {
if (*(ptr+1) == '\\') {
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
if (*(ptr+1) == delim) {
*ptr = delim;
- g_memmove (ptr+1, ptr+2, total - offset);
+ memmove (ptr+1, ptr+2, total - offset);
offset += 2;
}
else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]