Patchwork Move the main() function from flashrom.c to cli_classic.c

login
register
about
Submitter Uwe Hermann
Date 2011-08-19 07:59:06
Message ID <20110819075905.GA341@greenwood>
Download mbox | patch
Permalink /patch/3360/
State Superseded
Headers show

Comments

Uwe Hermann - 2011-08-19 07:59:06
See patch.


Uwe.
Stefan Tauner - 2011-08-19 08:39:16
On Fri, 19 Aug 2011 09:59:06 +0200
Uwe Hermann <uwe@hermann-uwe.de> wrote:

> Move the main() function from flashrom.c to cli_classic.c.
> 
> The file flsahrom.c is part if libflashrom and should thus not contain a
           ^^^^^^^^^^ ;)
> main() function, that would break compilation of all frontends using
> libflashrom. Also, cli_classic.c is the right place anyway, as it's the
> main() of the CLI tool.
> 
> Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
> 
> Index: cli_classic.c
> ===================================================================
> --- cli_classic.c	(Revision 1416)
> +++ cli_classic.c	(Arbeitskopie)
> @@ -444,3 +444,9 @@
>  	programmer_shutdown();
>  	return ret;
>  }
> +
> +int main(int argc, char *argv[])
> +{
> +	return cli_classic(argc, argv);
> +}
> +

can't we just rename cli_classic to main and get rid of the wrapper
function? what's the purpose of it anyway?
Paul Menzel - 2011-08-19 08:49:47
Am Freitag, den 19.08.2011, 10:39 +0200 schrieb Stefan Tauner:
> On Fri, 19 Aug 2011 09:59:06 +0200 Uwe Hermann wrote:
> 
> > Move the main() function from flashrom.c to cli_classic.c.
> > 
> > The file flsahrom.c is part if libflashrom and should thus not contain a
>            ^^^^^^^^^^ ;)
                                ^^ s/if/of/

[…]


Thanks,

Paul
Tadas Slotkus - 2011-08-19 15:59:14
> can't we just rename cli_classic to main and get rid of the wrapper
> function? what's the purpose of it anyway?

I find it useful for globals init code (will post some patches in a day
or few) :)

Uwe, are you going to send patches removing exit() calls? :)

Thanks,
Tadas

Patch

Move the main() function from flashrom.c to cli_classic.c.

The file flsahrom.c is part if libflashrom and should thus not contain a
main() function, that would break compilation of all frontends using
libflashrom. Also, cli_classic.c is the right place anyway, as it's the
main() of the CLI tool.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>

Index: cli_classic.c
===================================================================
--- cli_classic.c	(Revision 1416)
+++ cli_classic.c	(Arbeitskopie)
@@ -444,3 +444,9 @@ 
 	programmer_shutdown();
 	return ret;
 }
+
+int main(int argc, char *argv[])
+{
+	return cli_classic(argc, argv);
+}
+
Index: flashrom.c
===================================================================
--- flashrom.c	(Revision 1416)
+++ flashrom.c	(Arbeitskopie)
@@ -1796,11 +1796,6 @@ 
 	}
 }
 
-int main(int argc, char *argv[])
-{
-	return cli_classic(argc, argv);
-}
-
 /* FIXME: This function signature needs to be improved once doit() has a better
  * function signature.
  */