Removes many compilation warnings.

This commit is contained in:
Jean-Michel Vourgère
2011-08-30 16:11:13 -04:00
committed by Brian Bruns
parent c5e92f52b0
commit 0a76d5716f
9 changed files with 52 additions and 98 deletions

View File

@@ -23,8 +23,6 @@
#include "dmalloc.h"
#endif
void mdb_dump_results(MdbSQL *sql);
#ifdef HAVE_WORDEXP_H
#define HAVE_WORDEXP
#include <wordexp.h>
@@ -32,6 +30,21 @@ void mdb_dump_results(MdbSQL *sql);
char *g_input_ptr;
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
void
mdb_sql_error(MdbSQL* sql, char *fmt, ...)
{
@@ -43,21 +56,7 @@ va_list ap;
va_end(ap);
fprintf(stderr,"\n");
}
void
mdb_sql_clear_error(MdbSQL* sql)
{
sql->error_msg[0]='\0';
}
char *
mdb_sql_last_error(MdbSQL* sql)
{
return sql->error_msg;
}
unsigned char
mdb_sql_has_error(MdbSQL* sql)
{
return (sql->error_msg[0] ? 1 : 0);
}
int mdb_sql_yyinput(char *buf, int need)
{
int cplen, have;
@@ -90,8 +89,6 @@ MdbSQL *sql;
#define _(x) x
#endif
void mdb_sql_bind_all (MdbSQL*);
/**
* mdb_sql_run_query:
* @sql: MDB SQL object to execute the query on.
@@ -112,7 +109,7 @@ mdb_sql_run_query (MdbSQL* sql, const gchar* querystr) {
/* begin unsafe */
_mdb_sql (sql);
mdb_sql_clear_error(sql);
sql->error_msg[0]='\0';
if (yyparse()) {
/* end unsafe */
mdb_sql_error (sql, _("Could not parse '%s' command"), querystr);