On (08/02/14 12:54), Sami Kerola wrote:
Date: Sat, 2 Aug 2014 12:54:12 +0100
From: Sami Kerola <kerolasa(a)iki.fi>
To: powertop(a)lists.01.org
Subject: [Powertop] [PATCH 07/12] move options structure to function scope
X-Mailer: git-send-email 2.0.3
Signed-off-by: Sami Kerola <kerolasa(a)iki.fi>
---
src/main.cpp | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/src/main.cpp b/src/main.cpp
index 99a985f..910fe5c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -69,23 +69,6 @@ int debug_learning = 0;
unsigned time_out = 20;
int leave_powertop = 0;
-static const struct option long_options[] =
-{
- /* These options set a flag. */
- {"debug", no_argument, &debug_learning, 'd'},
- {"version", no_argument, NULL, 'V'},
- {"help",no_argument, NULL, 'u'}, /* u for usage */
- {"calibrate",no_argument, NULL, 'c'},
- {"auto-tune",no_argument, NULL, 'a'},
- {"html", optional_argument, NULL, 'h'},
- {"csv", optional_argument, NULL, 'C'},
- {"extech", optional_argument, NULL, 'e'},
- {"time", optional_argument, NULL, 't'},
- {"iteration", optional_argument, NULL, 'i'},
- {"workload", optional_argument, NULL, 'w'},
- {"quiet", no_argument, NULL, 'q'},
- {NULL, 0, NULL, 0}
-};
static void print_version()
{
@@ -370,6 +353,24 @@ int main(int argc, char **argv)
char workload[4096] = {0,};
int iterations = 1, auto_tune = 0;
+ static const struct option long_options[] =
+ {
+ /* These options set a flag. */
+ {"debug", no_argument, &debug_learning, 'd'},
+ {"version", no_argument, NULL, 'V'},
+ {"help",no_argument, NULL, 'u'}, /* u for usage */
+ {"calibrate",no_argument, NULL, 'c'},
+ {"auto-tune",no_argument, NULL, 'a'},
+ {"html", optional_argument, NULL, 'h'},
+ {"csv", optional_argument, NULL, 'C'},
+ {"extech", optional_argument, NULL, 'e'},
+ {"time", optional_argument, NULL, 't'},
+ {"iteration", optional_argument, NULL, 'i'},
+ {"workload", optional_argument, NULL, 'w'},
+ {"quiet", no_argument, NULL, 'q'},
+ {NULL, 0, NULL, 0}
+ };
what for?
-ss
set_new_handler(out_of_memory);
setlocale (LC_ALL, "");
--
2.0.3
_______________________________________________
PowerTop mailing list
PowerTop(a)lists.01.org
https://lists.01.org/mailman/listinfo/powertop