[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kexi/3.1] src/migration/mdb/3rdparty/mdbtools/libmdb: Allow CFLGAS="-std=c99 -D_POSIX_C_SOURCE=2"
From:       Jaroslaw Staniek <null () kde ! org>
Date:       2018-08-30 21:19:24
Message-ID: E1fvULc-0003tX-P1 () code ! kde ! org
[Download RAW message or body]

Git commit 54e1f67ff4e9937919abf27cd53f4846450e5f10 by Jaroslaw Staniek, on behalf of \
Nirgal Vourgère. Committed on 30/08/2018 at 20:52.
Pushed by staniek into branch '3.1'.

Allow CFLGAS="-std=c99 -D_POSIX_C_SOURCE=2"

Use glib function:
strcasecmp -> g_ascii_strcasecmp
bzero -> memset
strdup -> g_strdump

Don't use arithmetic void*+int

FIXED-IN:3.1.1
mdbtools 2a70e16a8b943b25bc

M  +1    -1    src/migration/mdb/3rdparty/mdbtools/libmdb/catalog.c
M  +1    -1    src/migration/mdb/3rdparty/mdbtools/libmdb/data.c
M  +2    -2    src/migration/mdb/3rdparty/mdbtools/libmdb/props.c
M  +1    -1    src/migration/mdb/3rdparty/mdbtools/libmdb/sargs.c
M  +9    -9    src/migration/mdb/3rdparty/mdbtools/libmdb/table.c
M  +1    -1    src/migration/mdb/3rdparty/mdbtools/libmdb/write.c

https://commits.kde.org/kexi/54e1f67ff4e9937919abf27cd53f4846450e5f10

diff --git a/src/migration/mdb/3rdparty/mdbtools/libmdb/catalog.c \
b/src/migration/mdb/3rdparty/mdbtools/libmdb/catalog.c index 47366527c..190dab0b0 \
                100644
--- a/src/migration/mdb/3rdparty/mdbtools/libmdb/catalog.c
+++ b/src/migration/mdb/3rdparty/mdbtools/libmdb/catalog.c
@@ -147,7 +147,7 @@ mdb_get_catalogentry_by_name(MdbHandle *mdb, const gchar* name)
 
 	for (i=0; i<mdb->num_catalog; i++) {
 		entry = g_ptr_array_index(mdb->catalog, i);
-		if (!strcasecmp(entry->object_name, name))
+		if (!g_ascii_strcasecmp(entry->object_name, name))
 			return entry;
 	}
 	return NULL;
diff --git a/src/migration/mdb/3rdparty/mdbtools/libmdb/data.c \
b/src/migration/mdb/3rdparty/mdbtools/libmdb/data.c index 1db216313..83066d7ae 100644
--- a/src/migration/mdb/3rdparty/mdbtools/libmdb/data.c
+++ b/src/migration/mdb/3rdparty/mdbtools/libmdb/data.c
@@ -67,7 +67,7 @@ mdb_bind_column_by_name(MdbTableDef *table, const gchar *col_name, \
void *bind_pt  
 	for (i=0;i<table->num_cols;i++) {
 		col=g_ptr_array_index(table->columns,i);
-		if (!strcasecmp(col->name,col_name)) {
+		if (!g_ascii_strcasecmp(col->name,col_name)) {
 			col_num = i + 1;
 			if (bind_ptr)
 				col->bind_ptr = bind_ptr;
diff --git a/src/migration/mdb/3rdparty/mdbtools/libmdb/props.c \
b/src/migration/mdb/3rdparty/mdbtools/libmdb/props.c index 670d2269a..56b57c4ce \
                100644
--- a/src/migration/mdb/3rdparty/mdbtools/libmdb/props.c
+++ b/src/migration/mdb/3rdparty/mdbtools/libmdb/props.c
@@ -192,7 +192,7 @@ mdb_kkd_to_props(MdbHandle *mdb, void *buffer, size_t len) {
 		switch (record_type) {
 			case 0x80:
 				if (names) free_names(names);
-				names = mdb_read_props_list(mdb, (gchar *)buffer+pos+6, record_len - 6);
+				names = mdb_read_props_list(mdb, (char*)buffer+pos+6, record_len - 6);
 				break;
 			case 0x00:
 			case 0x01:
@@ -200,7 +200,7 @@ mdb_kkd_to_props(MdbHandle *mdb, void *buffer, size_t len) {
 					fprintf(stderr,"sequence error!\n");
 					break;
 				}
-				props = mdb_read_props(mdb, names, (gchar *)buffer+pos+6, record_len - 6);
+				props = mdb_read_props(mdb, names, (char*)buffer+pos+6, record_len - 6);
 				g_array_append_val(result, props);
 				//mdb_dump_props(props, stderr, 1);
 				break;
diff --git a/src/migration/mdb/3rdparty/mdbtools/libmdb/sargs.c \
b/src/migration/mdb/3rdparty/mdbtools/libmdb/sargs.c index cee28c062..f9d90510a \
                100644
--- a/src/migration/mdb/3rdparty/mdbtools/libmdb/sargs.c
+++ b/src/migration/mdb/3rdparty/mdbtools/libmdb/sargs.c
@@ -302,7 +302,7 @@ int mdb_add_sarg_by_name(MdbTableDef *table, char *colname, \
MdbSarg *in_sarg)  
 	for (i=0;i<table->num_cols;i++) {
 		col = g_ptr_array_index (table->columns, i);
-		if (!strcasecmp(col->name,colname)) {
+		if (!g_ascii_strcasecmp(col->name,colname)) {
 			return mdb_add_sarg(col, in_sarg);
 		}
 	}
diff --git a/src/migration/mdb/3rdparty/mdbtools/libmdb/table.c \
b/src/migration/mdb/3rdparty/mdbtools/libmdb/table.c index 896e8fa1a..3fe6ec7e9 \
                100644
--- a/src/migration/mdb/3rdparty/mdbtools/libmdb/table.c
+++ b/src/migration/mdb/3rdparty/mdbtools/libmdb/table.c
@@ -128,7 +128,7 @@ MdbTableDef *mdb_read_table_by_name(MdbHandle *mdb, gchar \
*table_name, int obj_t  
 	for (i=0; i<mdb->num_catalog; i++) {
 		entry = g_ptr_array_index(mdb->catalog, i);
-		if (!strcasecmp(entry->object_name, table_name))
+		if (!g_ascii_strcasecmp(entry->object_name, table_name))
 			return mdb_read_table(entry);
 	}
 
@@ -166,9 +166,9 @@ read_pg_if_8(MdbHandle *mdb, int *cur_pos)
  * are still advanced and the page cursor is still updated.
  */
 void *
-read_pg_if_n(MdbHandle *mdb, void *void_buf, int *cur_pos, size_t len)
+read_pg_if_n(MdbHandle *mdb, void *buf, int *cur_pos, size_t len)
 {
-	gchar *buf = void_buf;
+	char* _buf = buf;
 	/* Advance to page which contains the first byte */
 	while (*cur_pos >= mdb->fmt->pg_size) {
 		mdb_read_pg(mdb, mdb_get_int32(mdb->pg_buf,4));
@@ -177,20 +177,20 @@ read_pg_if_n(MdbHandle *mdb, void *void_buf, int *cur_pos, \
size_t len)  /* Copy pages into buffer */
 	while ((ssize_t)(*cur_pos + len) >= mdb->fmt->pg_size) {
 		int piece_len = mdb->fmt->pg_size - *cur_pos;
-		if (buf) {
-			memcpy(buf, mdb->pg_buf + *cur_pos, piece_len);
-			buf += piece_len;
+		if (_buf) {
+			memcpy(_buf, mdb->pg_buf + *cur_pos, piece_len);
+			_buf += piece_len;
 		}
 		len -= piece_len;
 		mdb_read_pg(mdb, mdb_get_int32(mdb->pg_buf,4));
 		*cur_pos = 8;
 	}
 	/* Copy into buffer from final page */
-	if (len && buf) {
-		memcpy(buf, mdb->pg_buf + *cur_pos, len);
+	if (len && _buf) {
+		memcpy(_buf, mdb->pg_buf + *cur_pos, len);
 	}
 	*cur_pos += len;
-	return buf;
+	return _buf;
 }
 
 
diff --git a/src/migration/mdb/3rdparty/mdbtools/libmdb/write.c \
b/src/migration/mdb/3rdparty/mdbtools/libmdb/write.c index 92b63b00b..127519e5c \
                100644
--- a/src/migration/mdb/3rdparty/mdbtools/libmdb/write.c
+++ b/src/migration/mdb/3rdparty/mdbtools/libmdb/write.c
@@ -200,7 +200,7 @@ mdb_crack_row(MdbTableDef *table, int row_start, int row_end, \
MdbField *fields)  }
 
 	bitmask_sz = (row_cols + 7) / 8;
-	nullmask = (unsigned char *)pg_buf + row_end - bitmask_sz + 1;
+	nullmask = (unsigned char*)pg_buf + row_end - bitmask_sz + 1;
 
 	/* read table of variable column locations */
 	if (table->num_var_cols > 0) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic