Module: xenomai-jki
Branch: queues/proc
Commit: f52febbc6cdac59e96f508da216bbcf37a626ba5
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=f52febbc6cdac59e96f508da216bbcf37a626ba5

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Sun Apr 11 17:19:59 2010 +0200

irqbench: Auto-detect bases of port address and IRQ values

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 src/testsuite/irqbench/irqbench.c |    2 +-
 src/testsuite/irqbench/irqloop.c  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/testsuite/irqbench/irqbench.c 
b/src/testsuite/irqbench/irqbench.c
index 844f187..ca7a313 100644
--- a/src/testsuite/irqbench/irqbench.c
+++ b/src/testsuite/irqbench/irqbench.c
@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
                        break;
 
                case 'a':
-                       port_ioaddr = strtol(optarg, NULL, (strncmp(optarg, 
"0x", 2) == 0) ? 16 : 10);
+                       port_ioaddr = strtol(optarg, NULL, 0);
                        ioaddr_set = 1;
                        break;
 
diff --git a/src/testsuite/irqbench/irqloop.c b/src/testsuite/irqbench/irqloop.c
index 3b4de4f..d4623b4 100644
--- a/src/testsuite/irqbench/irqloop.c
+++ b/src/testsuite/irqbench/irqloop.c
@@ -101,12 +101,12 @@ int main(int argc, char *argv[])
                        break;
 
                case 'a':
-                       config.port_ioaddr = strtol(optarg, NULL, 
(strncmp(optarg, "0x", 2) == 0) ? 16 : 10);
+                       config.port_ioaddr = strtol(optarg, NULL, 0);
                        ioaddr_set = 1;
                        break;
 
                case 'i':
-                       config.port_irq = atoi(optarg);
+                       config.port_irq = strtol(optarg, NULL, 0);
                        irq_set = 1;
                        break;
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to