[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/geas STANDARDS src/connection.c src/oql/oql.c
From: |
Daniel E. Baumann |
Subject: |
gnue/geas STANDARDS src/connection.c src/oql/oql.c |
Date: |
Tue, 05 Jun 2001 13:56:59 -0700 |
CVSROOT: /cvs
Module name: gnue
Changes by: Daniel E. Baumann <address@hidden> 01/06/05 13:56:59
Modified files:
geas : STANDARDS
geas/src : connection.c
geas/src/oql : oql.c
Log message:
* gnue/geas/STANDARDS: Fix spelling and typos.
* gnue/geas/src/oql/oql.c (last_oql_error): Remove.
(get_last_oql_error): Remove.
(oql_query_as_sql): Initialize retval to NULL to supress warning.
Change all g_strdup_prinf calls to us the proper number of arguments.
(oql_make_select): Cast to q->maxresults to long.
* gnue/geas/src/connection.c (Connection_loadAll): Do not call
get_last_oql_error.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/STANDARDS.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/connection.c.diff?cvsroot=OldCVS&tr1=1.56&tr2=1.57&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/src/oql/oql.c.diff?cvsroot=OldCVS&tr1=1.56&tr2=1.57&r1=text&r2=text
Patches:
Index: gnue/geas/STANDARDS
diff -u gnue/geas/STANDARDS:1.5 gnue/geas/STANDARDS:1.6
--- gnue/geas/STANDARDS:1.5 Mon May 14 09:08:06 2001
+++ gnue/geas/STANDARDS Tue Jun 5 13:56:59 2001
@@ -20,7 +20,7 @@
error handling like "if (!param) exit 0;").
If the code doesn't conform, using "indent -nut codefile.c" for source
-files, or "indentJ -nut -di22 header.h" for header files could save you
+files, or "indent -nut -di22 header.h" for header files could save you
a big deal of work in changing the code. (Be sure to use GNU indent 2.2.6
or later).
The "-di22" indents variables in declarations to column 22.
@@ -35,7 +35,7 @@
Never rely on anything. Always expect that a parameter can have any value,
even NULL. If a certain value is not valid for a parameter and may not
occur in practice, use g_assert to check it. If a certain value is not valid
-for a parameter but can occur in pracice, use g_return[_value]_if_fail
+for a parameter but can occur in practice, use g_return[_value]_if_fail
to check it.
@@ -57,15 +57,15 @@
A detailled description of how comments should be done will follow sometime.
-Comments in Sourcecode
+Comments in Source Code
Every group of functions should be introduced with a comment like
/* ========================================================================= *\
- * This is an explaination what this group is for
+ * This is an explanation what this group is for
\* ========================================================================= */
-and every single function should be intoduced with a comment like
+and every single function should be introduced with a comment like
/* ------------------------------------------------------------------------- *\
* This is a short description of the function
@@ -73,8 +73,8 @@
There are 73 "=" or "-" characters.
The comments should as a rule of thumb be no longer than a line and only
-give an explaination what the role of the function/group is. Explaination
-on how to use the function should go in the seperate documentation.
+give an explanation what the role of the function/group is. Explanation
+on how to use the function should go in the separate documentation.
The code of the function itself should be self-explaining. If not, comments
should go near the tricky parts of the code, not in the function header.
vi and emacs macros should be used for this.
@@ -90,7 +90,7 @@
\* ========================================================================= */
/* ------------------------------------------------------------------------- *\
- * Open a connection to a running posgres server
+ * Open a connection to a running postgres server
\* ------------------------------------------------------------------------- */
int
geas_db_connect (char *dbname);
Index: gnue/geas/src/connection.c
diff -u gnue/geas/src/connection.c:1.56 gnue/geas/src/connection.c:1.57
--- gnue/geas/src/connection.c:1.56 Sat Jun 2 06:17:10 2001
+++ gnue/geas/src/connection.c Tue Jun 5 13:56:59 2001
@@ -20,7 +20,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: connection.c,v 1.56 2001/06/02 13:17:10 ntiffin Exp $
+ $Id: connection.c,v 1.57 2001/06/05 20:56:59 baumannd Exp $
*/
@@ -454,8 +454,7 @@
q = oql_find_all_objects(configdata, classname);
if (!q)
{
- make_ServerError_exception(ev, "Could not create query (%s)",
- get_last_oql_error());
+ make_ServerError_exception(ev, "Could not create query");
return (CORBA_OBJECT_NIL);
}
keystr = new_object_collection_from_query(q, id, ev);
Index: gnue/geas/src/oql/oql.c
diff -u gnue/geas/src/oql/oql.c:1.56 gnue/geas/src/oql/oql.c:1.57
--- gnue/geas/src/oql/oql.c:1.56 Tue Jun 5 11:50:22 2001
+++ gnue/geas/src/oql/oql.c Tue Jun 5 13:56:59 2001
@@ -19,7 +19,7 @@
along with GEAS; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- $Id: oql.c,v 1.56 2001/06/05 18:50:22 baumannd Exp $
+ $Id: oql.c,v 1.57 2001/06/05 20:56:59 baumannd Exp $
*/
@@ -39,15 +39,6 @@
int oql_sort_string_name (gpointer a, gpointer b);
-/* this was a bad idea - really not thread safe */
-static char *last_oql_error = NULL;
-const char *
-get_last_oql_error ()
-{
- fatal_error ("This function should not be called");
- return NULL;
-}
-
static void oql_add_conditions_to_sql (_QueryData * q, DBType db,
GString * buf);
static void oql_add_complex_conditions_to_sql (_QueryData * q, DBType db,
@@ -67,7 +58,7 @@
const char *
oql_query_as_sql (_QueryData * q, DBType database)
{
- char *retval;
+ char *retval = NULL;
char *type = NULL, *dbtype = NULL;
GString *buf = NULL;
@@ -349,7 +340,8 @@
case OQL_DBTYPE_CACHEONLY:
case OQL_DBTYPE_MYSQL:
if (is_word_reserved (mangled, db))
- quotedttable = g_strdup_printf ("__%s", mangled, db);
+ /* quotedttable = g_strdup_printf ("__%s", mangled, db); */
+ quotedttable = g_strdup_printf ("__%s", mangled);
else
quotedttable = g_strdup (mangled);
break;
@@ -357,7 +349,8 @@
case OQL_DBTYPE_POSTGRESQL:
quotedttable = g_strdup (mangled);
if (is_word_reserved (mangled, db))
- quotedttable = g_strdup_printf ("\"%s\"", mangled, db);
+ /* quotedttable = g_strdup_printf ("\"%s\"", mangled, db); */
+ quotedttable = g_strdup_printf ("\"%s\"", mangled);
else
quotedttable = g_strdup (mangled);
break;
@@ -372,14 +365,16 @@
case OQL_DBTYPE_MYSQL:
/* TODO: if column == illegal column name, change it */
if (is_word_reserved (column, db))
- quotedcolumn = g_strdup_printf ("__%s", column, db);
+ /* quotedcolumn = g_strdup_printf ("__%s", column, db); */
+ quotedcolumn = g_strdup_printf ("__%s", column);
else
quotedcolumn = g_strdup (column);
break;
case OQL_DBTYPE_POSTGRESQL:
/* TODO: if column == illegal column name, change it */
if (is_word_reserved (column, db))
- quotedcolumn = g_strdup_printf ("\"%s\"", column, db);
+ /* quotedcolumn = g_strdup_printf ("\"%s\"", column, db); */
+ quotedcolumn = g_strdup_printf ("\"%s\"", column);
else
quotedcolumn = g_strdup (column);
break;
@@ -594,7 +589,7 @@
if (q->uselimit)
{
- quoted = g_strdup_printf (" LIMIT %lu", q->maxresults);
+ quoted = g_strdup_printf (" LIMIT %lu", (long)q->maxresults);
g_string_append (buf, quoted);
g_free (quoted);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/geas STANDARDS src/connection.c src/oql/oql.c,
Daniel E. Baumann <=