Re: [gnome-db] Patch to libgnomedb for GnomeDbSqlEditor (Gnome2)

On Tue, 2002-03-26 at 08:00, Daniel Morgan wrote:
> Rodrigo,
> I just verified the patch for libgnomedb, I do not know why my two new
> files:
> gnome-db-sqleditor.c and gnome-db-sqleditor.h did not show up.
> Do new files have to be manually added to cvs?
> Anyways, I have a tarball that includes the two files above.
> In addition, the following needs to be done:
> * add the files (.c and .h) to libgnomedb/libgnomedb
> * add them to libgnomedb/ (in _HEADERS and _SOURCES)
> * #include the new .h in libgnomedb/libgnomedb.h
ok, patch applied, since it works, but I've got some comments, specially
about the coding style (you should read the HACKING file :-).

* I've renamed the files from gnome-db-sqleditor.* gnome-db-sql-editor.*

* we put the opening braces '{' in the same line as the command, except
for functions. That is:

	void function (void)
		if (whatever) {
			switch (i) {
			case 1 :
			default :

Also, when calling functions, we do:

	calling_a_function (param1, param2);

that is, a space between the function name and the opening '('. Also,
note no spaces are added after the '(' and before the ')' characters.

I fixed some of those, but please, for future code, follow this
convention, so that all the code looks the same.

* you should restrict lines to no more than 80 characters. In
gnome-db-sql-editor.c, after indenting all lines in emacs (with the C
style used in gnome-db), there are functions which are totally
unreadable. It is better if you separate your code in small functions
than nesting lots of if/switch/while/for/whatever to make lines with
100+ characters.

Apart from this, the code is ok, since it works, but it should be
cleaned up, so please, if you feel like, clean it up yourself, since you
know the code.

Rodrigo Moya <rodrigo gnome-db org> - <rodrigo ximian com> -

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]