Re: real_main & arg_parse patch 2nd try
- From: Dave Camp <dave ximian com>
- To: Jeroen Zwartepoorte <Jeroen xs4all nl>
- Cc: gnome-devtools gnome org
- Subject: Re: real_main & arg_parse patch 2nd try
- Date: 28 Jun 2001 14:44:16 -0400
This looks good, but I have a few stylistic issues that I'd like to see
addressed.
On 28 Jun 2001 20:27:48 +0200, Jeroen Zwartepoorte wrote:
> Here's the same patch as an attachment.
>
> Jeroen
> -static void open_history( gchar *filename )
> +/*static void open_history( gchar *filename )
> {
> -/*
> FILE* history;
> gchar buf[MAXLEN];
> gchar historywp[MAXLEN];
> @@ -68,30 +61,49 @@
> file_open_by_name( main_window, buf );
> }
> fclose( history );
> - } */
> -}
> + }
> +}*/
When disabling chunks of code, it is better to use the #if directive
than comments:
#if 0
function_call ();
/* Comment that would break things if you used comments
* to disable this code */
another_function_call ()
#endif
(I know there were comments there before, but while you're changing it
we might as well make it right)
> /* doesn't seem to belong here. should be in gI_cfg.c or so */
> -
> -
>
> -/* some things here happen also in prefs (since they change when prefs change).
> - so, should be in common function */
> -static void real_main( gint argc, gchar *argv[] )
> +gint main (gint argc, gchar **argv)
main returns an int, not a gint. Similarly, it takes int argv and char
**argv. I don't know what the policy is about using gtypes in gIDE (I
personally dislike them, but I think jpr likes them), but I do know that
you should match te prototype of an already declared function, and main
is declared to return an int.
Also, the gnome programming guidelines dictate that function definitions
should be formatted:
int
main (int argc, char *argv[])
{
}
(note the newline after the int).
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]