mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-11-26 10:29:27 +08:00
Clean up some gcc4 warnings and errors
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
Thu Apr 28 21:34:57 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
Thu Apr 28 21:34:57 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
* src/util/mdb-check.c:
|
* src/util/mdb-check.c:
|
||||||
* src/util/sargtest.c: Remove an unused variable and a noop
|
* src/util/sargtest.c: Remove an unused variable and a noop
|
||||||
|
* src/libmdb/backend.c:
|
||||||
|
* src/libmdb/iconv.c:
|
||||||
|
* src/libmdb/table.c:
|
||||||
|
* src/odbc/unittest.c: Clean up some gcc4 warnings and errors
|
||||||
|
|
||||||
Sat Apr 9 15:40:17 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
Sat Apr 9 15:40:17 CDT 2005 Jeff Smith <whydoubt@yahoo.com>
|
||||||
* src/gmdb2/gladefiles/gmdb-debug.glade:
|
* src/gmdb2/gladefiles/gmdb-debug.glade:
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#endif /* JAVA */
|
#endif /* JAVA */
|
||||||
|
|
||||||
static int is_init;
|
static int is_init;
|
||||||
static GHashTable *mdb_backends;
|
GHashTable *mdb_backends;
|
||||||
|
|
||||||
/* Access data types */
|
/* Access data types */
|
||||||
static MdbBackendType mdb_access_types[] = {
|
static MdbBackendType mdb_access_types[] = {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ mdb_unicode2ascii(MdbHandle *mdb, unsigned char *src, unsigned int slen, unsigne
|
|||||||
unsigned int compress=1;
|
unsigned int compress=1;
|
||||||
src += 2;
|
src += 2;
|
||||||
slen -= 2;
|
slen -= 2;
|
||||||
tmp = (char *)g_malloc(slen*2);
|
tmp = (unsigned char *)g_malloc(slen*2);
|
||||||
while (slen) {
|
while (slen) {
|
||||||
if (*src == 0) {
|
if (*src == 0) {
|
||||||
compress = (compress) ? 0 : 1;
|
compress = (compress) ? 0 : 1;
|
||||||
@@ -61,8 +61,8 @@ mdb_unicode2ascii(MdbHandle *mdb, unsigned char *src, unsigned int slen, unsigne
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
in_ptr = (tmp) ? tmp : src;
|
in_ptr = (char *)((tmp) ? tmp : src);
|
||||||
out_ptr = dest;
|
out_ptr = (char *)dest;
|
||||||
len_in = (tmp) ? tlen : slen;
|
len_in = (tmp) ? tlen : slen;
|
||||||
len_out = dlen;
|
len_out = dlen;
|
||||||
|
|
||||||
@@ -111,9 +111,9 @@ mdb_ascii2unicode(MdbHandle *mdb, unsigned char *src, unsigned int slen, unsigne
|
|||||||
if ((!src) || (!dest))
|
if ((!src) || (!dest))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
in_ptr = src;
|
in_ptr = (char *)src;
|
||||||
out_ptr = dest;
|
out_ptr = (char *)dest;
|
||||||
len_in = (slen) ? slen : strlen(src);
|
len_in = (slen) ? slen : strlen(in_ptr);
|
||||||
len_out = dlen;
|
len_out = dlen;
|
||||||
|
|
||||||
#ifdef HAVE_ICONV
|
#ifdef HAVE_ICONV
|
||||||
@@ -137,7 +137,7 @@ mdb_ascii2unicode(MdbHandle *mdb, unsigned char *src, unsigned int slen, unsigne
|
|||||||
|
|
||||||
/* Unicode Compression */
|
/* Unicode Compression */
|
||||||
if(IS_JET4(mdb) && (dlen>4)) {
|
if(IS_JET4(mdb) && (dlen>4)) {
|
||||||
char *tmp = g_malloc(dlen);
|
unsigned char *tmp = g_malloc(dlen);
|
||||||
unsigned int tptr = 0, dptr = 0;
|
unsigned int tptr = 0, dptr = 0;
|
||||||
int comp = 1;
|
int comp = 1;
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ MdbTableDef *mdb_read_table(MdbCatalogEntry *entry)
|
|||||||
MdbHandle *mdb = entry->mdb;
|
MdbHandle *mdb = entry->mdb;
|
||||||
MdbFormatConstants *fmt = mdb->fmt;
|
MdbFormatConstants *fmt = mdb->fmt;
|
||||||
int len, row_start, pg_row;
|
int len, row_start, pg_row;
|
||||||
char *buf, *pg_buf = mdb->pg_buf;
|
unsigned char *buf, *pg_buf = mdb->pg_buf;
|
||||||
|
|
||||||
mdb_read_pg(mdb, entry->table_pg);
|
mdb_read_pg(mdb, entry->table_pg);
|
||||||
if (pg_buf[0] != 0x02) /* not a valid table def page */
|
if (pg_buf[0] != 0x02) /* not a valid table def page */
|
||||||
@@ -270,7 +270,7 @@ GPtrArray *mdb_read_columns(MdbTableDef *table)
|
|||||||
** column names - ordered the same as the column attributes table
|
** column names - ordered the same as the column attributes table
|
||||||
*/
|
*/
|
||||||
for (i=0;i<table->num_cols;i++) {
|
for (i=0;i<table->num_cols;i++) {
|
||||||
char *tmp_buf;
|
unsigned char *tmp_buf;
|
||||||
pcol = g_ptr_array_index(table->columns, i);
|
pcol = g_ptr_array_index(table->columns, i);
|
||||||
|
|
||||||
if (IS_JET4(mdb)) {
|
if (IS_JET4(mdb)) {
|
||||||
@@ -284,7 +284,7 @@ GPtrArray *mdb_read_columns(MdbTableDef *table)
|
|||||||
fprintf(stderr,"Unknown MDB version\n");
|
fprintf(stderr,"Unknown MDB version\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
tmp_buf = (char *) g_malloc(name_sz);
|
tmp_buf = (unsigned char *) g_malloc(name_sz);
|
||||||
read_pg_if_n(mdb, tmp_buf, &cur_pos, name_sz);
|
read_pg_if_n(mdb, tmp_buf, &cur_pos, name_sz);
|
||||||
mdb_unicode2ascii(mdb, tmp_buf, name_sz, pcol->name, MDB_MAX_OBJ_NAME);
|
mdb_unicode2ascii(mdb, tmp_buf, name_sz, pcol->name, MDB_MAX_OBJ_NAME);
|
||||||
g_free(tmp_buf);
|
g_free(tmp_buf);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
static char software_version[] = "$Id: unittest.c,v 1.7 2005/01/15 05:02:09 calvinrsmith Exp $";
|
static char software_version[] = "$Id: unittest.c,v 1.8 2005/04/29 03:08:22 whydoubt Exp $";
|
||||||
static void *no_unused_var_warn[] = {software_version,
|
static void *no_unused_var_warn[] = {software_version,
|
||||||
no_unused_var_warn};
|
no_unused_var_warn};
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ int i;
|
|||||||
|
|
||||||
fprintf(stderr,"problem with SQLAllocConnect\n%s\n%s\n",
|
fprintf(stderr,"problem with SQLAllocConnect\n%s\n%s\n",
|
||||||
szSqlState, szErrorMsg);
|
szSqlState, szErrorMsg);
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ int i;
|
|||||||
|
|
||||||
fprintf(stderr,"problem with SQLSetConnectOption\n%s\n%s\n",
|
fprintf(stderr,"problem with SQLSetConnectOption\n%s\n%s\n",
|
||||||
szSqlState, szErrorMsg);
|
szSqlState, szErrorMsg);
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode = SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
|
retcode = SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
|
||||||
@@ -114,7 +114,7 @@ int i;
|
|||||||
|
|
||||||
fprintf(stderr,"problem with SQLSetConnectOption\n%s\n%s\n",
|
fprintf(stderr,"problem with SQLSetConnectOption\n%s\n%s\n",
|
||||||
szSqlState, szErrorMsg);
|
szSqlState, szErrorMsg);
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ int i;
|
|||||||
|
|
||||||
fprintf(stderr,"problem with SQLConnect\n%s\n%s\n",
|
fprintf(stderr,"problem with SQLConnect\n%s\n%s\n",
|
||||||
szSqlState, szErrorMsg);
|
szSqlState, szErrorMsg);
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ int i;
|
|||||||
|
|
||||||
fprintf(stderr,"problem with SQLAllocStmt\n%s\n%s\n",
|
fprintf(stderr,"problem with SQLAllocStmt\n%s\n%s\n",
|
||||||
szSqlState, szErrorMsg);
|
szSqlState, szErrorMsg);
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare the SQL statement with parameter markers. */
|
/* Prepare the SQL statement with parameter markers. */
|
||||||
@@ -184,7 +184,7 @@ int i;
|
|||||||
|
|
||||||
fprintf(stderr,"problem with SQLExecute\n%s\n%s\n",
|
fprintf(stderr,"problem with SQLExecute\n%s\n%s\n",
|
||||||
szSqlState, szErrorMsg);
|
szSqlState, szErrorMsg);
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
SQLBindCol(hstmt, 3, SQL_CHAR, szCol1, 60, &length);
|
SQLBindCol(hstmt, 3, SQL_CHAR, szCol1, 60, &length);
|
||||||
//SQLBindCol(hstmt, 1, SQL_CHAR, szCol1, 60, NULL);
|
//SQLBindCol(hstmt, 1, SQL_CHAR, szCol1, 60, NULL);
|
||||||
@@ -200,7 +200,7 @@ int i;
|
|||||||
if (retcode != SQL_NO_DATA_FOUND)
|
if (retcode != SQL_NO_DATA_FOUND)
|
||||||
{
|
{
|
||||||
printStatementError(hstmt, "problem with SQLFetch");
|
printStatementError(hstmt, "problem with SQLFetch");
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("Done\n");
|
printf("Done\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user