aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd/is_prime.cpp
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-12-08 19:56:19 +0100
committerSimon Warta <[email protected]>2015-12-08 22:02:28 +0100
commit368d087e3973db9d8c5b70443d31c27c03dfdbef (patch)
tree9059a52c70eee8b825d9fd7fa14194940853b86a /src/cmd/is_prime.cpp
parent53fca25da331d168b0433ba2e41b06aae9d17f5c (diff)
Replace C interfaces in cli apps with C++ interfaces
Diffstat (limited to 'src/cmd/is_prime.cpp')
-rw-r--r--src/cmd/is_prime.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/is_prime.cpp b/src/cmd/is_prime.cpp
index 703772477..71fec730b 100644
--- a/src/cmd/is_prime.cpp
+++ b/src/cmd/is_prime.cpp
@@ -12,20 +12,20 @@
namespace {
-int is_prime(int argc, char* argv[])
+int is_prime(const std::vector<std::string> &args)
{
- if(argc != 2 && argc != 3)
+ if(args.size() != 2 && args.size() != 3)
{
- std::cerr << "Usage: " << argv[0] << " n <prob>" << std::endl;
+ std::cerr << "Usage: " << args[0] << " n <prob>" << std::endl;
return 2;
}
- BigInt n(argv[1]);
+ BigInt n(args[1]);
size_t prob = 56;
- if(argc == 3)
- prob = to_u32bit(argv[2]);
+ if(args.size() == 3)
+ prob = to_u32bit(args[2]);
AutoSeeded_RNG rng;